Skip to content

feat: 0.25x replay speed + light theme with AA-tuned palette - #22

Merged
monkeycode-global[bot] merged 1 commit into
mainfrom
feat/light-mode-replay-speed
Aug 8, 2026
Merged

monkeycode-global[bot] merged 1 commit into
mainfrom
feat/light-mode-replay-speed

Conversation

@monkeycode-global

Copy link
Copy Markdown
Contributor

Task 1 — 0.25× replay speed

Added <option value={0.25}>0.25×</option> below the existing 0.5× option in Workbench.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)

  • Restructured so :root holds the light palette and .dark holds the dark palette (previously :root itself was the dark palette). The .dark class on <html> remains how theming is wired (@custom-variant dark).
  • Designed from scratch, verified with an oklch→sRGB WCAG contrast script. Every token meets AA against its paired light surface: 4.5:1 for text, 3:1 for borders/grid/ring/UI. All 54 pairings checked pass.
  • JS-yellow accent (#F7DF1E) is darkened to a goldenrod (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

  • New ThemeProvider + useTheme (src/components/theme-provider.tsx): toggles the .dark class on <html>, persists to localStorage, defaults to dark.
  • An inline pre-paint script in the shell <head> applies the stored theme before first paint (no FOUC, no hydration mismatch — React no longer owns the html class).
  • Sun/moon toggle button in the AppShell header.

Downstream theming verified

  • CodeMirror (CodeEditor.tsx): swaps oneDark for a palette-matched light editor theme + light HighlightStyle via a Compartment (editor state preserved across toggles).
  • Shiki (CodeBlock.tsx): swaps one-dark-pro for github-light.
  • Event-loop lanes, DevTools panels, and the (unused but defined) chart tokens all inherit the semantic tokens.

Verification

  • bun run typecheck — clean
  • bun run lint — 0 errors
  • bun test — 31 pass, 0 fail
  • bun run build — succeeds
  • Confirmed SSR output: <html> has no hardcoded class, init script sits at the top of <head>, and the built CSS contains both color-scheme:light and color-scheme:dark palettes.

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>
@monkeycode-global
monkeycode-global Bot merged commit 086395a into main Aug 8, 2026
1 check passed
@monkeycode-global
monkeycode-global Bot deleted the feat/light-mode-replay-speed branch August 8, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant