feat(ui): gate dark mode at build time instead of chasing regressions - #107
Merged
Conversation
Dark mode kept regressing because nothing checked it — the root cause was a missing feedback loop, not a handful of missed spots. - adds `scripts/check-dark-mode.mjs`, a build-time checker that flags hard-coded light-only colors, plus a committed baseline so existing debt is capped and can only shrink - wires the check into `npm run build`, next to the existing i18n check - clears the violations the checker surfaced across the catalog, chat, settings, onboarding, ontology, loop, canvas and apidoc styles, moving them onto theme tokens - the Word-style paper surface becomes an explicit light island rather than an untokenized leak, and the checker itself is carried into the CE overlay so the community build runs the same gate The baseline is currently looser than the tree; `npm run check:dark -- --update` tightens it once the remaining debt is paid down.
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.
Why
Dark mode kept regressing after every UI change. The root cause was a missing
feedback loop rather than a handful of missed spots: nothing failed when a
hard-coded light-only color was introduced, so regressions were only found by
looking at the app.
What
src/frontend/scripts/check-dark-mode.mjs, a build-time checker thatflags hard-coded light-only colors in styles and components.
src/frontend/scripts/dark-mode-baseline.json, a committed baseline sothe existing debt is capped and can only shrink. New violations fail the build;
the current backlog does not.
npm run build, next to the existing i18n check, andexposes it as
npm run check:dark.across the catalog, chat, settings, onboarding, ontology, loop, canvas and
apidoc styles.
untokenized leak.
Notes
The baseline is currently looser than the tree (the build reports the tree is
102 violations below it).
npm run check:dark -- --updatetightens it once moreof the remaining debt is paid down.
Verification
npm run buildpasses end to end: i18n check, dark-mode check,tsc -b, andthe vite production build.