25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(sidebar): allow double-click to collapse tree nodes
lxk9556f0d34c2baf9
diff --git a/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue b/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vueindex a4d207e2be..fb9d6a5ae4 100644--- a/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue+++ b/apps/desktop/src/components/sidebar/SidebarTreeRuntimeHost.vue@@ -1622,7 +1622,7 @@ function onDoubleClick(event: MouseEvent) {void openObjectBrowser(false, false, true);} else if (action === "open-object-browser-and-expand") {void openObjectBrowser(false, false, true);- if (!activeNode.value.isExpanded) void toggle(requestId);+ void toggle(requestId);} else if (action === "open-data") {openDataImmediately(activeNode.value);} else if (action === "activate-data") {diff --git a/apps/desktop/src/components/sidebar/__tests__/SidebarTreeRuntimeHost.expansion.spec.ts b/apps/desktop/src/components/sidebar/__tests__/SidebarTreeRuntimeHost.expansion.spec.tsindex 85b620135a..7d3613fe1b 100644--- a/apps/desktop/src/components/sidebar/__tests__/SidebarTreeRuntimeHost.expansion.spec.ts+++ b/apps/desktop/src/components/sidebar/__tests__/SidebarTreeRuntimeHost.expansion.spec.ts@@ -126,6 +126,60 @@ describe("SidebarTreeRuntimeHost expansion", () => {window.removeEventListener(OBJECT_BROWSER_SEARCH_FOCUS_EVENT, focusRequested);});+ it("toggles an expanded database closed on double-click in double-click activation mode", async () => {+ const database: TreeNode = {+ id: "mysql:dbx_test",+ label: "dbx_test",+ type: "database",+ connectionId: "mysql",+ database: "dbx_test",+ isExpanded: true,+ children: [],+ };+ settingsStore.editorSettings.sidebarActivation = "double";+ settingsStore.editorSettings.sidebarBrowseObjectsOnDatabaseActivation = true;++ const host = ref<InstanceType<typeof SidebarTreeRuntimeHost> | null>(null);+ const app = createApp(defineComponent({ setup: () => () => h(SidebarTreeRuntimeHost, { ref: host, node: database, depth: 0 }) }));+ mountedApps.push(app);+ const container = document.createElement("div");+ document.body.append(container);+ app.use(i18n);+ app.mount(container);++ host.value?.handleRowDoubleClick(database, new MouseEvent("dblclick"));+ await nextTick();++ expect(database.isExpanded).toBe(false);+ });++ it("does not collapse an expanded database on click in single-click activation mode", async () => {+ const database: TreeNode = {+ id: "mysql:dbx_test",+ label: "dbx_test",+ type: "database",+ connectionId: "mysql",+ database: "dbx_test",+ isExpanded: true,+ children: [],+ };+ settingsStore.editorSettings.sidebarActivation = "single";+ settingsStore.editorSettings.sidebarBrowseObjectsOnDatabaseActivation = true;++ const host = ref<InstanceType<typeof SidebarTreeRuntimeHost> | null>(null);+ const app = createApp(defineComponent({ setup: () => () => h(SidebarTreeRuntimeHost, { ref: host, node: database, depth: 0 }) }));+ mountedApps.push(app);+ const container = document.createElement("div");+ document.body.append(container);+ app.use(i18n);+ app.mount(container);++ host.value?.handleRowClick(database, 1);+ await nextTick();++ expect(database.isExpanded).toBe(true);+ });+it("reuses a Mongo collection tab by identity without replacing its state", async () => {const collection: TreeNode = {id: "mongo:app:orders",