Fix settings dark mode toggle and center it (#197) #199

Merged
fen merged 1 commits from fix-197 into dev 2026-09-10 17:16:38 +00:00
Collaborator

Fixes #197.

  • Bug: topbar.js bound click handlers to ALL .dark-toggle buttons (including the settings one, which exists at defer-time), and settings.js additionally delegated a click to the topbar button — two flips per click = no visible change.
  • Fix: topbar.js marks each toggle as wired (data-dark-wired); settings.js only installs its fallback handler when that marker is absent.
  • CSS: #settings-dark-toggle now centers horizontally under the Settings title (auto margins), aligned with .settings-body padding.
  • Verified: go build + go test pass; headless chromium click test flips html.dark and aria-pressed both ways at 1400x900 and 375x812; button center matches .settings-body/.settings-head h1 center; no CSP or console errors.
Fixes #197. - Bug: topbar.js bound click handlers to ALL .dark-toggle buttons (including the settings one, which exists at defer-time), and settings.js additionally delegated a click to the topbar button — two flips per click = no visible change. - Fix: topbar.js marks each toggle as wired (data-dark-wired); settings.js only installs its fallback handler when that marker is absent. - CSS: #settings-dark-toggle now centers horizontally under the Settings title (auto margins), aligned with .settings-body padding. - Verified: go build + go test pass; headless chromium click test flips html.dark and aria-pressed both ways at 1400x900 and 375x812; button center matches .settings-body/.settings-head h1 center; no CSP or console errors.
fen added 1 commit 2026-09-10 17:10:01 +00:00
Fix settings dark mode toggle double-binding and center it (#197)
CI / docker (pull_request) Skipped
CI / test (pull_request) Successful in 50s
8042116a69
topbar.js binds click handlers to every .dark-toggle, including the
settings one; settings.js then also wired a delegation that re-clicked
the topbar button, so each click flipped dark mode twice (net no-op).
Mark buttons as wired in topbar.js and only add a fallback handler in
settings.js when topbar.js did not run.

CSS: center the toggle horizontally under the Settings title with auto
margins, matching .settings-body padding.

Closes #197
fen merged commit 23cf3151c4 into dev 2026-09-10 17:16:38 +00:00
Sign in to join this conversation.