Skip to content

feat: dashboard theme system with live switching#10687

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3cf53cd9
Apr 16, 2026
Merged

feat: dashboard theme system with live switching#10687
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3cf53cd9

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

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

  1. ThemeSwitcher dropdown in the header (next to language switcher) — click a theme, it applies instantly
  2. CSS variable overrides injected on document.documentElement — no page reload needed
  3. Selection saved to config.yaml via PUT /api/dashboard/theme — survives server restarts
  4. On page load, GET /api/dashboard/themes returns the saved theme + available list

Built-in themes

Theme Description
Hermes Teal Classic dark teal (current look, default)
Midnight Deep blue-violet with cool accents
Ember Warm crimson and bronze
Mono Clean grayscale, minimal
Cyberpunk Neon green on black
Rosé Soft pink and warm ivory

Custom themes

Users can create ~/.hermes/dashboard-themes/<name>.yaml files. 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.tsDashboardTheme, ThemeColors, ThemeOverlay types
  • presets.ts — 6 built-in theme objects (21 color tokens + overlay each)
  • context.tsxThemeProvider + useTheme() hook
  • ThemeSwitcher.tsx — dropdown component

Backend (hermes_cli/web_server.py):

  • GET /api/dashboard/themes — theme list + active (public, no auth)
  • PUT /api/dashboard/theme — persist selection

Config (hermes_cli/config.py):

  • dashboard.theme in DEFAULT_CONFIG, merged into display tab in config UI

i18n

Theme switcher strings added for English + Chinese.

Test plan

  • npx tsc -b — clean
  • npm run build — clean (394KB JS, 47KB CSS)
  • pytest tests/hermes_cli/test_web_server.py — 76/76 passed
  • pytest tests/hermes_cli/test_config.py — 49/49 passed

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.
@teknium1 teknium1 merged commit 3f6c434 into main Apr 16, 2026
6 of 7 checks passed
@teknium1 teknium1 deleted the hermes/hermes-3cf53cd9 branch April 16, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant