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。

Merge branch 'dev/hybrid-canvas-grid'

t8y2df32a4608014
diff --cc apps/desktop/src/components/grid/DataGrid.vue
index 293e86f086,d77ede5ba7..4b5ff2303b
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@@ -4,7 -4,7 +4,7 @@@ const globalDdlOpen = ref(false)
</script>
<script setup lang="ts">
- import { computed, nextTick, onUnmounted, useSlots, watch, type Component } from "vue";
-import { computed, nextTick, onMounted, onUnmounted, watch, type Component } from "vue";
++import { computed, nextTick, onMounted, onUnmounted, useSlots, watch, type Component } from "vue";
import { useI18n } from "vue-i18n";
import {
ArrowUp,
@@@ -4020,9 -4410,11 +4444,13 @@@ const triggersLoaded = ref(false)
const triggersLoading = ref(false);
const triggersError = ref("");
const searchQuery = ref("");
+const cellDetailPanelLayout = computed(() => settingsStore.editorSettings.cellDetailPanelLayout);
+const cellDetailPanelIsBottom = computed(() => cellDetailPanelLayout.value === "bottom");
+ watch([showCellDetail, showTableInfo], () => {
+ if (useCanvasGridRows.value) nextTick(syncCanvasViewport);
+ });
+
watch(activeTableInfoTab, () => {
searchQuery.value = "";
});
diff --cc apps/desktop/src/stores/settingsStore.ts
index d912ac235a,3f937c10f1..7215d10c8e
--- a/apps/desktop/src/stores/settingsStore.ts
+++ b/apps/desktop/src/stores/settingsStore.ts
@@@ -183,8 -183,8 +183,10 @@@ export type EditorTheme
const STRUCTURE_EDITOR_DENSITIES = ["compact", "standard", "comfortable"] as const;
export type StructureEditorDensity = (typeof STRUCTURE_EDITOR_DENSITIES)[number];
+const CELL_DETAIL_PANEL_LAYOUTS = ["bottom", "right"] as const;
+export type CellDetailPanelLayout = (typeof CELL_DETAIL_PANEL_LAYOUTS)[number];
+ const DATA_GRID_RENDER_MODES = ["dom", "canvas"] as const;
+ export type DataGridRenderMode = (typeof DATA_GRID_RENDER_MODES)[number];
export interface EditorSettings {
fontFamily: string;
@@@ -292,12 -292,12 +296,18 @@@ function normalizeStructureEditorDensit
: DEFAULT_EDITOR_SETTINGS.structureEditorDensity;
}
+function normalizeCellDetailPanelLayout(value: unknown): CellDetailPanelLayout {
+ return CELL_DETAIL_PANEL_LAYOUTS.includes(value as CellDetailPanelLayout)
+ ? (value as CellDetailPanelLayout)
+ : DEFAULT_EDITOR_SETTINGS.cellDetailPanelLayout;
+}
+
+ function normalizeDataGridRenderMode(value: unknown): DataGridRenderMode {
+ return DATA_GRID_RENDER_MODES.includes(value as DataGridRenderMode)
+ ? (value as DataGridRenderMode)
+ : DEFAULT_EDITOR_SETTINGS.dataGridRenderMode;
+ }
+
function normalizeColumnFormatters(value: unknown): Record<string, ColumnFormatterConfig> {
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
const formatters: Record<string, ColumnFormatterConfig> = {};
diff --cc packages/app-tests/settingsStore.test.ts
index c68580c83f,090e1b6d2b..bc2e90b35c
--- a/packages/app-tests/settingsStore.test.ts
+++ b/packages/app-tests/settingsStore.test.ts
@@@ -98,6 -98,13 +98,13 @@@ test("keeps saved data grid header disp
assert.equal(settings.compactColumnHeaderActions, false);
});
+ test("normalizes data grid render mode", () => {
- assert.equal(DEFAULT_EDITOR_SETTINGS.dataGridRenderMode, "dom");
- assert.equal(normalizeEditorSettings({}).dataGridRenderMode, "dom");
++ assert.equal(DEFAULT_EDITOR_SETTINGS.dataGridRenderMode, "canvas");
++ assert.equal(normalizeEditorSettings({}).dataGridRenderMode, "canvas");
+ assert.equal(normalizeEditorSettings({ dataGridRenderMode: "canvas" as any }).dataGridRenderMode, "canvas");
- assert.equal(normalizeEditorSettings({ dataGridRenderMode: "unknown" as any }).dataGridRenderMode, "dom");
++ assert.equal(normalizeEditorSettings({ dataGridRenderMode: "unknown" as any }).dataGridRenderMode, "canvas");
+ });
+
test("normalizes table structure editor density", () => {
assert.equal(DEFAULT_EDITOR_SETTINGS.structureEditorDensity, "compact");
assert.equal(normalizeEditorSettings({}).structureEditorDensity, "compact");