From 2e91c0f81eb0cc8e9b847943870c264d48337776 Mon Sep 17 00:00:00 2001 From: Eleanor Berger Date: Tue, 19 May 2026 08:25:34 +0200 Subject: [PATCH] fix: honour skin value in theme command --- static/commands.js | 2 +- tests/test_geist_contrast_skin.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/static/commands.js b/static/commands.js index 74c66901..f7705546 100644 --- a/static/commands.js +++ b/static/commands.js @@ -664,7 +664,7 @@ async function cmdUsage(){ async function cmdTheme(args){ const themes=['system','dark','light']; - const skins=(_SKINS||[]).map(s=>s.name.toLowerCase()); + const skins=(_SKINS||[]).map(s=>(s.value||s.name).toLowerCase()); const legacyThemes=Object.keys(_LEGACY_THEME_MAP||{}); const val=(args||'').toLowerCase().trim(); // Check if it's a theme diff --git a/tests/test_geist_contrast_skin.py b/tests/test_geist_contrast_skin.py index d4a0e143..c0290545 100644 --- a/tests/test_geist_contrast_skin.py +++ b/tests/test_geist_contrast_skin.py @@ -7,6 +7,7 @@ CSS = (REPO / "static" / "style.css").read_text(encoding="utf-8") BOOT_JS = (REPO / "static" / "boot.js").read_text(encoding="utf-8") CONFIG_PY = (REPO / "api" / "config.py").read_text(encoding="utf-8") INDEX_HTML = (REPO / "static" / "index.html").read_text(encoding="utf-8") +COMMANDS_JS = (REPO / "static" / "commands.js").read_text(encoding="utf-8") def test_geist_contrast_skin_is_registered_with_matching_key_and_label(): @@ -17,6 +18,12 @@ def test_geist_contrast_skin_is_registered_with_matching_key_and_label(): assert '"geist-contrast"' in CONFIG_PY +def test_geist_contrast_slash_theme_uses_skin_value_key(): + assert "const skins=(_SKINS||[]).map(s=>(s.value||s.name).toLowerCase());" in COMMANDS_JS + assert "skins.includes(val)" in COMMANDS_JS + assert "showToast(t('theme_set')+appearance.skin)" in COMMANDS_JS + + def test_geist_contrast_dark_tokens_use_yellow_accent_with_neutral_surfaces(): assert ':root.dark[data-skin="geist-contrast"]' in CSS assert "--bg:#000000" in CSS