🐛 fix(sidebar): 修复表分组折叠后二次展开消失 Fixes #606

- 限制侧边栏折叠时的子树释放范围,只清理可重新懒加载的 connection/database 节点

- 保留 tables object-group 的已加载子节点,避免二次点击展开后表列表被清空

- 补充针对大表分组折叠场景的回归测试
This commit is contained in:
Syngnat
2026-06-30 21:46:13 +08:00
parent a9bae6bb3f
commit 52eacdd9df
2 changed files with 19 additions and 14 deletions

View File

@@ -825,7 +825,7 @@ export const shouldClearSidebarNodeChildrenOnCollapse = (
if (!node || node.isLeaf === true || !node.children?.length) {
return false;
}
if (node.type !== 'connection' && node.type !== 'database' && node.type !== 'object-group') {
if (node.type !== 'connection' && node.type !== 'database') {
return false;
}
return collectSidebarSubtreeKeys(node).length >= SIDEBAR_COLLAPSE_UNLOAD_SUBTREE_LIMIT;