From 50d7d1cf88287564cfe08474a2eeb4c4f2db471e Mon Sep 17 00:00:00 2001 From: armorbreak001 Date: Wed, 15 Apr 2026 16:49:28 +0800 Subject: [PATCH 1/2] fix(themes): swap Prism syntax-highlighting theme on light/dark switch The Prism CSS was hardcoded to prism-tomorrow (dark-only), so code blocks stayed dark even when switching to Light or other non-dark themes. - Add id='prism-theme' to the element for runtime lookup - In _applyTheme(), swap href between prism-tomorrow (dark) and prism (light) based on resolved theme - Skips DOM write when the target href is already active Fixes #505 --- static/boot.js | 10 ++++++++++ static/index.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/static/boot.js b/static/boot.js index 75f322b..ac6c4a8 100644 --- a/static/boot.js +++ b/static/boot.js @@ -584,6 +584,16 @@ function _applyTheme(name){ ?(window.matchMedia('(prefers-color-scheme:dark)').matches?'dark':'light') :name; document.documentElement.dataset.theme=resolved||'dark'; + // Swap Prism syntax-highlighting theme to match UI theme + (function(){ + const link=document.getElementById('prism-theme'); + if(!link) return; + const isDark=(resolved!=='light'); + const want=isDark + ?'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism-tomorrow.min.css' + :'https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism.min.css'; + if(link.href!==want){ link.href=want; } + })(); // Re-register OS change listener whenever system theme is active if(name==='system'){ const mq=window.matchMedia('(prefers-color-scheme:dark)'); diff --git a/static/index.html b/static/index.html index 5c20188..bb5de73 100644 --- a/static/index.html +++ b/static/index.html @@ -9,7 +9,7 @@ - + From 03df7132d0b2296a96ddaa516654b19bbf9e924b Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 15 Apr 2026 16:59:12 +0000 Subject: [PATCH 2/2] chore: bump version to v0.50.50, update CHANGELOG --- CHANGELOG.md | 5 +++++ static/index.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63b157d..f33c9a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Hermes Web UI -- Changelog +## [v0.50.50] — 2026-04-15 + +### Fixed +- **Code block syntax highlighting** — Prism theme now follows the active UI theme. Light mode uses the default Prism light theme; dark mode uses `prism-tomorrow`. Theme swaps happen immediately on toggle including on first load. Adds `id="prism-theme"` to the Prism CSS link so JavaScript can locate and swap it. (Closes #505, PR #530 by @mariosam95) + ## [v0.50.49] — 2026-04-15 ### Fixed diff --git a/static/index.html b/static/index.html index bb5de73..ef38643 100644 --- a/static/index.html +++ b/static/index.html @@ -552,7 +552,7 @@
System
- v0.50.49 + v0.50.50