feat: add user-defined custom themes#1589
feat: add user-defined custom themes#1589Michaelyklam wants to merge 4 commits intonesquena:masterfrom
Conversation
|
Thanks @Michaelyklam — this is a substantial feature and the design choice to build it on top of the existing CSS-variable layer (rather than introducing a new design-system framework) is the right call for Hermes WebUI. Treating the variable layer as the design-token contract and keeping persistence inside Pulled and ran the full target suite: Wider sweep across Things I like
Things worth confirming
Smaller things
Verdict Strong feature work and the security model (curated token set + strict color regex + numeric range check + 20-cap + id regex) is well thought through. The main thing blocking stage review is UI media — once you attach screenshots of the new picker and editor, this should be a strong candidate for the next stage queue. Sienna allowlist fix is a nice bonus. |
|
Added the requested UI media in follow-up commit
Raw image links are committed under |
|
Thanks for the substantial work on this @Michaelyklam — first-class user-defined themes is a real feature win and the design instinct (CSS variable layer as the contract, server-side validation, localStorage cache for first paint) is right. This PR is large enough (+627/-7, 12 files, new feature surface) and changes a top-bar UI surface visible at all viewport widths, so it needs a UX gate before I can route it into a batch. What's needed before merge1. Mobile (390px) screenshots in the PR bodyThe desktop screenshots are great. We also need 390px iPhone-reference views of:
The custom theme grid card layout, color picker rows, and the editor panel all need to work at 390px without horizontal overflow or truncated controls. 2. Run the full pytest suiteYou noted in "Risks / Follow-ups":
Before merge we want a clean full-suite run. There are 4094 tests in current master, and this PR touches /path/to/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -q…and post the result count in a comment. If anything fails, we'd want to address before stage. 3. UX maintainer reviewOnce mobile screenshots land, our UX reviewer will look at the visual results and confirm responsive behavior at the breakpoints. cc @aronprins — flagging this for your queue once @Michaelyklam posts the mobile screenshots. Things that look right on a structural read
What I want to look at more closely once UX gate clears
Adding Thanks again — this is a meaningful upgrade to the customization surface. |
2b691c0 to
60a489c
Compare
|
Thanks — I’ve finished the requested follow-up items and updated the PR body. What changed since the last review comment:
Verification after rebasing onto latest Full-suite command: env -u HERMES_CONFIG_PATH /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -qThe existing raw image links under |
Persist custom theme token bundles through settings, apply them before first paint, and add Appearance UI for creating, editing, deleting, and previewing custom themes.
60a489c to
2e9f392
Compare
|
Rebased New head SHA: Verification:
Readback after push: GitHub reports |
|
Cool idea, thanks for putting this together! @aronprins Has the concern that this might lead to people creating suboptimal themes, and that curated themes system may be better for our purposes. I'm still thinking on if this is worth including... but wanted to post an update. |
|
Imo, since these themes are local, it shouldn't matter if they are suboptimal. they can always swap back to the ones included by default. |
|
Themes section should be renamed to 'Mode'. |
Thinking Path
static/style.css, but Appearance only exposes built-in theme/skin choices.What Changed
theme: "custom",custom_theme_id, and a boundedcustom_themeslist./themecommand validation to acceptcustomas a canonical theme value./api/settingsvalidation.DESIGN.md.tests/test_custom_themes.pyfor settings persistence, unsafe token rejection, first-paint/runtime hooks, UI hooks, edit/delete affordances, and polished color picker controls.Why It Matters
This turns theme customization from hardcoded one-off palettes into a user-facing design-system feature. People can tune backgrounds, surfaces, text, accents, borders, inputs, hover states, and semantic colors from the UI, keep those themes server-side, and get the same look after reloads without manually editing CSS.
Verification
Results after rebasing onto latest
origin/master:Manual verification:
127.0.0.1:18790.docs/pr-media/1589/.UI media:
Desktop: Add theme card in the picker:
Desktop: Editor expanded with live preview and styled color token controls:
Desktop: Lower editor controls with create/cancel actions:
Desktop: Saved custom theme card with edit/delete affordances:
Desktop: Custom theme applied to the chat view:
Mobile 390px: Appearance picker with Add theme card:
Mobile 390px: Expanded Add theme editor with live preview and color rows:
Mobile 390px: Saved custom theme card with edit/delete affordances:
Mobile 390px: Custom theme applied to chat view:
Desktop: Renamed Appearance sections with built-in modes separated from Themes:
Desktop: Add theme editor expanded below the renamed Themes section:
Desktop: Saved custom theme card under Themes with edit/delete affordances:
Risks / Follow-ups
/api/settingsfor persistence because Appearance settings already live there. If multi-user theme sharing becomes a goal, a separate theme endpoint/model may be cleaner.Model Used
AI assisted.
gpt-5.5