feat: Fact tabs lead with the chart, one source in the text, no visible numbers box
Back to our planProblem
In plain words: when a neighbor opens a fact tab, the text comes first and the picture below it. They should see the picture first, with a short line under it, and the tab should not repeat itself.
Summary of the owner's request (2026-11-09, Claude conversation, text): lead each tab with its chart; keep the writing short; drop the repeated source line and the repeated "Show the numbers" box; keep the proposal note and the estimate label at the bottom of the tab.
Today (checked in FactTabs.tsx and Chart.tsx):
- A tab panel shows heading, certainty (phone), detail, definition, a "Source:" line, then the charts.
- Every
Chartdraws its own title, summary, key and caption, and then a closed "Show the numbers" accordion, so a tab with two charts shows the accordion twice. - Decision 0018 and the UI kit note say every chart carries its numbers as a real table under "Show the numbers".
Proposed fix
- Panel order: charts first, then the definition, then the proposal note and any estimate label at the bottom.
- One source, in the text: the tab's source link moves into the definition as a bold link on the City's own term, so the separate "Source:" line goes away. The editor stores the link, no code change per post.
- Numbers table: the visible "Show the numbers" accordion is removed from a chart whose drawing already prints every value. The same table stays in the page for screen readers, so the text alternative is not lost. Amends decision 0018 ("closed by default" becomes "hidden from sight, kept for screen readers"), recorded in the same PR.
- Smaller pieces: the "See the smaller pieces" accordion stays as it is.
Native first, one line per step:
- Native: the Tabs component and the existing panel list already order what the editor adds; a visually hidden table is plain HTML.
- Official plugins: none apply.
- Open source: none apply.
- Our code: panel order in
FactTabPanel, and aChartoption for the table's visibility.
Acceptance criteria
- Not done: In every fact tab the chart comes before the definition; the proposal note and estimate label stay at the bottom.
- Not done: No separate "Source:" line; the definition's term links to the source.
- Not done: No visible "Show the numbers" on a fact-tab chart; the table is still read by a screen reader (axe and a test that the table is present).
- Not done: Nothing overflows or misaligns at 320, 360, 375, 600 and 1000 px, in light and dark.
- Not done: Tests first; gallery entry and
docs/ui/component-set.mdupdated; the UI kit note and decision 0018 updated in the same PR.
Files likely touched
src/platform/richtext/editorial/FactTabs.tsx, src/platform/ui/chart/Chart.tsx, src/platform/ui/chart/ChartDataTable.tsx, docs/architecture/decisions/0018-charts-behind-our-own-port.md, src/platform/ui/README.md
Must not touch
The tab buttons and the chart palette (#856), the tab-join animation (#706), the page-menu layout (#677).
Open questions
None for the owner. Overlap: #856 also edits src/platform/ui/chart/*; this issue keeps to the table and panel order and rebases on #856 if it merges first.
Area
frontend, ux, visualization
Priority
high
Generated by Claude Code, opens in a new tab