diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 5fb7e667b7..82742eba99 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -901,6 +901,7 @@ const editSidebarIndent = ref(settingsStore.editorSettings.sidebarIndent); const editSidebarFontSize = ref(settingsStore.editorSettings.sidebarFontSize); const editExportBatchSize = ref(settingsStore.editorSettings.exportBatchSize); const editPreferredExportPath = ref(settingsStore.editorSettings.preferredExportPath); +const editAutoOpenExportFolder = ref(settingsStore.editorSettings.autoOpenExportFolder); const editCsvQuoteMode = ref(settingsStore.editorSettings.csvQuoteMode); const editCsvNullMode = ref(settingsStore.editorSettings.csvNullMode); const editGlobalDateTimeDisplayFormat = ref(settingsStore.editorSettings.globalDateTimeDisplayFormat); @@ -1179,6 +1180,7 @@ function currentEditorSettingsDraft(): EditorSettingsDraft { redisDatabaseDisplayLimit: editRedisDatabaseDisplayLimit.value, exportBatchSize: editExportBatchSize.value, preferredExportPath: editPreferredExportPath.value, + autoOpenExportFolder: editAutoOpenExportFolder.value, csvQuoteMode: editCsvQuoteMode.value, csvNullMode: editCsvNullMode.value, globalDateTimeDisplayFormat: editGlobalDateTimeDisplayFormat.value, @@ -1856,6 +1858,7 @@ function syncEditorSettingsDraftFromStore() { editSidebarFontSize.value = settingsStore.editorSettings.sidebarFontSize; editExportBatchSize.value = settingsStore.editorSettings.exportBatchSize; editPreferredExportPath.value = settingsStore.editorSettings.preferredExportPath; + editAutoOpenExportFolder.value = settingsStore.editorSettings.autoOpenExportFolder; editCsvQuoteMode.value = settingsStore.editorSettings.csvQuoteMode; editCsvNullMode.value = settingsStore.editorSettings.csvNullMode; editGlobalDateTimeDisplayFormat.value = settingsStore.editorSettings.globalDateTimeDisplayFormat; @@ -2007,6 +2010,7 @@ const editorSettingsDraftRefs: EditorSettingsDraftRefMap = { redisDatabaseDisplayLimit: editRedisDatabaseDisplayLimit, exportBatchSize: editExportBatchSize, preferredExportPath: editPreferredExportPath, + autoOpenExportFolder: editAutoOpenExportFolder, csvQuoteMode: editCsvQuoteMode, csvNullMode: editCsvNullMode, exportRowLimitEnabled: editExportRowLimitEnabled, @@ -2560,6 +2564,7 @@ function resetDefaultsForTab(tab: SettingsCategory) { editRedisDatabaseDisplayLimit.value = DEFAULT_EDITOR_SETTINGS.redisDatabaseDisplayLimit; editExportBatchSize.value = DEFAULT_EDITOR_SETTINGS.exportBatchSize; editPreferredExportPath.value = DEFAULT_EDITOR_SETTINGS.preferredExportPath; + editAutoOpenExportFolder.value = DEFAULT_EDITOR_SETTINGS.autoOpenExportFolder; editCsvQuoteMode.value = DEFAULT_EDITOR_SETTINGS.csvQuoteMode; editCsvNullMode.value = DEFAULT_EDITOR_SETTINGS.csvNullMode; editGlobalDateTimeDisplayFormat.value = DEFAULT_EDITOR_SETTINGS.globalDateTimeDisplayFormat; @@ -2715,6 +2720,7 @@ function resetAllDefaults() { editRedisDatabaseDisplayLimit.value = DEFAULT_EDITOR_SETTINGS.redisDatabaseDisplayLimit; editExportBatchSize.value = DEFAULT_EDITOR_SETTINGS.exportBatchSize; editPreferredExportPath.value = DEFAULT_EDITOR_SETTINGS.preferredExportPath; + editAutoOpenExportFolder.value = DEFAULT_EDITOR_SETTINGS.autoOpenExportFolder; editCsvQuoteMode.value = DEFAULT_EDITOR_SETTINGS.csvQuoteMode; editCsvNullMode.value = DEFAULT_EDITOR_SETTINGS.csvNullMode; editGlobalDateTimeDisplayFormat.value = DEFAULT_EDITOR_SETTINGS.globalDateTimeDisplayFormat; @@ -9069,6 +9075,15 @@ onUnmounted(() => {

{{ t("settings.preferredExportPathDescription") }}

+
+
+ +

+ {{ t("settings.autoOpenExportFolderDescription") }} +

+
+ +
diff --git a/apps/desktop/src/components/export/DatabaseExportDialog.vue b/apps/desktop/src/components/export/DatabaseExportDialog.vue index 1d37caa09a..fd541ed63d 100644 --- a/apps/desktop/src/components/export/DatabaseExportDialog.vue +++ b/apps/desktop/src/components/export/DatabaseExportDialog.vue @@ -18,10 +18,12 @@ import { isTauriRuntime } from "@/lib/backend/tauriRuntime"; import { promptExportSavePath } from "@/lib/export/exportPath"; import { useToast } from "@/composables/useToast"; import { Input } from "@/components/ui/input"; -import { Download, Square, CheckSquare, Search, X, Loader2, Wrench } from "@lucide/vue"; +import { Download, Square, CheckSquare, Search, X, Loader2, Wrench, FolderOpen } from "@lucide/vue"; import { formatDataTransferDuration, useExportTracker } from "@/composables/useExportTracker"; import { isQueryTimeoutErrorMessage } from "@/lib/sql/queryError"; import type { SqlInsertDialect, SqlInsertMode } from "@/lib/export/sqlInsertMode"; +import { revealExportedPath } from "@/lib/export/exportPath"; +import { translateBackendError } from "@/i18n/backend-errors"; const { t } = useI18n(); const { toast } = useToast(); @@ -91,6 +93,22 @@ const exportWarning = ref(null); const exportCancelled = ref(false); const exportStartedAt = ref(null); const exportFinishedAt = ref(null); +const exportFilePath = ref(""); +const isRevealing = ref(false); +const canRevealFile = computed(() => exportDone.value && !!exportFilePath.value && isTauriRuntime()); + +async function revealExportFile() { + if (!exportFilePath.value || isRevealing.value) return; + isRevealing.value = true; + try { + await revealExportedPath(exportFilePath.value); + } catch (error) { + toast(t("exportProgress.openFolderFailed", { message: translateBackendError(t, error) }), 5000); + } finally { + isRevealing.value = false; + } +} + const currentTime = ref(Date.now()); const pendingPrefillTable = ref(""); const pendingPrefillTables = ref([]); @@ -357,6 +375,7 @@ async function startExport() { // Web mode: use a temp path; the server will handle the file filePath = `__web_export_${exportId.value}.sql`; } + exportFilePath.value = filePath; // Switch to the progress view only after the save dialog closes, and seed a // preparing state so the dialog is never a blank panel while metadata loads. @@ -489,6 +508,7 @@ async function startAllDatabasesExport() { const connectionType = store.getConfig(connectionId.value)?.db_type; const batchId = generateDatabaseExportId(); exportId.value = batchId; + exportFilePath.value = directoryPath; exportProgress.value = { exportId: batchId, currentObject: "", @@ -682,6 +702,7 @@ function resetState() { exportCancelled.value = false; exportStartedAt.value = null; exportFinishedAt.value = null; + exportFilePath.value = ""; exportId.value = ""; batchDatabaseIndex.value = 0; batchDatabaseTotal.value = 0; @@ -1075,7 +1096,12 @@ watch( diff --git a/apps/desktop/src/components/export/ExportProgressDialog.vue b/apps/desktop/src/components/export/ExportProgressDialog.vue index 9f7e6b7900..b129e41697 100644 --- a/apps/desktop/src/components/export/ExportProgressDialog.vue +++ b/apps/desktop/src/components/export/ExportProgressDialog.vue @@ -1,12 +1,12 @@