From 2c97e44d829c400d946992ab2c6363e91d97366c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E4=B8=AB=E8=AE=B2=E6=A2=B5?= Date: Wed, 16 Sep 2026 23:50:18 +0800 Subject: [PATCH] feat(updater): decouple update notice from auto download Closes #9329 --- .../editor/EditorSettingsDialog.vue | 15 +++ .../components/layout/UpdateDialog.spec.ts | 2 +- .../src/components/layout/UpdateDialog.vue | 2 +- .../__tests__/useAppUpdater.spec.ts | 93 ++++++++++++++++++- apps/desktop/src/composables/useAppUpdater.ts | 37 +++++++- apps/desktop/src/i18n/locales/az.ts | 4 +- apps/desktop/src/i18n/locales/en.ts | 4 +- apps/desktop/src/i18n/locales/es.ts | 4 +- apps/desktop/src/i18n/locales/it.ts | 4 +- apps/desktop/src/i18n/locales/ja.ts | 4 +- apps/desktop/src/i18n/locales/ko.ts | 4 +- apps/desktop/src/i18n/locales/pt-BR.ts | 4 +- apps/desktop/src/i18n/locales/tr.ts | 4 +- apps/desktop/src/i18n/locales/zh-CN.ts | 4 +- apps/desktop/src/i18n/locales/zh-TW.ts | 4 +- .../src/lib/settings/editorSettingsDraft.ts | 1 + .../src/lib/settings/settingsSearch.ts | 1 + .../src/lib/settings/settingsTransfer.ts | 3 +- .../stores/__tests__/settingsStore.spec.ts | 7 ++ apps/desktop/src/stores/settingsStore.ts | 4 + 20 files changed, 187 insertions(+), 18 deletions(-) diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 6dcb7bbd01..2a959e163c 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -659,6 +659,7 @@ const editFormatSqlOnSqlFileSave = ref(settingsStore.editorSettings.formatSqlOnS const editShowTableDdlHoverPreview = ref(settingsStore.editorSettings.showTableDdlHoverPreview); const editClickTableNavigationTarget = ref(settingsStore.editorSettings.clickTableNavigationTarget); const editUpdateNotificationsEnabled = ref(settingsStore.editorSettings.updateNotificationsEnabled); +const editAutoDownloadUpdates = ref(settingsStore.editorSettings.autoDownloadUpdates); const editSidebarHiddenTablePrefixes = ref(settingsStore.editorSettings.sidebarHiddenTablePrefixes.join("\n")); const editSidebarCopyTableNameSeparator = ref(settingsStore.editorSettings.sidebarCopyTableNameSeparator); const editSidebarCopyTableNameIncludeSchema = ref(settingsStore.editorSettings.sidebarCopyTableNameIncludeSchema); @@ -816,6 +817,7 @@ function currentEditorSettingsDraft(): EditorSettingsDraft { formatSqlOnSqlFileSave: editFormatSqlOnSqlFileSave.value, showTableDdlHoverPreview: editShowTableDdlHoverPreview.value, updateNotificationsEnabled: editUpdateNotificationsEnabled.value, + autoDownloadUpdates: editAutoDownloadUpdates.value, sidebarObjectInfoMode: editSidebarObjectInfoMode.value, sidebarAllowHorizontalScroll: editSidebarAllowHorizontalScroll.value, sidebarShowTooltips: editSidebarShowTooltips.value, @@ -1341,6 +1343,7 @@ function syncEditorSettingsDraftFromStore() { editShowTableDdlHoverPreview.value = settingsStore.editorSettings.showTableDdlHoverPreview; editClickTableNavigationTarget.value = settingsStore.editorSettings.clickTableNavigationTarget; editUpdateNotificationsEnabled.value = settingsStore.editorSettings.updateNotificationsEnabled; + editAutoDownloadUpdates.value = settingsStore.editorSettings.autoDownloadUpdates; editSidebarHiddenTablePrefixes.value = settingsStore.editorSettings.sidebarHiddenTablePrefixes.join("\n"); editSidebarCopyTableNameSeparator.value = settingsStore.editorSettings.sidebarCopyTableNameSeparator; editSidebarCopyTableNameIncludeSchema.value = settingsStore.editorSettings.sidebarCopyTableNameIncludeSchema; @@ -1456,6 +1459,7 @@ const editorSettingsDraftRefs: EditorSettingsDraftRefMap = { formatSqlOnSqlFileSave: editFormatSqlOnSqlFileSave, showTableDdlHoverPreview: editShowTableDdlHoverPreview, updateNotificationsEnabled: editUpdateNotificationsEnabled, + autoDownloadUpdates: editAutoDownloadUpdates, sidebarObjectInfoMode: editSidebarObjectInfoMode, sidebarAllowHorizontalScroll: editSidebarAllowHorizontalScroll, sidebarShowTooltips: editSidebarShowTooltips, @@ -1935,6 +1939,7 @@ function resetDefaultsForTab(tab: SettingsCategory) { } else if (tab === "about") { editUpdateDownloadSource.value = DEFAULT_EDITOR_SETTINGS.updateDownloadSource; editUpdateNotificationsEnabled.value = DEFAULT_EDITOR_SETTINGS.updateNotificationsEnabled; + editAutoDownloadUpdates.value = DEFAULT_EDITOR_SETTINGS.autoDownloadUpdates; } } @@ -2030,6 +2035,7 @@ function resetAllDefaults() { editFormatSqlOnSqlFileSave.value = DEFAULT_EDITOR_SETTINGS.formatSqlOnSqlFileSave; editShowTableDdlHoverPreview.value = DEFAULT_EDITOR_SETTINGS.showTableDdlHoverPreview; editUpdateNotificationsEnabled.value = DEFAULT_EDITOR_SETTINGS.updateNotificationsEnabled; + editAutoDownloadUpdates.value = DEFAULT_EDITOR_SETTINGS.autoDownloadUpdates; editSidebarObjectInfoMode.value = DEFAULT_EDITOR_SETTINGS.sidebarObjectInfoMode; editSidebarAllowHorizontalScroll.value = DEFAULT_EDITOR_SETTINGS.sidebarAllowHorizontalScroll; editSidebarShowTooltips.value = DEFAULT_EDITOR_SETTINGS.sidebarShowTooltips; @@ -9631,6 +9637,15 @@ LIMIT 100; +
+
+ +

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

+
+ +
diff --git a/apps/desktop/src/components/layout/UpdateDialog.spec.ts b/apps/desktop/src/components/layout/UpdateDialog.spec.ts index 79b0249b26..be2c658426 100644 --- a/apps/desktop/src/components/layout/UpdateDialog.spec.ts +++ b/apps/desktop/src/components/layout/UpdateDialog.spec.ts @@ -112,7 +112,7 @@ function buttonWithText(text: string): HTMLButtonElement | undefined { } function downloadButton(): HTMLButtonElement | undefined { - return buttonWithText("Retry Download"); + return buttonWithText("Download in Background") ?? buttonWithText("Retry Download"); } function cancelDownloadButton(): HTMLButtonElement | undefined { diff --git a/apps/desktop/src/components/layout/UpdateDialog.vue b/apps/desktop/src/components/layout/UpdateDialog.vue index 828cebed8e..dc1e2e7eca 100644 --- a/apps/desktop/src/components/layout/UpdateDialog.vue +++ b/apps/desktop/src/components/layout/UpdateDialog.vue @@ -194,7 +194,7 @@ watch( - +