From 4a12a575ede8a86922c254fd50d2ee52ff330145 Mon Sep 17 00:00:00 2001 From: dqn Date: Wed, 3 Jun 2026 20:19:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?perf(ui):=20=E4=BC=98=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA=E7=9A=84ui=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E5=92=8C=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/EditorSettingsDialog.vue | 37 ++++ .../export/ExportProgressPopover.vue | 181 ++++++++++++++++++ .../src/components/layout/AppToolbar.vue | 3 + .../src/components/objects/ObjectBrowser.vue | 60 ++---- .../src/components/sidebar/TreeItem.vue | 78 ++------ .../src/composables/useExportTracker.ts | 71 +++++++ apps/desktop/src/i18n/locales/en.ts | 12 ++ apps/desktop/src/i18n/locales/es.ts | 12 ++ apps/desktop/src/i18n/locales/zh-CN.ts | 12 ++ apps/desktop/src/lib/tauri.ts | 1 + apps/desktop/src/stores/settingsStore.ts | 10 + crates/dbx-core/src/table_export.rs | 110 ++++++++--- crates/dbx-core/src/transfer.rs | 52 +++++ 13 files changed, 500 insertions(+), 139 deletions(-) create mode 100644 apps/desktop/src/components/export/ExportProgressPopover.vue create mode 100644 apps/desktop/src/composables/useExportTracker.ts diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 8fa6f58d5..f826c0ae0 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -117,6 +117,7 @@ const editAutoSelectActiveSidebarNode = ref(settingsStore.editorSettings.autoSel const editSidebarHiddenTablePrefixes = ref(settingsStore.editorSettings.sidebarHiddenTablePrefixes.join("\n")); const editSidebarHideTableComments = ref(settingsStore.editorSettings.sidebarHideTableComments); const editSidebarAllowHorizontalScroll = ref(settingsStore.editorSettings.sidebarAllowHorizontalScroll); +const editExportBatchSize = ref(settingsStore.editorSettings.exportBatchSize); const redisScanPageSizeOptions = [200, 1000, 5000, 10000]; const systemFonts = ref([]); const systemFontsLoading = ref(false); @@ -253,6 +254,7 @@ watch( editSidebarHiddenTablePrefixes.value = settingsStore.editorSettings.sidebarHiddenTablePrefixes.join("\n"); editSidebarHideTableComments.value = settingsStore.editorSettings.sidebarHideTableComments; editSidebarAllowHorizontalScroll.value = settingsStore.editorSettings.sidebarAllowHorizontalScroll; + editExportBatchSize.value = settingsStore.editorSettings.exportBatchSize; editSnippets.value = settingsStore.editorSettings.snippets.map((s) => ({ ...s })); void loadSystemFontOptions(); } @@ -292,6 +294,7 @@ function hasChanges(): boolean { editAutoSelectActiveSidebarNode.value !== settingsStore.editorSettings.autoSelectActiveSidebarNode || editSidebarHideTableComments.value !== settingsStore.editorSettings.sidebarHideTableComments || editSidebarAllowHorizontalScroll.value !== settingsStore.editorSettings.sidebarAllowHorizontalScroll || + editExportBatchSize.value !== settingsStore.editorSettings.exportBatchSize || JSON.stringify(normalizeSidebarHiddenTablePrefixes(editSidebarHiddenTablePrefixes.value)) !== JSON.stringify(settingsStore.editorSettings.sidebarHiddenTablePrefixes) || JSON.stringify(editSnippets.value) !== JSON.stringify(settingsStore.editorSettings.snippets) @@ -320,6 +323,7 @@ async function persistSettings() { sidebarHideTableComments: editSidebarHideTableComments.value, sidebarAllowHorizontalScroll: editSidebarAllowHorizontalScroll.value, sidebarHiddenTablePrefixes: normalizeSidebarHiddenTablePrefixes(editSidebarHiddenTablePrefixes.value), + exportBatchSize: editExportBatchSize.value, snippets: editSnippets.value, }); await settingsStore.updateDesktopSettings({ @@ -360,6 +364,7 @@ function resetDefaults() { editSidebarHideTableComments.value = DEFAULT_EDITOR_SETTINGS.sidebarHideTableComments; editSidebarAllowHorizontalScroll.value = DEFAULT_EDITOR_SETTINGS.sidebarAllowHorizontalScroll; editSidebarHiddenTablePrefixes.value = DEFAULT_EDITOR_SETTINGS.sidebarHiddenTablePrefixes.join("\n"); + editExportBatchSize.value = DEFAULT_EDITOR_SETTINGS.exportBatchSize; editSnippets.value = DEFAULT_SQL_SNIPPETS.map((s) => ({ ...s })); } @@ -428,6 +433,7 @@ type SettingsCategory = | "editor" | "appearance" | "navigation" + | "data" | "redis" | "shortcuts" | "snippets" @@ -440,6 +446,7 @@ const settingsCategoryNav = computed<{ value: SettingsCategory; label: string }[ { value: "editor", label: t("settings.editorTab") }, { value: "appearance", label: t("settings.appearanceTab") }, { value: "navigation", label: t("settings.navigationTab") }, + { value: "data", label: t("settings.dataTab") }, { value: "redis", label: t("settings.redisTab") }, { value: "shortcuts", label: t("settings.shortcutsTab") }, { value: "snippets", label: t("settings.snippetsTab") }, @@ -453,6 +460,7 @@ const settingsTabsWithApplyFooter = new Set([ "editor", "appearance", "navigation", + "data", "redis", "shortcuts", "snippets", @@ -1527,6 +1535,35 @@ watch( + +
+
+
{{ t("settings.exportSection") }}
+
+ +
+ + + + {{ t("settings.exportBatchSizeDescription") }} +
+
+
+
+
diff --git a/apps/desktop/src/components/export/ExportProgressPopover.vue b/apps/desktop/src/components/export/ExportProgressPopover.vue new file mode 100644 index 000000000..8883bb261 --- /dev/null +++ b/apps/desktop/src/components/export/ExportProgressPopover.vue @@ -0,0 +1,181 @@ + + + diff --git a/apps/desktop/src/components/layout/AppToolbar.vue b/apps/desktop/src/components/layout/AppToolbar.vue index 14b6d5efa..c7864867c 100644 --- a/apps/desktop/src/components/layout/AppToolbar.vue +++ b/apps/desktop/src/components/layout/AppToolbar.vue @@ -23,6 +23,7 @@ import { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import LightDropdown from "@/components/ui/LightDropdown.vue"; import WindowControls from "@/components/layout/WindowControls.vue"; +import ExportProgressPopover from "@/components/export/ExportProgressPopover.vue"; import { shouldReserveMacTrafficLightInset, useWindowControls } from "@/composables/useWindowControls"; import { currentLocale, setLocale, type Locale } from "@/i18n"; import type { AppThemeMode } from "@/lib/appTheme"; @@ -193,6 +194,8 @@ function onToolbarDblClick(e: MouseEvent) { {{ t("updates.check") }} + +