Skip to content

fix(ui): readable stat titles, card meta pill inside its card, charts follow the theme toggle - #914

Open
fedepini wants to merge 5 commits into
mainfrom
fix/dashboard-card-readability
Open

fedepini wants to merge 5 commits into
mainfrom
fix/dashboard-card-readability

Conversation

@fedepini

@fedepini fedepini commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Readability fixes reported on /dashboard. Each one applies everywhere its widget is used.

1. Stat titles read at a glance

Two places:

  • Listy statistic strip (11 portal pages): the title was antd's 13px muted label under a 31px number.
  • Statistic widget (16 portal widgets on Observability and in the composition's reconcile stats): the title was an 11px muted mono uppercase eyebrow.

Both are now body size (15px), bold, in the text colour. The number stays the strongest mark and the caption stays muted. This was option A of three; the others were an eyebrow for everything, and an icon beside the title.

Both selectors have three classes, so they win over antd's .ant-statistic .ant-statistic-title, which is injected after the module sheets. With two classes only the weight applied.

2. A card's meta pill no longer runs past its card (Listy card, subPrimaryText)

.verBadge was flex: none; white-space: nowrap. A long value, such as "Blueprint install failures, ClickHouse disk below 20% free, …", overflowed the card and the panel. It now shrinks to the meta line (min-width: 0; max-width: 100%) and scrolls the rest sideways inside itself. A short value, like a version, is unchanged.

3. Pie, Bar and Line charts follow the theme toggle

G2 reads the legend and axis ink and the palette when it draws, and does not redraw when the theme flips. After a toggle to light, the dashboard's "By source" donut kept white legend labels on the white card, so they were invisible, and kept its dark slice colours. A page reload fixed it. Each chart now reads useDocumentThemeMode() and is keyed on the mode, so it is drawn anew.

Verification

  • vitest run src/widgets/{List,Statistic,PieChart,BarChart,LineChart} src/theme: all pass.
  • New tests:
    • ListView.cardMetaOverflow.test.tsx
    • the strip title block in ListView.statistic.test.tsx
    • the theme-toggle case in PieChart.test.tsx, which fails without the fix ("the toggle did not reach the chart").
  • stylelint, eslint and tsc --noEmit are clean.
  • Checked on kind with vite dev at http://krateo.localhost:4000:
    • /dashboard: the strip titles compute to 15px / 600 / the text colour, in dark and light. The long meta pills stay inside their cards and scroll. The donut legend and slices switch correctly dark ⇄ light without a reload.
    • /observability SLOs: the Statistic title "API · snowplow" computes to 15px / 600 / the text colour, with no uppercase.
    • Bar and Line charts take the same change and pass their tests; I did not toggle them in the browser.

🤖 Generated with Claude Code

fedepini and others added 2 commits December 3, 2026 15:19
…flowing it

The card row's meta pill (subPrimaryText, .verBadge) was `flex: none; white-space: nowrap`, so a
long value (the dashboard's "Blueprint install failures, ClickHouse disk below 20% free, …") ran
past the card and the panel around it. It now shrinks to the meta line (min-width: 0,
max-width: 100%) and scrolls sideways what does not fit; a short value (a version) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stats strip's title (Listy rowVariant statistic) was antd's 13px muted label, hard to read
under a 31px number ("Open incidents" on /dashboard). It is now body size (15px), bold, in the
text colour; the number stays the tile's strongest mark and the caption stays muted. Only the
Listy strip: the Statistic widget keeps its eyebrow label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fedepini
fedepini requested a review from a team as a code owner December 3, 2026 14:39
@fedepini
fedepini requested review from EdmondDantes21 and removed request for a team December 3, 2026 14:39
fedepini and others added 2 commits December 3, 2026 15:52
The Statistic widget's title was an 11px muted mono uppercase eyebrow (16 portal widgets:
observability, the composition's reconcile stats). It is now what the stats strip's title is:
body size, bold, in the text colour. Three classes, so it wins over antd's own title rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G2 reads the legend and axis ink and the palette when it draws, and does not draw again when the
theme flips: after a toggle to light, the dashboard's "By source" donut kept its dark-mode white
legend labels on the white card (invisible), and its dark slice colours. Each chart now reads the
document's mode (useDocumentThemeMode) and is keyed on it, so it is drawn anew in the new mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fedepini fedepini changed the title fix(list): stat tile titles read at a glance; a card's meta pill stays inside its card fix(ui): readable stat titles, card meta pill inside its card, charts follow the theme toggle Dec 3, 2026
…e test awaits its microtask

- visual: Statistic-0 light and dark regenerated (visual/docker.sh --update-snapshots -g Statistic):
  the title is now body size, bold, in the text colour (8ab7759), so the image is 4px taller.
- PieChart.test: the theme toggle is awaited inside act, with an explicit microtask for the
  MutationObserver that reads data-theme, which also satisfies require-await.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@braghettos braghettos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One stale comment to fix before merge: ui/src/widgets/List/ListView.module.css line 442 still says "Only the Listy strip: the Statistic widget keeps its eyebrow label (Statistic.module.css)", but this PR also restyles Statistic.module.css to the bold body-size title. Please update the comment (and the description's scope: standalone Statistic widgets change too). Optional: Bar and Line charts remount on a theme toggle like Pie, but only PieChart has a toggle test.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants