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(object-browser): respect sidebarActivation double-click mode using event.detail

t8y29b702b86bf93
diff --git a/apps/desktop/src/components/objects/ObjectBrowser.vue b/apps/desktop/src/components/objects/ObjectBrowser.vue
index 36114f047f..93493bc666 100644
--- a/apps/desktop/src/components/objects/ObjectBrowser.vue
+++ b/apps/desktop/src/components/objects/ObjectBrowser.vue
@@ -77,6 +77,7 @@ import { copyToClipboard } from "@/lib/clipboard";
import { formatSqlInsert } from "@/lib/exportFormats";
import { fetchTableDataForExport } from "@/lib/tableDataExport";
import { useConnectionStore } from "@/stores/connectionStore";
+import { useSettingsStore } from "@/stores/settingsStore";
import { useQueryStore } from "@/stores/queryStore";
import QueryEditor from "@/components/editor/QueryEditor.vue";
import type { SqlFormatDialect } from "@/lib/sqlFormatter";
@@ -111,6 +112,7 @@ const { toast } = useToast();
const { highlight } = useSqlHighlighter();
const connectionStore = useConnectionStore();
const queryStore = useQueryStore();
+const settingsStore = useSettingsStore();
const schemas = ref<string[]>([]);
const selectedSchema = ref<string | undefined>(props.schema);
@@ -277,6 +279,15 @@ function sourceTitle(row: ObjectBrowserRow | null) {
return `${row.name} ${t("objects.source")}`;
}
+function onRowClick(row: ObjectBrowserRow, event: MouseEvent) {
+ if (settingsStore.editorSettings.sidebarActivation === "double") {
+ if (event.detail === 2) openRow(row);
+ return;
+ }
+ if (event.detail > 1) return;
+ openRow(row);
+}
+
function openRow(row: ObjectBrowserRow) {
if (row.type === "TABLE") {
emit("openTable", { tableName: row.name, schema: row.schema });
@@ -1177,7 +1188,7 @@ watch(
'bg-primary/5': selectedTableIds.has(item.id),
}"
:style="{ gridTemplateColumns }"
- @click="openRow(item)"
+ @click="onRowClick(item, $event)"
>
<button
class="flex h-6 w-6 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-foreground"