← back to Apartmentwallpaper
fix(theme2): sticky data-theme-preview flag so Theme 1 isn't a one-way trap
0ac44de629971f0808a0ce93b96c84a7d2c8c08b · 2026-06-01 12:34:15 -0700 · SteveStudio2
claude-codex debate (round 5/6) caught a regression from 0dc58a0: gating the
toggle on [data-page-theme=theme2] meant clicking Theme 1 hid the toggle AND
persisted theme1, so reloads stayed hidden with no way back to theme2 without
re-typing ?theme=2. Now a sticky data-theme-preview=on is set whenever the
preview is engaged (valid param or saved choice); toggle visibility gates on
that, so opted-in users can switch freely and default visitors still see nothing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
Diff
commit 0ac44de629971f0808a0ce93b96c84a7d2c8c08b
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Mon Jun 1 12:34:15 2026 -0700
fix(theme2): sticky data-theme-preview flag so Theme 1 isn't a one-way trap
claude-codex debate (round 5/6) caught a regression from 0dc58a0: gating the
toggle on [data-page-theme=theme2] meant clicking Theme 1 hid the toggle AND
persisted theme1, so reloads stayed hidden with no way back to theme2 without
re-typing ?theme=2. Now a sticky data-theme-preview=on is set whenever the
preview is engaged (valid param or saved choice); toggle visibility gates on
that, so opted-in users can switch freely and default visitors still see nothing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
public/index.html | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/public/index.html b/public/index.html
index 9dd84d3..b582137 100644
--- a/public/index.html
+++ b/public/index.html
@@ -251,6 +251,10 @@ textarea:focus-visible,
var theme = urlTheme || ((saved === 'theme2' || saved === 'theme1') ? saved : null);
if (theme) {
document.documentElement.setAttribute('data-page-theme', theme);
+ // Sticky opt-in flag: once the preview is engaged (valid URL param or a saved
+ // choice) the toggle stays visible in BOTH themes, so clicking "Theme 1" isn't
+ // a one-way trap. Default visitors who never opted in still never see it.
+ document.documentElement.setAttribute('data-theme-preview', 'on');
// Persist only when the URL explicitly carried a VALID theme, so an
// unrelated link with ?theme=garbage can't silently rewrite the stored choice.
if (urlTheme) { try { localStorage.setItem('wallco-page-theme', urlTheme); } catch(e){} }
@@ -269,7 +273,7 @@ textarea:focus-visible,
background:#fafafa !important; border:1px solid #e5e5e5 !important; box-shadow:none !important;
}
#page-theme-toggle{ display:none; }
- [data-page-theme="theme2"] #page-theme-toggle{ display:inline-flex; }
+ [data-theme-preview="on"] #page-theme-toggle{ display:inline-flex; }
#page-theme-toggle{
position:fixed; top:96px; right:14px; z-index:90;
gap:0; align-items:center;
← 01d2277 fix(api): clamp /api/products limit to >=1 so hostile ?limit
·
back to Apartmentwallpaper
·
fix(facets): drive /api/facets from live filter state so chi 66f45ff →