Skip to content

refactor(admin): migrate AdminDashboard onto shared ui layer (#1 #2)#104

Merged
miquelmatoses merged 1 commit into
mainfrom
refactor/admin-shared-layer
Jun 22, 2026
Merged

refactor(admin): migrate AdminDashboard onto shared ui layer (#1 #2)#104
miquelmatoses merged 1 commit into
mainfrom
refactor/admin-shared-layer

Conversation

@miquelmatoses

Copy link
Copy Markdown
Collaborator

Fifth PR of the Phase 18 consolidation program. The risky one. Presentational only: no data fetching, state, handlers, endpoint calls, or admin behavior changed.

Changes

  • New shared primitives: components/ui/StatCard.jsx and components/ui/Sparkline.jsx (token-colored charting primitive). Admin imports the shared layer; local StatCard/Sparkline definitions deleted.
  • 16 hand-rolled card strings removed: 14 div-based shells now use the canonical flat Card (ADR 0015); the one <a> link card (cannot be a div Card) had its classes aligned to the flat spec. Zero rounded-xl border-gray-100 shadow-sm remain.
  • Hardcoded hex -> tokens: Sparkline default + call sites use colors.blue/colors.green; recharts grid stroke uses var(--mm-color-gray-200) (matching the existing var(--mm-color-blue) bar fill).
  • Phantom --mm-font-heading dropped: it was defined nowhere and resolved to the inherited font, so the drop is visually identical (StatCard number stays Roboto; page h1 stays Playfair via the global rule).

Scope note

Raw Tailwind gray text utilities are left as-is: mm-design gray token values are identical to Tailwind's gray scale, so they are not color drift; converting them to inline var() would add inline styles for zero visual change.

Gates

  • npm run build: green (structurally validates the JSX / Card tag balance)
  • npm test -- --run: 248 passed
  • Admin runtime visuals are NOT covered by tests (LOW confidence). Visual QA on deployed cercol.team is the operator's to eyeball.

🤖 Generated with Claude Code

…rd, tokens)

Audit items #1 and #2. Presentational only: no data fetching, state, handlers,
endpoint calls, or admin behavior changed.

- Added components/ui/StatCard.jsx and components/ui/Sparkline.jsx (token-colored
  charting primitive). Admin now imports the shared layer; the local StatCard and
  Sparkline definitions are deleted.
- Replaced all 16 hand-rolled card strings (rounded-xl border-gray-100 shadow-sm):
  14 div-based shells now use the canonical flat Card (ADR 0015); the one <a>
  link card cannot be a div Card, so its classes were aligned to the flat spec
  (rounded, gray-200 border, no shadow). Zero rounded-xl/shadow-sm card strings
  remain.
- Replaced hardcoded brand hex with tokens: Sparkline default and call sites use
  colors.blue / colors.green; the recharts grid stroke uses
  var(--mm-color-gray-200), matching the existing var(--mm-color-blue) bar fill.
- Dropped the phantom var(--mm-font-heading) (defined nowhere). It resolved to
  the inherited font, so the StatCard number stays Roboto and the page h1 stays
  Playfair via the global h1 rule. No visual change from the drop.

Scope note: raw Tailwind gray text utilities are left as-is. The mm-design gray
token values are identical to Tailwind's gray scale, so these are not a color
drift; converting them to inline var() styles would add inline styles for zero
visual change. Full <Card> adoption for the remaining <a> link card is a
follow-up.

Admin runtime visuals are not covered by tests (the build is the automated
gate); visual QA on deploy is the operator's.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@miquelmatoses miquelmatoses merged commit 73017ac into main Jun 22, 2026
7 checks passed
@miquelmatoses miquelmatoses deleted the refactor/admin-shared-layer branch June 22, 2026 22:44
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.

1 participant