From 67cc920e06025751d52666d3455271f82ed26340 Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Wed, 21 Oct 2026 11:30:27 +0900 Subject: [PATCH] fix(renderer): keep typed excluded apps and failed template edits instead of silently discarding them - Settings > Input: the excluded-apps field was reset from every telemetry snapshot (several per second while typing), so edits vanished before blur saved them; it now syncs only when the saved list changes - Templates: a failed save (e.g. deleted on another device) closed the dialog and dropped the edits; it now stays open and shows why, and a failed session start is reported too --- .../src/renderer/components/TemplateSection.tsx | 16 +++++++++++----- .../input-insights/InputConsentPanel.tsx | 9 ++++++--- packages/i18n/src/locales/en.json | 2 ++ packages/i18n/src/locales/ko.json | 2 ++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/apps/desktop/src/renderer/components/TemplateSection.tsx b/apps/desktop/src/renderer/components/TemplateSection.tsx index 89ceb2b..25a3cd4 100644 --- a/apps/desktop/src/renderer/components/TemplateSection.tsx +++ b/apps/desktop/src/renderer/components/TemplateSection.tsx @@ -104,21 +104,24 @@ export function TemplateSection(): React.ReactElement { isSavingRef.current = true setSaving(true) try { - if (editId) { - await window.electronAPI.dictationTemplate.update({ + // 실패(다른 기기에서 지워짐 등)면 대화상자를 닫지 않는다 — 닫으면 편집한 필드가 조용히 사라진다. + const result = editId + ? await window.electronAPI.dictationTemplate.update({ id: editId, name: formName.trim(), description: formDesc.trim(), fields: formFields, outputFormat: formOutput, }) - } else { - await window.electronAPI.dictationTemplate.create({ + : await window.electronAPI.dictationTemplate.create({ name: formName.trim(), description: formDesc.trim(), fields: formFields, outputFormat: formOutput, }) + if (!result.success) { + notify({ message: t('tools.templates.saveFailed', { reason: result.error.message }), severity: 'error' }) + return } setDialogOpen(false) loadData() @@ -139,7 +142,10 @@ export function TemplateSection(): React.ReactElement { const handleStartSession = async (templateId: string) => { setLastOutput(null) - await window.electronAPI.dictationTemplate.startSession({ templateId }) + const result = await window.electronAPI.dictationTemplate.startSession({ templateId }) + if (!result.success) { + notify({ message: t('tools.templates.startFailed', { reason: result.error.message }), severity: 'error' }) + } } const handleCopyOutput = () => { diff --git a/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx b/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx index 5872827..ec7b17e 100644 --- a/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx +++ b/apps/desktop/src/renderer/components/input-insights/InputConsentPanel.tsx @@ -45,10 +45,13 @@ export function InputConsentPanel(): React.ReactElement { const paused = telemetry?.paused ?? false const suggestionEnabled = suggestion?.enabled ?? false + // 입력 상태는 스냅샷마다 새 객체로 온다 — 객체에 걸면 치는 도중 칸이 저장값으로 계속 되돌아간다. + // 저장된 목록 문자열이 실제로 바뀔 때만 맞춘다. + const excludedAppsSaved = telemetry?.excludedApps.join(', ') useEffect(() => { - if (!telemetry) return - setExcludedApps(telemetry.excludedApps.join(', ')) - }, [telemetry]) + if (excludedAppsSaved === undefined) return + setExcludedApps(excludedAppsSaved) + }, [excludedAppsSaved]) // 설정 파일에 굳은 실제 값을 그대로 보여준다 (하드코딩 기본값을 표시하면 // 사용자가 보는 값과 동작이 어긋난다 — 실측: 트리거가 3008ms 로 저장돼 있었다). diff --git a/packages/i18n/src/locales/en.json b/packages/i18n/src/locales/en.json index 5da951e..2a3d517 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -2532,6 +2532,8 @@ "tools.templates.deleted": "Deleted template '{{name}}'.", "tools.templates.startItem": "Start {{name}}", "tools.templates.removeField": "Remove field {{n}}", + "tools.templates.saveFailed": "Couldn't save the template: {{reason}}", + "tools.templates.startFailed": "Couldn't start the template: {{reason}}", "tools.dictionary.description": "Dictation uses these words as recognition hints (up to 50).", "tools.dictionary.add": "Add word", "tools.dictionary.search": "Search words", diff --git a/packages/i18n/src/locales/ko.json b/packages/i18n/src/locales/ko.json index f477dd4..586a0a4 100644 --- a/packages/i18n/src/locales/ko.json +++ b/packages/i18n/src/locales/ko.json @@ -2539,6 +2539,8 @@ "tools.templates.deleted": "'{{name}}' 템플릿을 삭제했습니다.", "tools.templates.startItem": "{{name}} 시작", "tools.templates.removeField": "{{n}}번 필드 삭제", + "tools.templates.saveFailed": "템플릿을 저장하지 못했습니다: {{reason}}", + "tools.templates.startFailed": "템플릿을 시작하지 못했습니다: {{reason}}", "tools.dictionary.description": "받아쓰기가 이 단어들을 먼저 알아듣도록 인식 힌트로 씁니다(최대 50개).", "tools.dictionary.add": "단어 추가", "tools.dictionary.search": "단어 검색",