From ad266956cc7dbe44d74d226e184f7ddbe7db8dc0 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Mon, 24 Aug 2026 03:59:11 +0800 Subject: [PATCH] fix: restore split layout selection (#1310) --- src/ui/AppShell.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/AppShell.tsx b/src/ui/AppShell.tsx index bda72407..fbb6c6b3 100644 --- a/src/ui/AppShell.tsx +++ b/src/ui/AppShell.tsx @@ -550,8 +550,9 @@ export function AppShell({ }); }, []); const skipSplitSyncRef = useRef(false); + const activeTabAvailable = tabs.some((tab) => tab.id === activeTabId); useEffect(() => { - const active = tabsRef.current.find((tab) => tab.id === activeTabId); + const active = tabs.find((tab) => tab.id === activeTabId); const config = active?.type === "split-screen" ? active.splitConfig : null; skipSplitSyncRef.current = true; if (!config) { @@ -565,7 +566,7 @@ export function AppShell({ setRowSizes(config.rowSizes); setRowColSizes(config.rowColSizes); setFocusedPaneIndex(0); - }, [activeTabId]); + }, [activeTabId, activeTabAvailable]); useEffect(() => { if (skipSplitSyncRef.current) {