fix(skill): clear file tree highlight when switching to start tab

The sync hook skipped deselectAll() when activeTabId was START_TAB_ID,
leaving stale highlights after closing the last file tab.
This commit is contained in:
yyh
2026-01-30 17:12:51 +08:00
parent 0f6f46b1f0
commit a4b0e4a2a0

View File

@ -25,14 +25,14 @@ export function useSyncTreeWithActiveTab({
const storeApi = useWorkflowStore()
useEffect(() => {
if (!activeTabId || activeTabId === START_TAB_ID)
if (!activeTabId)
return
const tree = treeRef.current
if (!tree)
return
if (isArtifactTab(activeTabId)) {
if (activeTabId === START_TAB_ID || isArtifactTab(activeTabId)) {
requestAnimationFrame(() => {
tree.deselectAll()
})