Theme toggle: visible first click, sync across tabs, e2e coverage; prepare v0.1.6 #8

Merged
backmeupplz merged 2 commits from theme-toggle-nits into main 2026-10-08 20:05:00 +00:00
backmeupplz commented 2026-10-08 20:00:19 +00:00 (Migrated from github.com)

Follow-up to #1.

  • First click always changes the page. From system the toggle goes to the opposite of the OS theme, then to the OS's own theme, then back to system. Before, with the OS set to light, system → light looked like nothing happened.
  • Tabs stay in sync. Other open tabs pick up the change through the storage event.
  • Simpler reset. Going back to system stores '', which theme.js already reads as follow-the-OS, so the separate localStorage.removeItem branch and the ?? '' are gone.
  • e2e. The layout fixture now serves theme.js (it used to 404 there), and a new test covers the cycle and live OS changes.

npm test 13/13, npx playwright test 10/10.

🤖 Generated with Claude Code

Follow-up to #1. - **First click always changes the page.** From system the toggle goes to the opposite of the OS theme, then to the OS's own theme, then back to system. Before, with the OS set to light, system → light looked like nothing happened. - **Tabs stay in sync.** Other open tabs pick up the change through the `storage` event. - **Simpler reset.** Going back to system stores `''`, which `theme.js` already reads as follow-the-OS, so the separate `localStorage.removeItem` branch and the `?? ''` are gone. - **e2e.** The layout fixture now serves `theme.js` (it used to 404 there), and a new test covers the cycle and live OS changes. `npm test` 13/13, `npx playwright test` 10/10. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.