@@ -1,12 +1,24 @@
11 ---
22 id: 1025
3-title: Need a light/dark toggel
4-type: bug
5-status: doing
3+title: Need a light/dark toggle
4+type: feature
5+status: review
66 priority: p2
77 created: 2026-11-08T04:14:52Z
8-updated: 2026-11-08T04:14:56Z
8+updated: 2026-11-08T04:23:05Z
99 source: human
10-moves: 2026-11-08T04:14:56Z inbox doing drag
10+moves: 2026-11-08T04:14:56Z inbox doing drag; 2026-11-08T04:23:05Z doing review agent
11+area: site
1112 ---
1213
14+
15+## Notes
16+
17+- 2026-11-08 04:23Z (agent): Done. A theme button (half-filled circle) sits in the header on every page, left of the search box. Clicking it switches between light and dark from what is showing, and remembers the choice in localStorage across pages and visits. Until it is clicked, the site follows the system setting as before. Fixed the title typo 'toggel'.
18+
19+ - layout.html: a small inline script in <head> applies the saved theme before the first paint (no flash) and handles the click. It sets data-theme on <html>, which site.css already supported.
20+ - components.html (nav): the button. The search form lost its own sm:ml-auto; the button's ml-auto pushes both right.
21+
22+ CHECKED: go vet, go test pass. Rebuilt. agent-browser: with nothing saved, no data-theme and the light background (system light). Click: data-theme=dark, saved, background #15140f. Next page (/projects/) loads dark. Click again: light, saved. Screenshots: dark /projects at 1280px; light at 390px phone width (button on the first row, search on its own row).
23+
24+ NOT CHECKED: going back to 'follow the system' after a click (two states only; clearing site data resets it). No-JS: the button shows but does nothing.