{/* Zone 2: Tab Bar */}
@@ -101,6 +67,14 @@ export const AppShell = () => {
)}
))}
+ {/* 新增 Tab 按钮 - 跟随最后一个 Tab */}
+
diff --git a/src/renderer/src/components/layout/TabRouter.tsx b/src/renderer/src/components/layout/TabRouter.tsx
index cebeeff605..3de4ded8f8 100644
--- a/src/renderer/src/components/layout/TabRouter.tsx
+++ b/src/renderer/src/components/layout/TabRouter.tsx
@@ -34,6 +34,14 @@ export const TabRouter = ({ tab, isActive, onUrlChange }: TabRouterProps) => {
})
}, [router, tab.url, onUrlChange])
+ // Navigate when tab.url changes externally (e.g., from Sidebar)
+ useEffect(() => {
+ const currentPath = router.state.location.pathname
+ if (tab.url !== currentPath) {
+ router.navigate({ to: tab.url })
+ }
+ }, [router, tab.url])
+
return (