|
| 1 | +# Dark Mode Handoff (Current Status) |
| 2 | + |
| 3 | +## What We Completed |
| 4 | + |
| 5 | +### 1) Playground dark/light support |
| 6 | + |
| 7 | +- Added a `Playground Theme` toggle in Settings. |
| 8 | +- Added runtime CodeMirror theme switching (dark/light). |
| 9 | +- Added theme persistence for playground via `localStorage` key: |
| 10 | + - `playgroundTheme` |
| 11 | +- Updated JS output panel highlighting to follow playground theme. |
| 12 | + |
| 13 | +### 2) Playground onboarding toast |
| 14 | + |
| 15 | +- Added “New: Light Mode” toast in Playground. |
| 16 | +- Supports: |
| 17 | + - `Dismiss` |
| 18 | + - `Try it now` (switches to light mode + closes toast) |
| 19 | + - auto-close after 10s |
| 20 | +- Toast “seen” state moved to `sessionStorage` key: |
| 21 | + - `playgroundLightModeToastSeen` |
| 22 | + |
| 23 | +### 3) Playground visual fixes |
| 24 | + |
| 25 | +- Improved light-mode contrast for: |
| 26 | + - Auto-run toggle text |
| 27 | + - Middle panel divider appearance |
| 28 | +- Added Cypress flow to: |
| 29 | + - click toast `Try it now` |
| 30 | + - switch back to dark mode from Settings |
| 31 | + |
| 32 | +### 4) Site-wide dark mode foundation (first pass) |
| 33 | + |
| 34 | +- Added global site theme model: |
| 35 | + - `src/common/SiteTheme.res` |
| 36 | + - `src/common/SiteTheme.resi` |
| 37 | +- Added early root theme initialization script in `app/root.res`. |
| 38 | +- Added navbar theme toggle in `src/components/NavbarPrimary.res`. |
| 39 | +- Added dark-mode styling hooks for shared chrome in `styles/main.css`: |
| 40 | + - body |
| 41 | + - primary navbar |
| 42 | + - docs subnav |
| 43 | + - mobile overlay |
| 44 | + - footer |
| 45 | +- Added footer dark-logo swap and footer dark classes in `src/components/Footer.res`. |
| 46 | + |
| 47 | +## Files Changed (Dark Mode Work) |
| 48 | + |
| 49 | +- `app/root.res` |
| 50 | +- `src/common/SiteTheme.res` |
| 51 | +- `src/common/SiteTheme.resi` |
| 52 | +- `src/components/NavbarPrimary.res` |
| 53 | +- `src/components/Footer.res` |
| 54 | +- `src/components/ToggleButton.res` |
| 55 | +- `src/components/CodeMirror.res` |
| 56 | +- `src/components/CodeMirror.resi` |
| 57 | +- `src/Playground.res` |
| 58 | +- `src/components/LandingPage.res` |
| 59 | +- `styles/main.css` |
| 60 | +- `e2e/Playground.cy.res` |
| 61 | + |
| 62 | +## Current Known Issues |
| 63 | + |
| 64 | +### Homepage (dark mode) |
| 65 | + |
| 66 | +- Contrast is still too low in multiple sections. |
| 67 | +- Some typography is still too dim after first pass. |
| 68 | +- Landing surfaces are not fully harmonized (dark values are inconsistent section-to-section). |
| 69 | + |
| 70 | +### General |
| 71 | + |
| 72 | +- This is a foundational implementation, not a complete “theme polish” pass. |
| 73 | +- Full compile/test verification was not fully completed in this environment due hanging command output for `yarn build:res`. |
| 74 | + |
| 75 | +## Recommended Next Steps |
| 76 | + |
| 77 | +### Phase 1: Homepage contrast pass (high priority) |
| 78 | + |
| 79 | +1. Make primary marketing text brighter: |
| 80 | + - Hero title/subtitle |
| 81 | + - USP headings and paragraph text |
| 82 | + - Trusted-by and Curated Resources headings |
| 83 | +2. Normalize dark backgrounds section-by-section: |
| 84 | + - ensure no remaining light patches |
| 85 | + - keep visual hierarchy with 2–3 dark surface levels |
| 86 | +3. Tune card and border contrast: |
| 87 | + - cards in Curated Resources |
| 88 | + - hr/dividers and muted labels |
| 89 | + |
| 90 | +### Phase 2: Global component pass |
| 91 | + |
| 92 | +1. Audit and fix dark-mode contrast in shared UI: |
| 93 | + - navbar links/icons/search |
| 94 | + - mobile overlays |
| 95 | + - doc-sidebars |
| 96 | +2. Replace broad selector overrides with cleaner semantic dark classes where needed. |
| 97 | + |
| 98 | +### Phase 3: Accessibility + regression checks |
| 99 | + |
| 100 | +1. Check color contrast (target WCAG AA for body text and controls). |
| 101 | +2. Run: |
| 102 | + - `yarn build:res` |
| 103 | + - `yarn test` |
| 104 | + - `yarn cy:run` |
| 105 | +3. Add/adjust e2e checks for global theme toggle and homepage dark-mode snapshots (if desired). |
| 106 | + |
| 107 | +## Suggested Cleanup (after visual stabilization) |
| 108 | + |
| 109 | +- Consolidate theme constants for shared text/surface levels. |
| 110 | +- Avoid overly broad selectors in `styles/main.css` and scope to specific component wrappers. |
| 111 | +- Decide final UX for theme toggle location (navbar-only vs additional settings entry). |
0 commit comments