diff --git a/frontend/src/hooks/useAppShell.ts b/frontend/src/hooks/useAppShell.ts index c56bf63..5bb7342 100644 --- a/frontend/src/hooks/useAppShell.ts +++ b/frontend/src/hooks/useAppShell.ts @@ -89,7 +89,9 @@ export function useAppShell(): UseAppShellResult { const handlePopstate = () => { const section = parseHashSettingsSection(); if (section !== null) { - pushedSettingsEntryRef.current = true; + // Don't set pushedSettingsEntryRef here — the user arrived via + // back/forward, not by opening settings. Closing settings should + // replaceState, not history.back(), to avoid popping an unrelated entry. startTransition(() => { setShowSettings(true); setSettingsSection(section);