From 7f42bc616dae3a354483b7646a83ba2af172863c Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Sat, 7 Mar 2026 21:07:23 +0100 Subject: [PATCH] fix: close mobile sidebar on navigation Sidebar filter and tag selection handlers now call onClose() on mobile viewports (< 1024px), so the overlay dismisses after tapping a link. Closes #10 Co-Authored-By: Claude Opus 4.6 --- src/lib/components/Layout/Sidebar.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/components/Layout/Sidebar.svelte b/src/lib/components/Layout/Sidebar.svelte index aa42db3..567accd 100644 --- a/src/lib/components/Layout/Sidebar.svelte +++ b/src/lib/components/Layout/Sidebar.svelte @@ -11,14 +11,22 @@ let { open, onClose, appVersion }: Props = $props(); + function closeMobile() { + if (window.matchMedia('(max-width: 1023px)').matches) { + onClose?.(); + } + } + function setFilter(filter: NoteFilter) { selectedTag.set(null); loadNotes(filter); + closeMobile(); } function selectTag(tag: string | null) { selectedTag.set(tag); loadNotes('all'); + closeMobile(); }