diff --git a/ui/src/components/Layout.tsx b/ui/src/components/Layout.tsx index 97be4990..dbd69a5e 100644 --- a/ui/src/components/Layout.tsx +++ b/ui/src/components/Layout.tsx @@ -23,25 +23,10 @@ import { useCompanyPageMemory } from "../hooks/useCompanyPageMemory"; import { healthApi } from "../api/health"; import { instanceSettingsApi } from "../api/instanceSettings"; import { shouldSyncCompanySelectionFromRoute } from "../lib/company-selection"; -import { - DEFAULT_INSTANCE_SETTINGS_PATH, - normalizeRememberedInstanceSettingsPath, -} from "../lib/instance-settings"; import { queryKeys } from "../lib/queryKeys"; import { cn } from "../lib/utils"; import { NotFoundPage } from "../pages/NotFound"; -const INSTANCE_SETTINGS_MEMORY_KEY = "paperclip.lastInstanceSettingsPath"; - -function readRememberedInstanceSettingsPath(): string { - if (typeof window === "undefined") return DEFAULT_INSTANCE_SETTINGS_PATH; - try { - return normalizeRememberedInstanceSettingsPath(window.localStorage.getItem(INSTANCE_SETTINGS_MEMORY_KEY)); - } catch { - return DEFAULT_INSTANCE_SETTINGS_PATH; - } -} - export function Layout() { const { isMobile } = useSidebar(); const { openNewIssue, openOnboarding } = useDialog(); @@ -59,7 +44,6 @@ export function Layout() { const onboardingTriggered = useRef(false); const lastMainScrollTop = useRef(0); const [mobileNavVisible, setMobileNavVisible] = useState(true); - const [, setInstanceSettingsTarget] = useState(() => readRememberedInstanceSettingsPath()); const matchedCompany = useMemo(() => { if (!companyPrefix) return null; @@ -144,13 +128,6 @@ export function Layout() { useKeyboardShortcuts({ enabled: keyboardShortcutsEnabled, onNewIssue: () => openNewIssue(), - onToggleSidebar: () => { - // Phase 8: sidebar toggle is a no-op from keyboard — the rail is fixed. - // Kept as a stub so useKeyboardShortcuts' type contract is satisfied. - }, - onTogglePanel: () => { - // Phase 8: PropertiesPanel is no longer mounted globally. - }, onSearch: () => { // Phase 8: open the command palette via synthetic keydown, mirroring // the CmdKButton shim. Phase 14 replaces with a real palette context. @@ -158,15 +135,6 @@ export function Layout() { }, }); - useEffect(() => { - if (!isMobile) { - setMobileNavVisible(true); - return; - } - lastMainScrollTop.current = 0; - setMobileNavVisible(true); - }, [isMobile]); - const updateMobileNavVisibility = useCallback((currentTop: number) => { const delta = currentTop - lastMainScrollTop.current; if (currentTop <= 24) setMobileNavVisible(true); @@ -176,11 +144,9 @@ export function Layout() { }, []); useEffect(() => { - if (!isMobile) { - setMobileNavVisible(true); - lastMainScrollTop.current = 0; - return; - } + lastMainScrollTop.current = 0; + setMobileNavVisible(true); + if (!isMobile) return; const onScroll = () => { updateMobileNavVisibility(window.scrollY || document.documentElement.scrollTop || 0); }; @@ -197,19 +163,6 @@ export function Layout() { }; }, [isMobile]); - useEffect(() => { - if (!location.pathname.startsWith("/instance/settings/")) return; - const nextPath = normalizeRememberedInstanceSettingsPath( - `${location.pathname}${location.search}${location.hash}`, - ); - setInstanceSettingsTarget(nextPath); - try { - window.localStorage.setItem(INSTANCE_SETTINGS_MEMORY_KEY, nextPath); - } catch { - // Ignore storage failures in restricted environments. - } - }, [location.hash, location.pathname, location.search]); - return (