Repository navigation
feat: add a Light theme with a System/Light/Dark theme preference - #17
Merged
Merged
Conversation
The app had a single dark look and ignored the OS colour scheme, so users on a light setting or in bright rooms had no way to switch. Colours were also hard-coded in several places outside the CSS tokens (Prism token colours, the React Flow dot grid and minimap, gradients, shadows), which meant a second theme could not be added by swapping variables alone. Every colour now lives in a token, with the Dark theme unchanged (it was checked pixel-for-pixel against the previous build) and a new Light theme overriding the tokens. A topbar button cycles the Theme preference through System, Light and Dark. System is the default, follows the OS live, and falls back to Dark when the OS expresses no preference. The preference is remembered, with storage access guarded, and an inline script in index.html applies the theme before first paint so a reload never flashes the wrong one. The resolved theme is also passed to React Flow as its colorMode. Wires keep a soft glow in the Light theme; the wires of a hovered or selected card get the full glow and dashed flow in both themes. Two Light values differ from the token table in the issue. The accent is #07748a rather than #0a7f95 because the original was 4.48:1 on the panel, under the AA text contrast the acceptance criteria ask for. The card header's --lock stays #f0b849 in both themes since its only use is the async badge on the header, which is dark in both themes. CONTEXT.md gains an Appearance section (Theme, Theme preference, System theme), and CLAUDE.md records that the theme is applied in two places. Closes #16
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.
Summary
Adds a Light theme and a Theme preference (System, Light or Dark), and keeps today's look as the Dark theme. A button at the right end of the canvas topbar cycles System → Light → Dark.
The app had a single dark look and ignored the OS colour scheme. Many colours were also hard-coded outside the CSS tokens (Prism token colours, the React Flow dot grid and minimap, several gradients and shadows), so a second theme couldn't be added by swapping variables alone. Every colour now lives in a token, and the Light theme overrides them.
Closes #16
Behaviour
index.htmlapplies the theme before first paint, so a reload never flashes the wrong theme.frontend/src/theme.tsowns it afterwards; both share the storage key and resolution rules (recorded inCLAUDE.md).colorMode. Its pane, dot grid and minimap colours come from our tokens.Two Light values differ from the token table in #16
--accentis#07748a, not#0a7f95. The original was 4.48:1 on the panel, just under the AA text contrast the acceptance criteria ask for. Text-token contrast on the Light surfaces is now 4.86:1 or better for the accent, and 6.55:1 or better for body and secondary text.--lockstays#f0b849in both themes. Its only use is the async badge on the card header, which is dark in both themes, so the table's dark amber would have been hard to read there.Beyond the issue's to-do list
CLAUDE.mdbullet noting that the theme is applied in two places, and a README line fortheme.ts/ThemeToggle.tsx.CONTEXT.mdgains an Appearance section: Theme, Theme preference, System theme.Verification
There is no test suite, so this was checked by hand and with a throwaway browser script (not part of this PR) driving headless Edge against both apps.
npm run buildandnpm run lintpass.localStorageblocked, with no page errors.Things to know
#d29922) and sky (#58a6ff), about 2.3:1. They read fine in the screenshots and I leftcolors.tsalone as agreed, but they are the first to adjust if any look faint.fitViewrace, which the comparison now sidesteps by clicking "Fit view" first.