From ecdcbd85d4de818f0caaaa884e1a31672d276140 Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Wed, 13 May 2026 17:05:59 -0700 Subject: [PATCH] Don't push history when we've gotten here via popstate --- frontend/src/hooks/useAppShell.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);