Repository navigation
Description
What happens
#1077 put a slot count beside the Build tab. The signup layout (src/app/(organizer)/app/(chrome)/signups/[id]/layout.tsx) builds one slots value and passes it twice:
- To
BuildBridge, as the initial count. The bridge keeps it in state,BuildWysiwygupdates it throughuseReportSlotCount, and it's provided throughSlotsContext. - To
TabsNav, ascounts.slots.TabsNavreadsuseSlotCount() ?? counts.slots.
Inside a BuildBridge, useSlotCount() is never null. The provider's value starts as the required slots prop and is only ever set to another SlotCount. The one production render of TabsNav is in that layout, inside the bridge. The layout's error branches render only SignupLoadError, and there is no error.tsx, loading.tsx or not-found.tsx under src/app/(organizer). So counts.slots and its five-line doc comment are only used by the seven bridge-less renders in TabsNav.test.tsx.
Only developers are affected. The count on screen comes from the bridge either way.
Fix, in outline
- Drop
slotsfromTabsNav'scountsprop and its doc comment. Read the count fromuseSlotCount()alone. useSlotCount()returnsSlotCount | null. SinceTabsNavis its only caller, either throw when it's null ("TabsNav must sit inside a BuildBridge") or make the hook throw.- In the layout, pass
counts={{ responses: responsesCount }}. Keepslots={slots}onBuildBridge. It's the initial value, the only count on the Responses and Settings tabs, and what replaces the Build tab's last report when the layout reloads. - Wrap the seven
TabsNav.test.tsxrenders in<BuildBridge … slots={…}>, asBuildBridge.test.tsxalready does (a small render helper keeps it short). Dropcounts.slotsfrom the twoBuildBridge.test.tsxrenders.
Watch for
- The two
{ count, spoken }builders stay. One is in the layout (server translator) and one is inBuildWysiwyg(client). Both are needed, and both read the same catalog message, so they can't drift. - Overlap. Open PR Fit a signup's three tabs on a 320px phone in every language #1112 changes classes in
TabsNav.tsx, so whichever lands second has a small merge.
Done when
TabsNavhas nocounts.slots, and nothing passes it.- The
TabsNavandBuildBridgetests pass with the tab still showing its count. pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm testpass.
Found by the pipeline's refactor scout in the organizer app (src/app/(organizer)/app/(chrome)/signups/[id], src/components/signup), at 09127b0. Checked by an independent verify agent. It grepped every <TabsNav render in src and tests, traced SlotsContext's value, checked the layout's error branches and route files, and ran the 28 TabsNav and BuildBridge tests (pass). https://claude.ai/code/session_016YZ9SUU7gKULMTji6bA6jw
Activity