Repository navigation
Description
Needs your OK: this changes the number on the Build tab to the number of slots, kept up to date as slots are added and deleted. Swap pipeline:proposed for pipeline:ready to have it built.
What happens
A signup's page shows a count beside the Build and Responses tabs (TabsNav in src/components/signup/TabsNav.tsx). The layout passes Build's count as sig.fields.length + sig.slots.length (src/app/app/(chrome)/signups/[id]/layout.tsx). A signup with 4 slots and 3 fields reads "Build 7", a number that matches nothing on the page. The rail on the same tab already says "Fields (3)".
- It goes stale. The layout is a server component. Adding, duplicating or deleting a slot changes the builder's own state (
useBuildState), not the layout, and moving between tabs keeps the layout as it was. Only a reload changes the number, or a server action that revalidates the layout (revalidateSignupinactions.ts: Publish, Close, a Settings save, removing someone). - Screen readers hear "Build 7", with nothing to say what it counts.
The sum dates from the spreadsheet Build tab (#65), where fields were columns and slots were rows. No comment explains it, and no test pins it.
To see it: create a signup by hand and give it 3 fields and 4 slots. The tab reads "Build 7". Choose Add a slot: there are 5 slots, and the tab still reads 7. Reload, and it reads 8.
Fix, in outline
- Count slots only. The server's first value is
sig.slots.length. - Keep it up to date. The Build tab reports its slot count through the bridge Check the page when Publish and share is pressed #580 adds between the Build tab and the layout (
BuildBridgeinsrc/components/signup/BuildBridge.tsx).TabsNavshows the reported count once there is one, and the server's count until then. The bridge lives in the layout, so the count stays right on Responses and Settings after slots change. - Say what it counts. Screen readers hear "Build, 4 slots" (visually hidden text beside the number).
Watch for
- Overlap. Check the page when Publish and share is pressed #580 changes
TabsNav.tsxandlayout.tsx, and The signup tabs' keyboard focus ring is cut off at the top and bottom #586's fix changes the same tabLink. Whichever lands second has a small merge. - Slots added elsewhere. A connected assistant can add slots while the page is open. The count follows the Build tab's state, as the slot list does. Don't add polling for this.
- The AI draft banner gets
fieldsCountandslotsCountfrom the same load. Leave it alone. - CHANGELOG entry.
Choices this makes
- What it counts: slots. Default: slots. The rail already counts fields, and a slot is what people sign up for.
- Keep the count, or drop it. Default: keep it, and keep it up to date. The other way is to remove Build's count: the tab shows its own slots, and nothing can go stale. If you pick that, the Order line below no longer applies.
- Screen reader wording: "Build, 4 slots". Default: as written. Responses keeps its plain number, since "Responses, 2" already says what it counts.
Order
After #580, which adds BuildBridge, the link between the Build tab and the layout that the up-to-date count uses. Built on main first, this would add a second context in the same layout.
Done when
- A signup with 4 slots and 3 fields reads "Build 4".
- Adding, duplicating or deleting a slot changes the count at once, and Responses and Settings show the new count without a reload.
- Screen readers hear "Build, 4 slots".
- A unit test pins the count and its update.
pnpm lint && pnpm typecheck && pnpm knip && pnpm testpass.
Found by the UX walkthrough (scenarios O1 and X1) on 2026-10-24, and checked against the code on main at 4ed27a9.
Generated by Claude Code
Activity