feat: dashboard theme system with live switching#10687
Merged
Merged
Conversation
Add a theme engine for the web dashboard that mirrors the CLI skin engine philosophy — pure data, no code changes needed for new themes. Frontend: - ThemeProvider context that loads active theme from backend on mount and applies CSS variable overrides to document.documentElement - ThemeSwitcher dropdown component in the header (next to language switcher) with instant preview on click - 6 built-in themes: Hermes Teal (default), Midnight, Ember, Mono, Cyberpunk, Rosé — each defines all 21 color tokens + overlay settings - Theme types, presets, and context in web/src/themes/ Backend: - GET /api/dashboard/themes — returns available themes + active name - PUT /api/dashboard/theme — persists selection to config.yaml - User custom themes discoverable from ~/.hermes/dashboard-themes/*.yaml - Theme list endpoint added to public API paths (no auth needed) Config: - dashboard.theme key in DEFAULT_CONFIG (default: 'default') - Schema override for select dropdown in config page - Category merged into 'display' tab in config UI i18n: theme switcher strings added for en + zh.
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.
Summary
Adds a theme engine for the web dashboard — 6 built-in themes with live switching via a header dropdown. Theme selection persists to
config.yaml(dashboard.theme).How it works
document.documentElement— no page reload neededconfig.yamlviaPUT /api/dashboard/theme— survives server restartsGET /api/dashboard/themesreturns the saved theme + available listBuilt-in themes
Custom themes
Users can create
~/.hermes/dashboard-themes/<name>.yamlfiles. The backend discovers them and includes them in the theme list alongside built-ins.Architecture
Mirrors the CLI skin engine philosophy — themes are pure data (CSS variable overrides + overlay settings), no code changes needed to add new ones.
Frontend (
web/src/themes/):types.ts—DashboardTheme,ThemeColors,ThemeOverlaytypespresets.ts— 6 built-in theme objects (21 color tokens + overlay each)context.tsx—ThemeProvider+useTheme()hookThemeSwitcher.tsx— dropdown componentBackend (
hermes_cli/web_server.py):GET /api/dashboard/themes— theme list + active (public, no auth)PUT /api/dashboard/theme— persist selectionConfig (
hermes_cli/config.py):dashboard.themeinDEFAULT_CONFIG, merged into display tab in config UIi18n
Theme switcher strings added for English + Chinese.
Test plan
npx tsc -b— cleannpm run build— clean (394KB JS, 47KB CSS)pytest tests/hermes_cli/test_web_server.py— 76/76 passedpytest tests/hermes_cli/test_config.py— 49/49 passed