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(ci): align desktop tests with zoom changes

t8y24de788ada268
diff --git a/apps/desktop/src/components/editor/QueryEditor.vue b/apps/desktop/src/components/editor/QueryEditor.vue
index b662a7ec96..bfe5e24230 100644
--- a/apps/desktop/src/components/editor/QueryEditor.vue
+++ b/apps/desktop/src/components/editor/QueryEditor.vue
@@ -235,29 +235,10 @@ function applyLiveFontSize(size: number) {
scheduleFontThemeReconfig(next, settingsStore.editorSettings.fontFamily);
}
-function commitFontSize(size: number) {
- const next = clampEditorFontSize(size);
- applyLiveFontSize(next);
- if (settingsStore.editorSettings.fontSize === next) return;
- settingsStore.updateEditorSettings({ fontSize: next });
-}
-
function scheduleFontSizeCommit(size: number) {
zoomCommitScheduler.schedule(size);
}
-function zoomIn() {
- commitFontSize(liveFontSize.value + 1);
-}
-
-function zoomOut() {
- commitFontSize(liveFontSize.value - 1);
-}
-
-function resetZoom() {
- commitFontSize(13);
-}
-
function onEditorGestureStart(event: EditorGestureEvent) {
event.preventDefault();
isGestureZooming.value = true;
diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue
index 8bd8311e57..c430fac038 100644
--- a/apps/desktop/src/components/grid/DataGrid.vue
+++ b/apps/desktop/src/components/grid/DataGrid.vue
@@ -1993,12 +1993,6 @@ const multiRowCount = computed(() => {
});
const isMultiRow = computed(() => multiRowCount.value > 1);
-const copyRowJsonLabel = computed(() => {
- if (isTransposeMode.value) {
- return isMultiRow.value ? t("grid.copyColumnsJson", { count: multiRowCount.value }) : t("grid.copyColumnJson");
- }
- return isMultiRow.value ? t("grid.copyRows", { count: multiRowCount.value }) : t("grid.copyRow");
-});
function onCellMouseenter(rowIndex: number, visibleColIdx: number, actualColIdx: number) {
hoveredDetailCell.value = { rowIndex, col: actualColIdx };
diff --git a/apps/desktop/src/components/sidebar/TreeItem.vue b/apps/desktop/src/components/sidebar/TreeItem.vue
index f588af0da9..96be5e9736 100644
--- a/apps/desktop/src/components/sidebar/TreeItem.vue
+++ b/apps/desktop/src/components/sidebar/TreeItem.vue
@@ -102,7 +102,7 @@ import { buildRenameObjectSql, supportsObjectRename, type RenameableObjectType }
import { buildRoutineRenameObjectSourceStatements, supportsSourceBackedRoutineRename } from "@/lib/objectSourceEditor";
import { buildViewDdl } from "@/lib/viewDdl";
import { hexToRgba } from "@/lib/color";
-import { focusSidebarRenameInput, shouldPreventRenameCloseAutoFocus } from "@/lib/sidebarRenameFocus";
+import { focusSidebarRenameInput } from "@/lib/sidebarRenameFocus";
import { hasTreeNodeDatabaseContext } from "@/lib/treeNodeContext";
import { sidebarDisplayTableName } from "@/lib/sidebarTableNameDisplay";
import DangerConfirmDialog from "@/components/editor/DangerConfirmDialog.vue";
@@ -1618,24 +1618,16 @@ function openVisibleDatabasesDialog() {
const isRenamingGroup = ref(false);
const renameInput = ref("");
const renameInputRef = ref<HTMLInputElement>();
-const preventRenameCloseAutoFocus = ref(false);
function startRenameGroup() {
renameInput.value = props.node.label;
isRenamingGroup.value = true;
- preventRenameCloseAutoFocus.value = true;
emit("rename-started");
nextTick(() => {
focusSidebarRenameInput(() => (isRenamingGroup.value ? renameInputRef.value : undefined));
});
}
-function onContextMenuCloseAutoFocus(event: Event) {
- if (shouldPreventRenameCloseAutoFocus(preventRenameCloseAutoFocus)) {
- event.preventDefault();
- }
-}
-
watch(
() => props.pendingRename,
(val) => {
@@ -2093,7 +2085,7 @@ function treeItemMenuItems(): ContextMenuItem[] {
}
// 11. Universal Copy Name (for all types except connection)
- if (node.type !== "connection" && hasTypeMenu.value) {
+ if (hasTypeMenu.value) {
items.push({ label: "", separator: true });
items.push({ label: t("contextMenu.copyName"), action: copyName, icon: Copy });
}
diff --git a/packages/app-tests/dataGridSelectionShortcuts.test.ts b/packages/app-tests/dataGridSelectionShortcuts.test.ts
index d8c6e2d150..87e9cab9f4 100644
--- a/packages/app-tests/dataGridSelectionShortcuts.test.ts
+++ b/packages/app-tests/dataGridSelectionShortcuts.test.ts
@@ -39,8 +39,9 @@ test("transpose record headers copy selected records as rows", () => {
assert.match(source, /handleRowClick\(rowIndex, item\.id, event\)/);
assert.match(source, /@click="selectTransposeRecord\(recordIndex, \$event\)"/);
assert.match(source, /@contextmenu="selectTransposeRecord\(recordIndex, \$event\)"/);
- assert.match(source, /copyRowJsonLabel/);
- assert.match(source, /if \(isTransposeMode\.value\)/);
- assert.match(source, /grid\.copyColumnJson/);
- assert.match(source, /grid\.copyColumnsJson/);
+ assert.match(source, /function copyRowLabels\(\)/);
+ assert.match(source, /const labels = copyRowLabels\(\)/);
+ assert.match(source, /items\.push\(\{ label: labels\.row, action: copyRow \}\)/);
+ assert.match(source, /t\("grid\.copyRows", \{ count \}\)/);
+ assert.match(source, /t\("grid\.copyRow"\)/);
});
diff --git a/packages/app-tests/queryEditorSearchReplace.test.ts b/packages/app-tests/queryEditorSearchReplace.test.ts
index 27d0acbbf8..908973ca0b 100644
--- a/packages/app-tests/queryEditorSearchReplace.test.ts
+++ b/packages/app-tests/queryEditorSearchReplace.test.ts
@@ -33,8 +33,8 @@ test("query editor no longer binds keyboard shortcuts for editor font zoom", ()
});
test("query editor exposes a context menu for executing selected SQL", () => {
- assert.match(source, /ContextMenuContent/);
- assert.match(source, /data-context-menu/);
+ assert.match(source, /CustomContextMenu/);
+ assert.match(source, /v-slot="\{ onContextMenu \}"/);
assert.match(source, /syncContextMenuState\(update\.view\)/);
assert.match(source, /executeSelection/);
assert.match(source, /copySelection/);
diff --git a/packages/app-tests/redisSidebarFlushDb.test.ts b/packages/app-tests/redisSidebarFlushDb.test.ts
index c788f02a1a..f7fe7d2323 100644
--- a/packages/app-tests/redisSidebarFlushDb.test.ts
+++ b/packages/app-tests/redisSidebarFlushDb.test.ts
@@ -10,12 +10,15 @@ test("Redis DB flush is exposed from the sidebar DB context menu", () => {
assert.match(source, /async function confirmFlushRedisDb\(\)/);
assert.match(source, /await api\.redisFlushDb\(node\.connectionId, Number\(node\.database\)\)/);
assert.match(source, /connectionStore\.updateRedisDbKeyStats\(node\.connectionId, Number\(node\.database\), \{ loaded: 0, total: 0 \}\)/);
- assert.match(source, /node\.type === 'redis-db'/);
- assert.match(source, /@click="flushRedisDb"/);
+ assert.match(source, /if \(node\.type === "redis-db" \|\| node\.type === "mongo-db"\) \{/);
+ assert.match(source, /if \(node\.type === "redis-db"\) \{/);
+ assert.match(source, /items\.push\(\{ label: t\("redis\.flushDb"\), action: flushRedisDb, icon: Eraser, variant: "destructive" as const \}\)/);
assert.match(source, /t\("redis\.flushDb"\)/);
- assert.match(source, /t\('redis\.flushDbMessage'\)/);
- assert.match(source, /t\('redis\.flushDbDetails', \{ db: node\.database \}\)/);
- assert.match(source, /t\('redis\.flushDbConfirm'\)/);
+ assert.match(source, /v-model:open="showFlushRedisDbConfirm"/);
+ assert.match(source, /:message="t\('redis\.flushDbMessage'\)"/);
+ assert.match(source, /:details="t\('redis\.flushDbDetails', \{ db: node\.database \}\)"/);
+ assert.match(source, /:confirm-label="t\('redis\.flushDbConfirm'\)"/);
+ assert.match(source, /@confirm="confirmFlushRedisDb"/);
});
test("Redis command panel no longer shows a flush DB button", () => {