From b278d11aca45a71d1e6cdd3b51e6577c23f19ad3 Mon Sep 17 00:00:00 2001 From: Red J Adaya Date: Sat, 7 Sep 2024 08:41:00 +0800 Subject: [PATCH] do no animate tabs on load (#351) --- frontend/app/tab/tabbar.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/app/tab/tabbar.tsx b/frontend/app/tab/tabbar.tsx index 4b349e08e..a2368ad0a 100644 --- a/frontend/app/tab/tabbar.tsx +++ b/frontend/app/tab/tabbar.tsx @@ -70,6 +70,7 @@ const TabBar = React.memo(({ workspace }: TabBarProps) => { const tabWidthRef = useRef(TAB_DEFAULT_WIDTH); const scrollableRef = useRef(false); const updateStatusButtonRef = useRef(null); + const prevAllLoadedRef = useRef(false); const windowData = useAtomValue(atoms.waveWindow); const { activetabid } = windowData; @@ -202,8 +203,11 @@ const TabBar = React.memo(({ workspace }: TabBarProps) => { // Check if all tabs are loaded const allLoaded = tabIds.length > 0 && tabIds.every((id) => tabsLoaded[id]); if (allLoaded) { - updateSizeAndPosition(newTabId === null); + updateSizeAndPosition(newTabId === null && prevAllLoadedRef.current); saveTabsPosition(); + if (!prevAllLoadedRef.current) { + prevAllLoadedRef.current = true; + } } }, [tabIds, tabsLoaded, newTabId, handleResizeTabs, saveTabsPosition]);