chore(shared-charts): soften the curated palette #185
Reference in New Issue
Block a user
Delete Branch "chore/charts-palette-tuning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Tune the curated chart palette to a softer, lower-saturation set. The values shipped in #175 were pulled straight from Tailwind's
-600 / -700ramp; on real audit-log data the donut's three slices and the bar-chart's blue read as too punchy when they share a tile, especially in dark mode. Same five intents, same a11y posture — just less visual fight.What lands
libs/shared/charts/src/lib/_internal/palette.ts:DEFAULT_BAR_FILL#1d4ed8#4075e7semanticStatusColors.info#2563eb#4075e7semanticStatusColors.success#16a34a#46ac6bsemanticStatusColors.warning#ea580c#f38043semanticStatusColors.error#dc2626#eb5252semanticStatusColors.neutral#6b7280#6b7280(unchanged)infoandDEFAULT_BAR_FILLcollapse to the same hex — bars and "informational" donut slices are meant to read as the same semantic class (no special status), so unifying them at the constant level removes a future drift hazard.Docstrings updated alongside — the previous comments name-checked Tailwind shades (
green-600,tailwind blue-700) that no longer correspond to the values; the new comments describe the palette by intent (muted green,muted orange, ...) and call out that the softening is deliberate.Notes for the reviewer
libs/shared/tokens/brand-tokens.css? Brand-primary is the dark teal#12546cand brand-accent is#f7a919. Neither reads correctly as "success" or "neutral chart fill"; the charts need a categorical palette tuned for legibility on dense surfaces, not for chrome and CTAs. Keeping the chart palette in its own lib stays consistent with ADR-0023's "lib owns the palette" stance.infosemantic alias to the same value on purpose. A bar with no per-bar encoding is semantically "informational quantity over time" — the same intent as a donut slice taggedinfo. Future consumer that wants to flag a single "info" bar inside a stacked chart will read the colour as consistent.<lib-bar-chart>,<lib-donut-chart>, the audit page) import these constants by name; the swap is purely a value change.Test plan
pnpm nx test shared-charts— 15 specs pass (the donutcolorMapspec asserts the consumer-provided hexes, not the lib defaults, so the change is transparent there; the bar single-fill spec checks uniqueness, not the specific value).pnpm nx test portal-admin— 62 specs pass.pnpm nx run-many -t test build lint -p shared-charts,portal-admin— clean (same three pre-existing lint warnings unrelated to this PR).pnpm nx serve portal-admin, sign in withPortal.Admin, navigate to/admin/audit, switch to Charts:main— the new shades feel calmer, especially when multiple charts share the viewport.What's next
Nothing pending on the palette front. If a future chart needs a sixth intent (e.g.
pendingfor in-flight states), add it here with a contrast / colour-blind check and update the typedSemanticStatusunion in the same PR.