fix(tree): preserve object group metadata routing

This commit is contained in:
Elias authored and GitHub committed 2026-07-19 14:56:35 +08:00
1 parent 01ecb6020c
commit 7b14ef3b48
3 files changed
+155 -4

No files matched your search

@@ -65,6 +65,7 @@ import * as api from "@/lib/backend/api";
import { resolveDefaultDatabase } from "@/lib/database/defaultDatabase";
import { canTreeNodePin, canTreeNodeShowExpander } from "@/lib/sidebar/sidebarTreeItemLayout";
import { objectTypesForGroupNode } from "@/lib/table/tableTree";
import { loadSidebarObjectGroup } from "@/lib/sidebar/sidebarObjectGroupRouting";
import { buildTableDeleteTemplate, buildTableInsertTemplate, buildTableSelectTemplate, buildTableUpdateTemplate } from "@/lib/table/tableSqlTemplates";
import { driverStoreFocusForInstallError } from "@/lib/connection/agentDriverInstallHint";
import {
@@ -513,6 +514,11 @@ async function toggle() {
}
try {
if (await loadSidebarObjectGroup(node, connectionStore)) {
emit("node-toggled", node, wasExpanded);
return;
}
if (node.type === "connection" && node.connectionId) {
const config = connectionStore.getConfig(node.connectionId);
if (config?.db_type === "redis") {
@@ -623,10 +629,6 @@ async function toggle() {
await connectionStore.loadIndexes(node.connectionId, node.database, node.tableName, node.schema, node.id, node.catalog);
} else if (node.type === "group-fkeys" && node.connectionId && hasTreeNodeDatabaseContext(node) && node.tableName) {
await connectionStore.loadForeignKeys(node.connectionId, node.database, node.tableName, node.schema, node.id, node.catalog);
} else if (node.type === "group-triggers" && node.connectionId && hasTreeNodeDatabaseContext(node) && node.tableName) {
await connectionStore.loadTriggers(node.connectionId, node.database, node.tableName, node.schema, node.id, node.catalog);
} else if (databaseObjectGroup) {
await connectionStore.loadObjectGroupChildren(node);
}
emit("node-toggled", node, wasExpanded);
} catch (e: any) {