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。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(settings): scope reset defaults to current tab
t8y2bd671eb1a51b
diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vueindex d72a8272b1..232f9049d2 100644--- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue+++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue@@ -509,7 +509,56 @@ async function applySettingsAndClose() {emit("update:open", false);}-function resetDefaults() {+function resetDefaultsForTab(tab: SettingsCategory) {+ if (tab === "editor") {+ editFontFamily.value = DEFAULT_EDITOR_SETTINGS.fontFamily;+ editFontSize.value = DEFAULT_EDITOR_SETTINGS.fontSize;+ editExecuteMode.value = DEFAULT_EDITOR_SETTINGS.executeMode;+ editWordWrap.value = DEFAULT_EDITOR_SETTINGS.wordWrap;+ editConfirmDangerousSqlExecution.value = DEFAULT_EDITOR_SETTINGS.confirmDangerousSqlExecution;+ } else if (tab === "formatter") {+ editSqlFormatter.value = normalizeSqlFormatterSettings(DEFAULT_EDITOR_SETTINGS.sqlFormatter);+ sqlFormatterConfigValid.value = true;+ } else if (tab === "appearance") {+ editUiScale.value = DEFAULT_EDITOR_SETTINGS.uiScale;+ editTheme.value = DEFAULT_EDITOR_SETTINGS.theme;+ editCustomThemes.value = [...DEFAULT_EDITOR_SETTINGS.customThemes];+ editActiveCustomThemeId.value = DEFAULT_EDITOR_SETTINGS.activeCustomThemeId;+ editAppLayout.value = DEFAULT_EDITOR_SETTINGS.appLayout;+ editShowTrayIcon.value = DEFAULT_DESKTOP_SETTINGS.show_tray_icon;+ editQuitOnClose.value = DEFAULT_DESKTOP_SETTINGS.quit_on_close;+ desktopCloseBehaviorResetPending.value = true;+ editIconTheme.value = DEFAULT_DESKTOP_SETTINGS.icon_theme;+ editDebugLoggingEnabled.value = DEFAULT_DESKTOP_SETTINGS.debug_logging_enabled;+ } else if (tab === "navigation") {+ editSidebarTablePageSize.value = DEFAULT_SIDEBAR_TABLE_PAGE_SIZE;+ editSidebarActivation.value = DEFAULT_EDITOR_SETTINGS.sidebarActivation;+ editSidebarObjectDisplay.value = DEFAULT_EDITOR_SETTINGS.sidebarObjectDisplay;+ editAutoSelectActiveSidebarNode.value = DEFAULT_EDITOR_SETTINGS.autoSelectActiveSidebarNode;+ editDisconnectTabHandlingMode.value = DEFAULT_EDITOR_SETTINGS.disconnectTabHandlingMode;+ editReuseDataTab.value = DEFAULT_EDITOR_SETTINGS.reuseDataTab;+ editUpdateNotificationsEnabled.value = DEFAULT_EDITOR_SETTINGS.updateNotificationsEnabled;+ editSidebarHideTableComments.value = DEFAULT_EDITOR_SETTINGS.sidebarHideTableComments;+ editSidebarAllowHorizontalScroll.value = DEFAULT_EDITOR_SETTINGS.sidebarAllowHorizontalScroll;+ editSidebarHiddenTablePrefixes.value = DEFAULT_EDITOR_SETTINGS.sidebarHiddenTablePrefixes.join("\n");+ editToolbarItems.value = { ...DEFAULT_EDITOR_SETTINGS.toolbarItems };+ } else if (tab === "data") {+ editShowColumnCommentsInHeader.value = DEFAULT_EDITOR_SETTINGS.showColumnCommentsInHeader;+ editShowColumnTypesInHeader.value = DEFAULT_EDITOR_SETTINGS.showColumnTypesInHeader;+ editCompactColumnHeaderActions.value = DEFAULT_EDITOR_SETTINGS.compactColumnHeaderActions;+ editInfiniteScroll.value = DEFAULT_EDITOR_SETTINGS.infiniteScroll;+ editInfiniteScrollMaxRows.value = DEFAULT_EDITOR_SETTINGS.infiniteScrollMaxRows;+ editExportBatchSize.value = DEFAULT_EDITOR_SETTINGS.exportBatchSize;+ } else if (tab === "redis") {+ editRedisScanPageSize.value = DEFAULT_EDITOR_SETTINGS.redisScanPageSize;+ } else if (tab === "shortcuts") {+ editShortcuts.value = normalizeShortcutSettings(DEFAULT_EDITOR_SETTINGS.shortcuts);+ } else if (tab === "snippets") {+ editSnippets.value = DEFAULT_SQL_SNIPPETS.map((s) => ({ ...s }));+ }+}++function resetAllDefaults() {editFontFamily.value = DEFAULT_EDITOR_SETTINGS.fontFamily;editFontSize.value = DEFAULT_EDITOR_SETTINGS.fontSize;editUiScale.value = DEFAULT_EDITOR_SETTINGS.uiScale;@@ -2917,7 +2966,7 @@ watch(</div><DialogFooter v-if="hasSettingsApplyFooter(activeSettingsTab as SettingsCategory)" class="mx-0 mb-0 flex-row flex-wrap items-center justify-end gap-2 rounded-none border-t border-border/60 bg-transparent px-0 pb-0 pt-3 sm:flex-row sm:gap-2 [&>button]:w-auto [&>button]:shrink-0">- <Button variant="outline" @click="resetDefaults">+ <Button variant="outline" @click="resetDefaultsForTab(activeSettingsTab as SettingsCategory)">{{ t("settings.resetDefaults") }}</Button><div class="flex-1" />@@ -3012,6 +3061,10 @@ watch(</DialogFooter><DialogFooter v-else-if="activeSettingsTab === 'about'" class="mx-0 mb-0 flex-row flex-wrap items-center justify-end gap-2 rounded-none border-t border-border/60 bg-transparent px-0 pb-0 pt-3 sm:flex-row sm:gap-2 [&>button]:w-auto [&>button]:shrink-0">+ <Button variant="outline" @click="resetAllDefaults">+ {{ t("settings.resetAllDefaults") }}+ </Button>+ <div class="flex-1" /><Button variant="outline" @click="emit('update:open', false)">{{ t("common.close") }}</Button>diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.tsindex b6b99dd033..951a5c4999 100644--- a/apps/desktop/src/i18n/locales/en.ts+++ b/apps/desktop/src/i18n/locales/en.ts@@ -2395,6 +2395,7 @@ export default {applyAndClose: "Apply and Close",reset: "Reset",resetDefaults: "Reset Defaults",+ resetAllDefaults: "Reset All Defaults",save: "Save",cancel: "Cancel",executeMode: "Execute Mode (Cmd+Enter)",diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.tsindex 58fef329fc..056938359a 100644--- a/apps/desktop/src/i18n/locales/es.ts+++ b/apps/desktop/src/i18n/locales/es.ts@@ -2057,6 +2057,7 @@ export default {applyAndClose: "Aplicar y cerrar",reset: "Restablecer",resetDefaults: "Restablecer valores por defecto",+ resetAllDefaults: "Restablecer todos los valores por defecto",executeMode: "Modo de ejecución (Cmd+Enter)",executeModeAll: "Ejecutar todo el SQL",executeModeCurrent: "Ejecutar sentencia en el cursor",diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.tsindex bb409457c0..77005b3db8 100644--- a/apps/desktop/src/i18n/locales/it.ts+++ b/apps/desktop/src/i18n/locales/it.ts@@ -2130,6 +2130,7 @@ export default {applyAndClose: "Applica e Chiudi",reset: "Reimposta",resetDefaults: "Ripristina Predefiniti",+ resetAllDefaults: "Ripristina Tutti i Predefiniti",save: "Salva",cancel: "Annulla",executeMode: "Modalità Esecuzione (Cmd+Enter)",diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.tsindex 00584526b1..38c82bf17f 100644--- a/apps/desktop/src/i18n/locales/ja.ts+++ b/apps/desktop/src/i18n/locales/ja.ts@@ -2349,6 +2349,7 @@ export default {applyAndClose: "適用して閉じる",reset: "リセット",resetDefaults: "デフォルトにリセット",+ resetAllDefaults: "すべての設定をリセット",save: "保存",cancel: "キャンセル",executeMode: "実行モード (Cmd+Enter)",diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.tsindex ba46102a46..3cf90758db 100644--- a/apps/desktop/src/i18n/locales/pt-BR.ts+++ b/apps/desktop/src/i18n/locales/pt-BR.ts@@ -2141,6 +2141,7 @@ export default {applyAndClose: "Aplicar e fechar",reset: "Redefinir",resetDefaults: "Redefinir padrões",+ resetAllDefaults: "Redefinir todos os padrões",save: "Salvar",cancel: "Cancelar",executeMode: "Modo de execução (Cmd+Enter)",diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.tsindex 267a4adcaa..f2ac7a9d62 100644--- a/apps/desktop/src/i18n/locales/zh-CN.ts+++ b/apps/desktop/src/i18n/locales/zh-CN.ts@@ -2419,6 +2419,7 @@ export default {applyAndClose: "应用并关闭",reset: "重置",resetDefaults: "恢复默认",+ resetAllDefaults: "恢复所有默认设置",save: "保存",cancel: "取消",executeMode: "执行模式 (Cmd+Enter)",diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.tsindex 2b32e7da2e..9239b0fea1 100644--- a/apps/desktop/src/i18n/locales/zh-TW.ts+++ b/apps/desktop/src/i18n/locales/zh-TW.ts@@ -2177,6 +2177,7 @@ export default {applyAndClose: "套用並關閉",reset: "重設",resetDefaults: "還原預設",+ resetAllDefaults: "還原所有預設設定",save: "儲存",cancel: "取消",executeMode: "執行模式 (Cmd+Enter)",