fix: settings unsaved-changes guard, add Slate theme, improve Light theme

Unsaved-changes guard:
- _closeSettingsPanel() intercepts all three close paths (X button, overlay
  click, Escape key) and checks _settingsDirty before closing
- If dirty: shows inline 'Unsaved changes' bar with Save & Close / Discard
- Discard reverts the live theme preview to what it was when panel opened
- _markSettingsDirty() wired to all inputs via addEventListener in loadSettingsPanel()
- saveSettings() now resets dirty flag and hides the bar on successful save

Theme improvements:
- Add 'Slate' theme: warm charcoal (#2b2d30 bg), a softer/lighter dark option
  that sits between Dark and the full light themes
- Rework 'Light' theme: replace pure white (#f5f5f7) with warm off-white
  (#f0ede8) -- warmer, lower contrast, less harsh on most displays
- Update /theme command to include 'slate' in valid list
- Add test_settings_set_theme_slate() to test_sprint26.py
This commit is contained in:
Nathan Esquenazi
2026-04-05 04:00:24 +00:00
parent 96137750a4
commit 882fc947e5
6 changed files with 97 additions and 21 deletions

View File

@@ -74,6 +74,16 @@ def test_settings_set_theme_nord():
post("/api/settings", {"theme": "dark"})
def test_settings_set_theme_slate():
"""Setting theme to 'slate' should persist."""
try:
post("/api/settings", {"theme": "slate"})
d, _ = get("/api/settings")
assert d.get("theme") == "slate"
finally:
post("/api/settings", {"theme": "dark"})
def test_settings_custom_theme_accepted():
"""Custom theme names should be accepted (no enum gate)."""
try: