From 882fc947e51575e5fe53c4d67be79ad42d36928e Mon Sep 17 00:00:00 2001 From: Nathan Esquenazi Date: Sun, 5 Apr 2026 04:00:24 +0000 Subject: [PATCH] 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 --- static/boot.js | 2 +- static/commands.js | 2 +- static/index.html | 5 ++- static/panels.js | 86 +++++++++++++++++++++++++++++++++++------- static/style.css | 13 +++++-- tests/test_sprint26.py | 10 +++++ 6 files changed, 97 insertions(+), 21 deletions(-) diff --git a/static/boot.js b/static/boot.js index 92ec119..e59cb82 100644 --- a/static/boot.js +++ b/static/boot.js @@ -226,7 +226,7 @@ document.addEventListener('keydown',async e=>{ if(e.key==='Escape'){ // Close settings overlay if open const settingsOverlay=$('settingsOverlay'); - if(settingsOverlay&&settingsOverlay.style.display!=='none'){toggleSettings();return;} + if(settingsOverlay&&settingsOverlay.style.display!=='none'){_closeSettingsPanel();return;} // Close workspace dropdown closeWsDropdown(); // Clear session search diff --git a/static/commands.js b/static/commands.js index aca1970..adaaada 100644 --- a/static/commands.js +++ b/static/commands.js @@ -124,7 +124,7 @@ async function cmdUsage(){ } async function cmdTheme(args){ - const themes=['dark','light','solarized','monokai','nord']; + const themes=['dark','slate','light','solarized','monokai','nord']; if(!args||!themes.includes(args.toLowerCase())){ showToast('Usage: /theme '+themes.join('|')); return; diff --git a/static/index.html b/static/index.html index cbebc84..bb541f6 100644 --- a/static/index.html +++ b/static/index.html @@ -312,7 +312,7 @@

Settings

- +
@@ -334,7 +334,8 @@