Repository navigation
feat(redesign): two metric patterns, not four - #867
Merged
Merged
Conversation
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]>
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
office-ccpa-dashboardMetricCard— seven bordered, tinted boxes, each caller picking a hexanalytics/KpiCardanalytics/VisibilityScreenMetricBlock/MetricRowThe 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 localMetricCardis deleted and its seven call sites become oneMetricRow. 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 onMetricBlock. 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 twofontSize: 28figure literals with them.MetricWidgetinpackages/uineeded no work: already commented out of the index, no callers.Verified
nx run scf-core:typecheckand 1175/1175 tests clean;pnpm prepushclean./dashboard/analyticsand/dashboard/analytics/visibilityrender 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: 22in 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