Repository navigation
feat: 0.25x replay speed + light theme with AA-tuned palette - #22
Merged
Merged
Conversation
Task 1 — replay speed: - Add 0.25x option to the speed select in Workbench. No timing-logic changes; the existing Math.max(40, 150/speed) already produces a valid 600ms interval. Task 2 — light theme: - Restructure styles.css so :root holds the light palette and .dark holds the dark palette (previously :root was the dark palette). Dark remains the default: the html element gets the .dark class unless the user opts into light. - Design a light palette from scratch, verified with an oklch->sRGB WCAG contrast script: every token meets AA on its paired light surface (4.5:1 text, 3:1 UI). The JS-yellow accent is darkened to a goldenrod that holds contrast on light backgrounds; TS-blue stays at #3178C6. - Add a ThemeProvider + useTheme hook that toggles the .dark class on html, persists to localStorage, and injects an inline pre-paint script in the shell head (no FOUC, no hydration mismatch). - Add a sun/moon toggle button in the AppShell header. - Theme-aware syntax highlighting: CodeMirror swaps oneDark for a light editor theme + light highlight style; Shiki swaps one-dark-pro for github-light. Event-loop lanes, charts, and DevTools panels all inherit the semantic tokens. Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
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.
Task 1 — 0.25× replay speed
Added
<option value={0.25}>0.25×</option>below the existing 0.5× option inWorkbench.tsx. No timing-logic changes —Math.max(40, 150 / speed)already produces a valid 600 ms interval at 0.25×.Task 2 — Light mode
A genuine light theme, opt-in alongside the existing dark mode (dark stays the default identity).
Palette (
src/styles.css):rootholds the light palette and.darkholds the dark palette (previously:rootitself was the dark palette). The.darkclass on<html>remains how theming is wired (@custom-variant dark).oklch(0.6 0.16 85)≈#ab7500) so it holds contrast on light surfaces — the pure yellow only passes on dark. TypeScript blue stays at#3178C6(≈4.5:1 on white). Lane colors (stack/microtask/macrotask/api/warning/success), chart and sidebar tokens all re-tuned for light surfaces.Toggle & persistence
ThemeProvider+useTheme(src/components/theme-provider.tsx): toggles the.darkclass on<html>, persists tolocalStorage, defaults to dark.<head>applies the stored theme before first paint (no FOUC, no hydration mismatch — React no longer owns the html class).AppShellheader.Downstream theming verified
CodeEditor.tsx): swapsoneDarkfor a palette-matched light editor theme + lightHighlightStylevia a Compartment (editor state preserved across toggles).CodeBlock.tsx): swapsone-dark-proforgithub-light.Verification
bun run typecheck— cleanbun run lint— 0 errorsbun test— 31 pass, 0 failbun run build— succeeds<html>has no hardcoded class, init script sits at the top of<head>, and the built CSS contains bothcolor-scheme:lightandcolor-scheme:darkpalettes.