Repository navigation
fix(ui): restore dark mode text contrast - #1358
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The dark-mode override currently only remaps the base text-desert-green class, leaving hover/group-hover variants in the codebase able to drop back to low-contrast dark green (and the tests don’t yet guard against that regression).
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
This PR restores dark-mode (Night Ops) text contrast across settings pages by decoupling the shared desert-green token used for both foreground text and green backgrounds, and by updating Builder Tag control text to use semantic primary text color.
Changes:
- Add a dark-mode-only foreground accent token (
--color-desert-green-foreground) while keeping--color-desert-greenunchanged for button/background contrast. - Override dark-mode
text-desert-greento use the new foreground token. - Add a unit test to enforce WCAG contrast for key token pairs and confirm Builder Tag controls use semantic text.
| File | Description |
|---|---|
| admin/tests/unit/dark_mode_contrast.spec.ts | Adds WCAG contrast regression tests for dark-mode token pairings and Builder Tag control semantics. |
| admin/inertia/css/app.css | Introduces a foreground-only dark-mode green token and remaps text-desert-green in dark mode. |
| admin/inertia/components/BuilderTagSelector.tsx | Switches Builder Tag select/number text from text-desert-green to text-text-primary for contrast in dark mode. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot review |
chriscrosstalk
left a comment
There was a problem hiding this comment.
This is exactly the right decomposition. Lightening the shared token was the obvious trap since it would have cost the white-on-green buttons their contrast, and splitting out a foreground-only accent avoids that cleanly. I checked utility coverage against dev and the base, hover, hover/80, and group-hover variants are all of them, so nothing falls back to the dark green. The regression test guarding both directions (foreground readable, button background unchanged) is a nice touch.
Also verified live: applied this to a v1.35.0-rc.1 box and re-ran the axe scan from #1350. Dark mode went from 29 violations to 4 on /settings/benchmark, 19 to 3 on /settings/system, and 2 to 1 on /home, with no light theme regressions. Everything remaining is pre-existing and out of scope here (a literal text-gray-500 button, the tan buttons, a gauge overlay, plus missing select labels and html lang). Thanks for the quick turnaround on the review feedback too.
|
🎉 This PR is included in version 1.35.0-rc.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |


User impact
Night Ops headings, gauge labels, large statistics, and Builder Tag values now remain readable instead of rendering dark text on dark surfaces.
Fixes #1350.
Root cause
The same
--color-desert-greentoken serves both foreground text and green backgrounds. Lightening that shared token would repair headings but reduce contrast for white text on green buttons. Builder Tag controls also pairedtext-desert-greenwith an inverted mid-dark background.Fix
text-desert-greenwithout changing green backgrounds.Validation
node --import ts-node-maintained/register/esm --test tests/unit/dark_mode_contrast.spec.tsnpm run typechecknpx eslint tests/unit/dark_mode_contrast.spec.tsnpx prettier --check inertia/components/BuilderTagSelector.tsx tests/unit/dark_mode_contrast.spec.tsnpm run buildgit diff --checkNot run
The full NOMAD application and an axe scan across live settings routes were not run locally; CI and maintainer review remain pending.