Issue #46: Accent colour — accent (tint) on /operator/personalization #59
Loading…
Reference in a new issue
No description provided.
Delete branch "issue/46-accent-colour"
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?
New page
/operator/personalizationwhere the operator picks the console accent — the tint applied to the brand token. The existing Settings appearance control keeps showing system / light / dark, unchanged.What ships
dashboard/src/app.css—--accent-hue: 260in:root; the hue of five literals is nowvar(--accent-hue): light--primary,--accent,--sidebar-ring; dark--primary,--accent. Lightness and chroma stay in the stylesheet per theme.--ring,--info,--chart-1,--sidebar-primary, the soft wash, focus rings, and links all derive from--primary, so they follow for free.dashboard/src/lib/theme.ts—ACCENT_STORAGE_KEY,ACCENT_HUE_TOKEN,DEFAULT_ACCENT_HUE,ACCENT_PALETTE(7 anchors),parseAccentHue,readStoredAccentHue,persistAccentHue,applyAccentHue, theaccentHuestore,setAccentHue.dashboard/src/app.html— the boot IIFE also readsgotoi-accentand writes--accent-huebefore first paint, so a reload never flashes the wrong tint.dashboard/src/routes/operator/personalization/+page.svelte— new page: seven tint anchors with swatches, Reset to Indigo, a live preview (primary / outline / link / soft wash), and a pointer to Settings › Appearance for the theme.nav.ts(Operator item +paletteicon),page-help.ts,destinations.ts,scripts/e2e/nav_selenium.py.docs/use-cases/frontend/UC-FE-99-accent-personalization.md— new UC;related:+## Relatedadded bidirectionally toUC-FE-08,UC-FE-80,UC-FE-85; indexed indocs/use-cases/README.md.Rebased onto develop
Issue #44 landed
UC-FE-98-hidden-system-plansondevelopafter this branch was cut, taking the idUC-FE-98. The branch is rebased ontodevelopand the accent UC renumbered to UC-FE-99 — id, filename,
related:backlinks and the test citations all move together. UpstreamUC-FE-98(system plans)is untouched.
Design
One hue custom property, not a JS palette. The tint is
--accent-hueondocument.documentElement; the CSS cascade does the rest and no JS knows the palette. Default 260 reproduces the shipped Polar Indigo exactly.Consequence, recorded: dark
--primaryhue moved 262 → 260 (2°, imperceptible) so both themes share one knob.Contrast measured in the running browser (oklch → sRGB → WCAG relative luminance) on the rendered
--primary/--primary-foregroundpair: light bottoms at 5.06:1 (Emerald, the worst anchor); dark spans 8.66–9.44:1. Every anchor clears AA with margin.Verification
python3 docs/use-cases/_check.py— pass (356 UC files, all conform)python3 scripts/check-ai-headers.py— pass (572 ok, 0 missing, 0 malformed)python3 scripts/check-type-mirror.py— pass (exit 0)cd dashboard && bun run test— pass (16 files, 249 tests)cd dashboard && bun run check— pass (2346 files, 0 errors, 7 pre-existing warnings)cd dashboard && bun run build— pass (adapter-node, exit 0)rg -n 'Showing lines'— only pre-existing doc quotes; no source filecd agent && gofmt -l agent— empty (no agent file touched)Browser smoke against a real Chromium and a live middleware: fresh browser shows no inline override and
--primary: oklch(0.52 0.12 260)with Reset disabled; click Azure → inline230, computedoklch(0.52 0.12 230); reload keeps 230 with no flash and no console or hydration errors; Reset removes the inline property; dark theme keeps its own lightness and chroma (oklch(0.76 0.10 230)). Settings still offers System / Light / Dark.Known pre-existing failure (not from this branch)
cd middleware && bun testis red on the branch base with zero middleware files in this diff (git diff --name-only <base> HEAD -- middlewareis empty).UC-MW-19failsExpected: 201 / Received: 500because the gitignoredmiddleware/data/plans/restart-nginx.gitleft on disk makesPOST /plans {id:'restart-nginx'}hit an already-initialized repo (nothing to commit). Removingmiddleware/data/→ 10 pass / 0 fail, but the run recreates it, so the next run is red again. Reproduces on the untouched base. Not weakened or skipped.Assumptions
/operator/*is instance-operator gated, so the page inherits that gate. A move to/settings/personalizationis one line if it should be per-user instead.localStorage, same asgotoi-theme), not per-account and not synced.<input type="range">the installed component set does not have.Refs #46
37da45892975347a275b