Skip to content
SprecherEast
Issue 1112

feat: Fact tab buttons: equal width, label only

Back to our plan
Done
enhancementfrontendstylinguxpriority: mediumshared-componentready

Problem

Fact tab buttons each hold an icon, a label and a figure, so the four buttons are tall, uneven and busy on a phone, and the figure repeats what the open panel says.

Owner's decision (2026-11-11, chat session, after reviewing a mockup): the tab buttons become plain and equal, label only, and the shared tab component takes that look everywhere it is used. He accepted that the figures leave the buttons (reverses #856).

Proposed fix

  • Tab buttons: one row of buttons of the same width and height, the label centred, no icon and no figure. The selected tab has the primary border and a soft primary fill; the others are quiet. The row sits above the panel as separate buttons (not joined to it as a folder).
  • Labels: short enough to sit centred on one line at phone width; the block's label limit in editorial/editorialLimits.ts is set to match, so an editor cannot save a label that would wrap. Existing labels that are too long are shortened in the CMS, not truncated by CSS.
  • Nothing is lost: a tab's figure and certainty show in its open panel (they already do beside the heading); screen readers still hear them from the button.
  • Unchanged: the #tab- link of each tab, opening a link on its tab, keyboard movement between tabs, working without scripting.
  • The shared Tabs owns the look, so every use gets it; this issue lists each use and checks it.
  • #706 (slide the folder join) no longer applies once the join is gone: propose closing it.

Acceptance criteria

  • Not done: Failing tests first for the look test (Tabs.look.test.tsx): equal widths, one line, selected state.
  • Not done: Two, three and four tabs each fill the row with equal buttons at 320, 390, 768 and 1280 px; no label wraps or clips.
  • Not done: The selected tab is told apart by more than color (border weight or fill plus aria-selected), in light and dark, from theme tokens only; the touch size meets the kit's minimum.
  • Not done: #tab- links, arrow-key movement and the no-script fallback behave exactly as before (existing tests stay green without being weakened).
  • Not done: A tab's figure, including {yearly} and {monthly}, still shows in its panel heading and still counts.
  • Not done: Every page and post that uses Tabs is listed on this issue and checked; the gallery entry is updated.
  • Not done: The UI kit note, the rich text note and docs/ui/component-set.md describe the new look in the same PR.

Files likely touched

  • src/platform/ui/Tabs.client.tsx, Tabs.look.test.tsx, Tabs.client.test.tsx
  • src/platform/richtext/editorial/FactCard.tsx (the tab variant), FactTabs.tsx (the button face only), their tests
  • src/platform/richtext/editorial/editorialLimits.ts
  • src/app/(frontend)/dev/gallery/TabsGallery.tsx
  • src/platform/ui/README.md, src/platform/richtext/README.md, docs/ui/component-set.md

Must not touch

  • src/platform/richtext/editorial/BillShare.client.tsx, RoughEstimator.tsx, src/platform/ui/Field.client.tsx (the layout and estimator issues own them)
  • src/platform/richtext/editorial/tabAnchors.ts

Open questions

None.


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab