fix(sidebar): expand collapsed groups when locating tab

Closes #7387
This commit is contained in:
t8y2 committed 2026-08-27 16:33:23 +08:00
1 parent e4dc5bace8
commit 4eeeafa858
4 files changed
+120 -2

No files matched your search

@@ -1567,6 +1567,16 @@ async function locateTabInSidebar(tab: QueryTab | undefined | null, align: Sideb
}
}
// Connection groups never register loaded tree children, so the guard above
// skips them and a collapsed group keeps the target out of the visible flat
// tree. Reopen them through the layout op so the expansion is persisted and
// survives the next layout rebuild; flipping isExpanded directly would be
// reverted by that rebuild (issue #7387).
const collapsedGroupIds = nodePath.filter((node) => node.type === "connection-group" && !node.isExpanded).map((node) => node.id);
if (collapsedGroupIds.length > 0) {
store.expandConnectionGroups(collapsedGroupIds);
}
await nextTick();
const match = target ? findSidebarNodeForTarget(target, flatNodes.value) : null;