From 39e1265093de15e4ca32fd70d3f65063eeac712c Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Fri, 10 Jul 2026 17:06:17 +0800 Subject: [PATCH] fix(desktop): recalculate tabs after pin layout changes --- apps/desktop/src/renderer/src/components/tab-bar.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/renderer/src/components/tab-bar.tsx b/apps/desktop/src/renderer/src/components/tab-bar.tsx index c7e09b24fb..d5ff7c3374 100644 --- a/apps/desktop/src/renderer/src/components/tab-bar.tsx +++ b/apps/desktop/src/renderer/src/components/tab-bar.tsx @@ -464,6 +464,9 @@ export function TabBar() { const activeTabId = group?.activeTabId ?? ""; const tabIds = tabs.map((t) => t.id); const tabOrder = tabIds.join("\0"); + const tabLayoutKey = tabs + .map((tab) => `${tab.id}:${tab.pinned ? "pinned" : "unpinned"}`) + .join("\0"); const addedTabIds = getAddedTabIds( previousTabsRef.current, activeWorkspaceSlug, @@ -502,7 +505,13 @@ export function TabBar() { } keepTabVisible(tabScrollRef.current); - }, [activeWorkspaceSlug, activeTabId, shouldReduceMotion, tabOrder]); + }, [ + activeWorkspaceSlug, + activeTabId, + shouldReduceMotion, + tabLayoutKey, + tabOrder, + ]); useEffect(() => { const scroller = tabScrollRef.current;