Skip to content
SprecherEast
Issue 664

feat: Fact tabs block: key facts that open charts and a timeline

Back to our plan
Done
enhancementfrontendcmsuxpriority: highshared-component

Problem

In plain words: a neighbor should see the headline numbers at once and then pick a view (day-to-day money, big projects, one home, dates) to see the pictures. The key-fact cards themselves become the tab buttons, so nothing is hidden behind a vague "Tab 2".

Summary of the owner's feedback (2026-11-03, Claude in Chrome side panel, text) on the first version of the 2027 budget post: the title is too long and the explanation under it is confusing; the amounts are not grouped in consistent categories, and they don't show how much of the total each one makes up or how this year compares with last year; the icons sit above the text, and the subheader could share a line with the icon. Most importantly, there are not enough visual cues for anyone to follow what is going on, so more diagram elements, charts, infographics and other UI elements are needed, with inventive, unconventional thinking, as if written by someone on a small marketing project who knows nothing about taxes. Design spec and numbers: see #645 and the epic #589.

Today (checked 2026-11-03): Key facts, Timeline and (after #640) Chart blocks exist separately; nothing combines them, and a post with all of them is long.

Proposed fix

  • Native first: Payload blocks and nested blocks fields, our Tabs (I3), Key facts (I2) and Chart (#640). No plugin applies.
  • New editorial block factTabs: tabs (2 to 4); each has the shared key-fact fields (keyFactFields(): value, label, icon, certainty, link), heading (at most 40), definition (textarea, at most 240) and panel (a blocks field, 1 to 2 blocks, allowed: Chart, Timeline).
  • toFactTabsProps reuses toKeyFactsProps, toChartSpec and toTimelineProps. Render: Tabs with each trigger a FactCard (an interactive variant: focus ring and selected state with border-primary). Each panel: heading, definition, then its blocks. Phone: tab list 2 by 2 below sm, one row of four from sm.
  • Markdown for agents: <FactTabs tabs={[…]} />, with nested panel blocks as plain JSON; import runs the Chart schema, and Payload's field validation covers Timeline. Round trip tested.
  • Watch out: the editorial blocks are shared by every post and event.

Acceptance criteria

  • Not done: An editor builds a Fact tabs block in Admin on a post; the nested chart and timeline render, one panel at a time with scripting on, all stacked with it off.
  • Not done: 2 to 4 tabs enforced; an invalid chart inside a panel shows a field error.
  • Not done: Markdown to block to Markdown round trip in a test; submitSuggestion accepts it and refuses a malformed one with a clear error.
  • Not done: A fixture post at 1920 by 1080, 100% zoom: title, lead, four tabs and the first panel fit one screen (screenshot in the PR); also 320 and 430, light and dark, no sideways scroll, touch targets at least 44px.

Area

frontend, cms, ux

Priority

high


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab