From f45ee8f2725ddc95cc4189d1b146548a28cc160b Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 28 May 2026 20:36:56 +0800 Subject: [PATCH] feat(settings): keep dialog open after apply --- .../src/components/editor/EditorSettingsDialog.vue | 13 ++++++++++++- apps/desktop/src/i18n/locales/en.ts | 1 + apps/desktop/src/i18n/locales/es.ts | 1 + apps/desktop/src/i18n/locales/zh-CN.ts | 1 + packages/app-tests/settingsDialogLayout.test.ts | 8 ++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 06a8d4319..703039829 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -276,7 +276,7 @@ function hasChanges(): boolean { ); } -async function applySettings() { +async function persistSettings() { if (hasBlockingShortcutConflicts.value) return; settingsStore.updateEditorSettings({ fontFamily: editFontFamily.value, @@ -299,6 +299,14 @@ async function applySettings() { await settingsStore.updateDesktopSettings({ show_tray_icon: editShowTrayIcon.value, }); +} + +async function applySettings() { + await persistSettings(); +} + +async function applySettingsAndClose() { + await persistSettings(); emit("update:open", false); } @@ -1796,6 +1804,9 @@ watch( + { assert.match(source, /:disabled="!hasChanges\(\) \|\| hasBlockingShortcutConflicts"/); }); +test("settings dialog exposes separate apply and apply-and-close actions", () => { + assert.match(source, /async function persistSettings\(\)/); + assert.match(source, /async function applySettings\(\)/); + assert.match(source, /async function applySettingsAndClose\(\)/); + assert.match(source, /await persistSettings\(\);[\s\S]*emit\("update:open", false\)/); + assert.match(source, /t\("settings\.applyAndClose"\)/); +}); + test("settings dialog exposes sidebar activation in navigation settings", () => { assert.match(source, /value: "navigation"/); assert.match(source, /activeSettingsTab === ['"]navigation['"]/);