aboutsummaryrefslogtreecommitdiffstats
path: root/frontend-vanilla/src/main.ts
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-16 11:28:01 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-16 11:28:01 -0800
commit52ea335714f2b495b92f87636c269b73b4067066 (patch)
tree56ba60da3189fabe1a5796214956e2c466a5c92e /frontend-vanilla/src/main.ts
parentcd4e599a6d7a13e08841d63257dca6d355eb2bb8 (diff)
downloadneko-52ea335714f2b495b92f87636c269b73b4067066.tar.gz
neko-52ea335714f2b495b92f87636c269b73b4067066.tar.bz2
neko-52ea335714f2b495b92f87636c269b73b4067066.zip
v3: persist sidebar state via cookie, default closed on tablet/mobile
Sidebar open/close state is now saved to a cookie (neko_sidebar) so it persists across page reloads. On first visit without a cookie, the sidebar defaults to closed on tablet and mobile (<=1024px viewport) and open on desktop. Removes the auto-open-on-resize behavior that was overriding user preference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'frontend-vanilla/src/main.ts')
-rw-r--r--frontend-vanilla/src/main.ts6
1 files changed, 1 insertions, 5 deletions
diff --git a/frontend-vanilla/src/main.ts b/frontend-vanilla/src/main.ts
index 7d75e14..3dc0574 100644
--- a/frontend-vanilla/src/main.ts
+++ b/frontend-vanilla/src/main.ts
@@ -87,11 +87,7 @@ export function attachLayoutListeners() {
store.setSidebarVisible(false);
});
- window.addEventListener('resize', () => {
- if (window.innerWidth > 768 && !store.sidebarVisible) {
- store.setSidebarVisible(true);
- }
- });
+ // Sidebar state is persisted via cookie; no auto-open on resize
// Collapsible sections
document.querySelectorAll('.sidebar-section.collapsible h3').forEach(header => {