HERMES-GIELIE/static
nesquena-hermes e9aac079e1 feat(theme): expose active --bg via <meta name="theme-color"> for native chrome bridges
The Mac Swift app (hermes-webui/hermes-swift-mac) and any other native
WKWebView wrapper need the active theme background to keep AppKit
chrome (tab bar, title bar, traffic-light area) in sync with the page.

The current Mac approach pixel-samples the page via
elementsFromPoint, which is fragile against modals/lightboxes/file-tree
overlays — any opaque overlay over a sample point can poison the
chrome colour for the entire app. (See swift-mac issue #70.)

Surface the active theme's background as the canonical, overlay-resistant
source of truth via <meta name="theme-color">:

- Two static prefers-color-scheme variants in <head> for browsers that
  read theme-color before any JS runs (mobile Safari, PWAs).
- One id="hermes-theme-color" runtime tag with an inline pre-paint
  seed script that reads localStorage hermes-theme so the meta tag
  is correct on first paint, before boot.js loads.
- New _syncThemeColorMeta() helper in static/boot.js that reads
  getComputedStyle(html).getPropertyValue('--bg') and writes it into
  the runtime meta tag. Called from _setResolvedTheme (both branches —
  prism-loaded and prism-absent) and from _applySkin so every theme
  toggle and skin switch updates the meta tag.

Reading --bg via getComputedStyle means each skin (Default, Sienna,
Sisyphus, Charizard, etc.) reaches the meta tag with its distinct
background — no per-skin lookup table to drift.

Browser-verified end to end on port 8789:
  - light + default      → meta=#FEFCF7 (matches --bg)
  - light + Sienna       → meta=#FAF9F5 (skin's distinct bg)
  - dark + Sienna        → meta=#1F1E1C (skin's dark variant)

10 regression tests added in tests/test_theme_color_meta_bridge.py
covering: static media variants present, runtime id stable, pre-paint
seed reads localStorage, helper defined and reads computed --bg,
helper targets known id, both _setResolvedTheme branches call sync,
_applySkin calls sync, root --bg defaults still match.

Companion PR coming on hermes-webui/hermes-swift-mac to switch the
theme bridge from elementsFromPoint pixel-sampling to reading
document.querySelector('meta[name="theme-color"][id="hermes-theme-color"]').content.

Refs hermes-webui/hermes-swift-mac#70.
2026-05-06 17:24:23 +00:00
..
vendor chore: vendor streaming-markdown@0.2.15, remove CDN dependency 2026-04-24 01:05:20 +00:00
apple-touch-icon.png feature: add manifest and icons to enable app install on android 2026-05-02 19:06:39 +02:00
boot.js feat(theme): expose active --bg via <meta name="theme-color"> for native chrome bridges 2026-05-06 17:24:23 +00:00
commands.js feat: add WebUI status command card 2026-05-05 01:12:07 +00:00
favicon-32.png fix: add favicon (SVG + PNG + ICO), fix static MIME types (#613) 2026-04-16 20:11:02 -07:00
favicon-192.png feature: add manifest and icons to enable app install on android 2026-05-02 19:06:39 +02:00
favicon-512.png feature: add manifest and icons to enable app install on android 2026-05-02 19:06:39 +02:00
favicon-512.svg feature: add manifest and icons to enable app install on android 2026-05-02 19:06:39 +02:00
favicon.ico fix: add favicon (SVG + PNG + ICO), fix static MIME types (#613) 2026-04-16 20:11:02 -07:00
favicon.svg fix: add favicon (SVG + PNG + ICO), fix static MIME types (#613) 2026-04-16 20:11:02 -07:00
i18n.js fix(i18n): remove orphaned profiles_busy_switch keys (Opus stage-304 follow-up) 2026-05-06 16:25:54 +00:00
icons.js fix(composer): distinct voice-mode icon, descriptive labels, opt-in pref (#1488) 2026-05-02 22:16:23 +00:00
index.html feat(theme): expose active --bg via <meta name="theme-color"> for native chrome bridges 2026-05-06 17:24:23 +00:00
login.js fix(login): retry connectivity probe every 3s, auto-reload when server recovers 2026-05-01 19:54:47 +00:00
manifest.json feature: add manifest and icons to enable app install on android 2026-05-02 19:06:39 +02:00
messages.js fix: persist activity disclosure state 2026-05-06 06:30:32 +00:00
onboarding.js docs: clarify Anthropic auth choices in onboarding 2026-05-06 06:26:43 +00:00
panels.js fix: allow profile switching during active streams 2026-05-06 16:11:46 +00:00
sessions.js fix(scroll): reset _lastScrollTop on session switch (Opus stage-302 follow-up) 2026-05-06 08:21:42 +00:00
style.css fix: simplify compact activity summaries 2026-05-06 06:27:13 +00:00
sw.js fix: keep login assets out of service worker cache 2026-05-03 18:18:27 -07:00
terminal.js fix: anchor active sessions per browser tab 2026-05-01 19:52:05 +08:00
ui.js fix: wait for model catalog before opening picker 2026-05-06 09:34:23 -07:00
workspace.js fix: keep frontend routes under subpath mounts 2026-05-04 00:06:58 -07:00