From 127328a4edc3b9219e2fece0ea66fc6a65269e75 Mon Sep 17 00:00:00 2001 From: zipg Date: Wed, 22 Jul 2026 15:26:23 +0800 Subject: [PATCH] fix(ui): support legacy WebView dialog viewports --- .../ScheduledDatabaseBackupSettings.vue | 2 +- .../connection/ConnectionDialog.vue | 2 +- .../src/components/diff/SchemaDiffDialog.vue | 17 +++++++++---- .../diff/__tests__/SchemaDiffDialog.spec.ts | 25 +++++++++++++++++++ .../editor/EditorSettingsDialog.vue | 4 ++- .../components/import/TableImportDialog.vue | 2 +- .../objects/InstallExtensionDialog.vue | 2 +- .../components/objects/ObjectSourceDialog.vue | 2 +- .../search/DatabaseSearchDialog.vue | 2 +- .../__tests__/DatabaseSearchDialog.spec.ts | 2 +- .../sql-file/SqlFileExecutionDialog.vue | 2 +- .../components/ui/dialog/DialogContent.vue | 2 +- .../ui/dialog/DialogScrollContent.vue | 2 +- .../__tests__/legacyWebviewFallback.spec.ts | 16 ++++++++++++ apps/desktop/src/styles/globals.css | 7 ++++++ .../app-tests/sqlFileExecutionDialog.test.ts | 2 +- 16 files changed, 74 insertions(+), 17 deletions(-) create mode 100644 apps/desktop/src/components/diff/__tests__/SchemaDiffDialog.spec.ts diff --git a/apps/desktop/src/components/backup/ScheduledDatabaseBackupSettings.vue b/apps/desktop/src/components/backup/ScheduledDatabaseBackupSettings.vue index 6f9ab533f..143b5f09d 100644 --- a/apps/desktop/src/components/backup/ScheduledDatabaseBackupSettings.vue +++ b/apps/desktop/src/components/backup/ScheduledDatabaseBackupSettings.vue @@ -381,7 +381,7 @@ function restoreBackup(run: DatabaseBackupRun, file: DatabaseBackupFile) { - + {{ editingScheduleId ? t("databaseBackup.editSchedule") : t("databaseBackup.addSchedule") }} diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index 5939fffed..0432f8aae 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -6377,7 +6377,7 @@ function openExternalUrl(url: string) { .connection-dialog-content { display: flex; flex-direction: column; - max-height: calc(100dvh - 2rem); + max-height: calc(var(--dbx-viewport-height) - 2rem); } @media (min-width: 640px) { diff --git a/apps/desktop/src/components/diff/SchemaDiffDialog.vue b/apps/desktop/src/components/diff/SchemaDiffDialog.vue index 94e7a273a..d01153f17 100644 --- a/apps/desktop/src/components/diff/SchemaDiffDialog.vue +++ b/apps/desktop/src/components/diff/SchemaDiffDialog.vue @@ -106,10 +106,10 @@ const isMaximized = ref(false); const dialogStyle = computed(() => { if (isMaximized.value) { return { - width: "100vw", - height: "100vh", - maxWidth: "100vw", - maxHeight: "100vh", + width: "100%", + height: "100%", + maxWidth: "100%", + maxHeight: "100%", borderRadius: "0", }; } @@ -133,6 +133,13 @@ function toggleMaximize() { isMaximized.value = !isMaximized.value; } +function handleDialogEscape(event: KeyboardEvent) { + if (!showOptionsPanel.value) return; + + event.preventDefault(); + showOptionsPanel.value = false; +} + let resizeObserver: ResizeObserver | null = null; let saveTimeout: number | null = null; @@ -679,7 +686,7 @@ const targetConnectionInfo = computed(() => {