Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

fix(sidebar): show group action without connections

t8y2f7f622229bab
diff --git a/apps/desktop/src/components/sidebar/ConnectionTree.vue b/apps/desktop/src/components/sidebar/ConnectionTree.vue
index 56ab382583..557f7586e9 100644
--- a/apps/desktop/src/components/sidebar/ConnectionTree.vue
+++ b/apps/desktop/src/components/sidebar/ConnectionTree.vue
@@ -182,7 +182,7 @@ defineExpose({ focusSearch });
<template>
<div class="h-full min-h-0 flex flex-col text-sm select-none">
- <div v-if="store.treeNodes.length > 0" class="sticky top-0 z-10 bg-background px-2 py-1">
+ <div class="sticky top-0 z-10 bg-background px-2 py-1">
<div class="relative flex items-center gap-1">
<div class="relative flex-1">
<Search class="absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground" />
diff --git a/packages/app-tests/connectionTreeToolbar.test.ts b/packages/app-tests/connectionTreeToolbar.test.ts
new file mode 100644
index 0000000000..94876e3943
--- /dev/null
+++ b/packages/app-tests/connectionTreeToolbar.test.ts
@@ -0,0 +1,16 @@
+import test from "node:test";
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+
+const connectionTreeSource = readFileSync(
+ new URL("../../apps/desktop/src/components/sidebar/ConnectionTree.vue", import.meta.url),
+ "utf8",
+);
+
+test("connection tree toolbar is visible before any connection exists", () => {
+ assert.ok(connectionTreeSource.includes(":title=\"t('connectionGroup.createGroup')\""));
+ assert.ok(
+ !connectionTreeSource.includes('v-if="store.treeNodes.length > 0" class="sticky'),
+ "the toolbar should not be hidden when the connection tree is empty",
+ );
+});