Skip to content

feat(redesign): two metric patterns, not four - #867

Merged
thinkclay merged 1 commit into
mainfrom
redesign/r1-817-metrics
Sep 22, 2026
Merged

thinkclay merged 1 commit into
mainfrom
redesign/r1-817-metrics

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #817. Release 1, epic #847. Independent of the #864 → #865 → #866 stack — branches from main.

The problem

The app drew a stat four ways:

Where How
office-ccpa-dashboard a local MetricCard — seven bordered, tinted boxes, each caller picking a hex
analytics/KpiCard a bordered card, 12px label, 28px figure, sparkline in a second column
analytics/VisibilityScreen three more bordered cards, inline
MetricBlock / MetricRow the shared pair #621 added, which almost nothing used

The prototype's audit named it twice: "metric labels change position" and "four ways to draw a stat block".

The rule

A hairline band for a page's own metrics; a card grid only for the public transparency pages; the tinted callout reserved for "the other side sees this". All three surfaces here are a page's own metrics, so all three become bands.

  • office-ccpa-dashboard — the local MetricCard is deleted and its seven call sites become one MetricRow. Tone is now stated rather than inferred from a colour prop, which matters: a rising overdue count is not good news, and each caller used to pick that hex itself.
  • analytics/KpiCard — rebuilt on MetricBlock. The sparkline survives as an adornment in the delta line rather than a second column, so label-figure-delta holds whether or not a metric has one.
  • VisibilityScreen — three summary cards become a band, taking the last two fontSize: 28 figure literals with them.

MetricWidget in packages/ui needed no work: already commented out of the index, no callers.

Verified

nx run scf-core:typecheck and 1175/1175 tests clean; pnpm prepush clean. /dashboard/analytics and /dashboard/analytics/visibility render with no sideways scroll at 1440 or 390.

The bands themselves need data to see. The seeded account has no analytics history, so both screens show their empty state. The structural change is verified by typecheck, tests and the absence of layout breakage; the populated appearance is not, and I am not claiming it.

Left deliberately

The four fontSize: 22 in the analytics screens are page titles, not figures. They duplicate the heading the layout renders in #864 and should be deleted with that work rather than here, where this branch has no heading to defer to.

🤖 Generated with Claude Code

The app drew a stat four ways: the CCPA dashboard's local `MetricCard`
(seven bordered, tinted boxes), analytics' `KpiCard` (a bordered card
with a 12px label and a 28px figure), VisibilityScreen's three more
cards, and the shared `MetricBlock`/`MetricRow` that #621 added and
almost nothing used. The prototype's audit named it twice — "metric
labels change position" and "four ways to draw a stat block".

The rule, from #817: a hairline band for a page's own metrics, a card
grid only for the public transparency pages, and the tinted callout
reserved for "the other side sees this". These three surfaces are a
page's own metrics, so they become bands.

- `office-ccpa-dashboard`: the local `MetricCard` is deleted and its
  seven call sites become one `MetricRow`. Tone is now stated rather
  than inferred from a colour prop — a rising overdue count is not good
  news, and `MetricCard` had each caller pick a hex for that itself.
- `analytics/KpiCard`: rebuilt on `MetricBlock`. The sparkline survives
  as an adornment in the delta line rather than a second column, so the
  label-figure-delta order holds whether or not a metric has one.
- `VisibilityScreen`: three summary cards become a band; the two
  remaining `fontSize: 28` figure literals go with them.

`MetricWidget` in packages/ui needed no work: it is already commented
out of the index and has no callers.

Left: the four `fontSize: 22` in the analytics screens are page titles,
not figures. They are duplicates of the heading the layout renders in
#864 and should be deleted with that work, not here.

Verified: typecheck and 1175/1175 clean; `/dashboard/analytics` and
`/dashboard/analytics/visibility` render with no sideways scroll at 1440
or 390. The bands themselves need data to see — the seeded account has
no analytics history, so both screens show their empty state.

Refs #817

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit b093d7c into main Sep 22, 2026
9 checks passed
@thinkclay
thinkclay deleted the redesign/r1-817-metrics branch September 22, 2026 19:43
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.

feat(redesign): two metric patterns, not four — MetricRow bands and transparency card grids

1 participant