Repository navigation
[Dashboard] Let the user choose a dashboard theme per browser - #297
Merged
Merged
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Pull Request
📖 Description
Adds the mechanism and the control for choosing the dashboard theme. The choice is stored per browser under
pimonitor-style, applied asdata-styleon<html>before the first paint, independent of the light/dark mode, and defaults to Clear (no attribute). One theme registry intheme-init.jsfeeds the selector and the stored-value validation; canvas widgets read their colours and fill opacity throughthemeColor/themeNumberwith Clear fallbacks, which also fixes a valid fill opacity of0being 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 adaptedicons_test.goandopenhab_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
.squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file..squad/stack.mdpasses (new or changed production code with the branch conditions its report records, line coverage overall).README.md,ARCHITECTURE.md) and the area document of every changed behavior to reflect my changes..squad/stack.mdprescribes.breaking-changeand says so in the Description.(or what only real hardware can verify).
⏭ Next Steps
None.