Skip to content

[Dashboard] Let the user choose a dashboard theme per browser - #297

Merged
LarsLaskowski merged 22 commits into
mainfrom
claude/busy-archimedes-cnsq6t
Nov 28, 2026
Merged

LarsLaskowski merged 22 commits into
mainfrom
claude/busy-archimedes-cnsq6t

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

Adds the mechanism and the control for choosing the dashboard theme. The choice is stored per browser under pimonitor-style, applied as data-style on <html> before the first paint, independent of the light/dark mode, and defaults to Clear (no attribute). One theme registry in theme-init.js feeds the selector and the stored-value validation; canvas widgets read their colours and fill opacity through themeColor/themeNumber with Clear fallbacks, which also fixes a valid fill opacity of 0 being replaced and a missing gauge colour fallback. The selector is a "Theme" radio group in the Customize dialog, hidden while only one theme is registered, so Console and Berry plug into it later. The mode button is renamed "Switch to dark/light mode" so it no longer clashes with the new "Theme" group. This is a feature (enhancement); no API or configuration change.

🎫 Issues

Closes #218

Decision records: docs/decisions/0038-dashboard-mode-and-theme-as-token-overrides.md (extended), docs/decisions/0041-theme-choice-per-browser-as-pimonitor-style.md, docs/decisions/0042-theme-registry-in-theme-init-js.md

💬 Reviewer Notes

Touched: internal/web/assets (theme-init.js, app.js, chart.js, gauge.js, index.html, style.css) and the dashboard, architecture and decision documents. No routes, config keys, collectors or packaging files. With the shipped single-theme registry the selector is not visible; the behaviour was checked in headless Chrome against a build with a second probe theme (M1-M11 in the working record). Smoke test: build, open the dashboard, confirm the Customize dialog shows no Theme group and the mode button still toggles.

📑 Test Plan

Go tests over the embedded assets in internal/web/theme_test.go (registry single source, token key sets of every block of every theme, storage keys, selector markup, static loading, drawing fallbacks), plus adapted icons_test.go and openhab_test.go. Script behaviour (first-paint application, redraw, live OS mode, blocked storage, keyboard use) was verified by hand in headless Chrome with a probe theme. The verification matrix of all 17 acceptance criteria is in the squad working record comment on #218.

✅ Checklist

  • I have added or updated Unit Tests for the change.
  • I have tested my changes.
  • I have run Format and Build from .squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file.
  • The Coverage gate in .squad/stack.md passes (new or changed production code with the branch conditions its report records, line coverage overall).
  • I have updated the project documentation (README.md, ARCHITECTURE.md) and the area document of every changed behavior to reflect my changes.
  • Each decision with lasting weight has its decision record, committed with the change.
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.
  • New dependencies, if any, were added the way Dependencies in .squad/stack.md prescribes.
  • The PR carries its release-notes label (CONTRIBUTING); a change that breaks existing users carries breaking-change and says so in the Description.
  • Reviewer Notes name the touched routes, config keys, collectors or packaging files, and a smoke test on a Pi
    (or what only real hardware can verify).

⏭ Next Steps

None.

@LarsLaskowski LarsLaskowski added the enhancement New feature or request label Nov 28, 2026 — with Claude
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski marked this pull request as ready for review November 28, 2026 13:40
@LarsLaskowski
LarsLaskowski merged commit b4a3c35 into main Nov 28, 2026
14 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/busy-archimedes-cnsq6t branch November 28, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard] Let the user choose a dashboard theme, stored per browser

2 participants