fix: honour skin value in theme command

This commit is contained in:
Eleanor Berger
2026-05-19 08:25:34 +02:00
committed by nesquena-hermes
parent 4598adfd04
commit 2e91c0f81e
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -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