From 0c79af6b034f9c32a94a56d9d6e6845f8fdaf66d Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Sun, 5 Apr 2026 10:39:13 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=B8=EC=85=98=20=EC=99=84=EB=A3=8C=20?= =?UTF-8?q?=ED=9B=84=20=EC=A6=89=EC=8B=9C=20idle=20=EB=B3=B5=EA=B7=80=20(?= =?UTF-8?q?=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=82=BD=EC=9E=85=20=EB=B9=84?= =?UTF-8?q?=EB=8F=99=EA=B8=B0=20=EB=B6=84=EB=A6=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - _completeSession: hideRecordingTip + IDLE 복귀를 먼저 실행 - 텍스트 삽입은 세션과 무관하게 비동기 (다음 핫키 즉시 사용 가능) - 삽입 await 중 다음 press가 세션을 꼬이게 하는 버그 수정 --- src/main/services/VoiceModeService.ts | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/main/services/VoiceModeService.ts b/src/main/services/VoiceModeService.ts index 47e6f54..781ff3e 100644 --- a/src/main/services/VoiceModeService.ts +++ b/src/main/services/VoiceModeService.ts @@ -476,36 +476,27 @@ class VoiceModeService extends EventEmitter { private async _completeSession(finalText: string): Promise { if (!this._session) return - this._setRecognitionState(RecognitionState.COMPLETED) - this._setAudioState(AudioState.STOPPED) - const session = { ...this._session } logger.info(`Session completed: "${finalText.substring(0, 50)}${finalText.length > 50 ? '...' : ''}"`) - // Speakly 패턴: RecordingTip 숨김 + // Speakly 패턴: 먼저 RecordingTip 숨기고 IDLE 복귀 (다음 핫키 즉시 사용 가능) hideRecordingTip() + this._setRecognitionState(RecognitionState.COMPLETED) + this._setAudioState(AudioState.STOPPED) + this.emit('session-completed', { session, finalText }) + this._resetToIdle() - // 텍스트 삽입 (autoInsert 설정 확인) - let insertSuccess = false + // 텍스트 삽입은 세션과 무관하게 비동기 실행 (세션 블로킹 방지) if (configGet('autoInsert') && finalText.length > 0) { try { const insertMethod = configGet('insertMethod') await getTextInsertService().insertText(finalText, insertMethod) - insertSuccess = true } catch (error) { logger.warn(`Text insert failed: ${error instanceof Error ? error.message : String(error)}`) + // 삽입 실패 시 ResultPopup에 텍스트 표시 + showResultPopup(finalText, 10000) } } - - // Speakly 패턴: 삽입 실패 시 ResultPopup에 텍스트 표시 - if (!insertSuccess && finalText.length > 0) { - showResultPopup(finalText, 10000) - } - - this.emit('session-completed', { session, finalText }) - - // IDLE로 복귀 - this._resetToIdle() } private _cancelSession(reason: 'user' | 'timeout' | 'too-short'): void {