diff --git a/frontend/src/lib/components/HubBar.svelte b/frontend/src/lib/components/HubBar.svelte index c5363e5..232a4b8 100644 --- a/frontend/src/lib/components/HubBar.svelte +++ b/frontend/src/lib/components/HubBar.svelte @@ -5,6 +5,15 @@ let { active = '' } = $props(); let open = $state(false); + // Close the menu when we cross into desktop width, so it can't linger open and reappear + // if the viewport shrinks back to mobile (the CSS hide alone left `open` stale). + $effect(() => { + const mq = window.matchMedia('(min-width: 721px)'); + const sync = (e) => { if (e.matches) open = false; }; + mq.addEventListener('change', sync); + return () => mq.removeEventListener('change', sync); + }); + const LINKS = [ { key: 'home', href: '/home3', label: 'Home' }, { key: 'news', href: '/', label: 'News' }, diff --git a/frontend/src/lib/components/HubShell.svelte b/frontend/src/lib/components/HubShell.svelte index 88a68b1..5c1704e 100644 --- a/frontend/src/lib/components/HubShell.svelte +++ b/frontend/src/lib/components/HubShell.svelte @@ -12,7 +12,9 @@ afterNavigate(({ from }) => { if (from) cameFromApp = true; }); function goBack() { if (cameFromApp && typeof history !== 'undefined') history.back(); - else goto('/home3'); + // Cold deep-link: no in-app origin. REPLACE this entry rather than pushing one, so the + // browser Back from the hub doesn't bounce the reader straight back into the detail page. + else goto('/home3', { replaceState: true }); }