diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b9200a..547f8cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Additional Whisper model management UI - Plugin system for custom pipelines +## [1.15.3] - 2026-10-31 + +> Published from an annotated tag. Installer and update metadata are served by the +> canonical Forgejo feed; no binaries are committed to this repository. + +### Fixed +- **`Ctrl + Alt + Enter` suggestion acceptance reliability (`@d3ro/core/keybinding-runtime`, `KeyBindingService`, `SuggestionService`, `bootstrap`).** + - Fixes `ChordStateMachine.keyUp` so releasing a shared modifier (`Ctrl` or `RightAlt`) releases all held chords in `_isDown` that depend on that modifier instead of stopping after the first match (`command` `Ctrl+RightAlt`), preventing `suggestion-accept` (`Ctrl+Alt+Enter`) from remaining stuck in `_isDown` and silently dropping subsequent presses as auto-repeat. + - Maps `UiohookKey.NumpadEnter` and numpad navigation keys in `UIOHOOK_TO_VK` and adds a 25 ms OS `globalShortcut` fallback trigger in `KeyBindingService._syncSuggestionCapture` so `Ctrl+Alt+Enter` still fires even if `uiohook` misses a key event. + - Keeps OS suggestion shortcut capture active while the `"생성 중..."` pending indicator or an accept is in flight (`isOverlayOrCaptureActive`), and when `Ctrl+Alt+Enter` is pressed while candidate #1 is still streaming (`_inFlight` / `_generating` / `_pending`), waits up to 2.5 s for candidate #1 to finish and immediately accepts it instead of ignoring the key press. +- **Duplicate typo-model check elimination (`TypoCorrectionService.propose`).** + - Skips re-running `_askModel` in `TypoCorrectionService.propose` when `handleTypingContext` has already verified the same region (`_isRegionChecked(region)`), preventing a redundant 336-token LLM call during suggestion candidate filling from evicting Ollama's suggestion KV cache. + ## [1.15.2] - 2026-10-31 > Published from an annotated tag. Installer and update metadata are served by the @@ -22,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixes `classifyKeyStroke` so modifier virtual keycodes (`0x10..0x12`, `0x5b..0x5c`, `0xa0..0xa5`) are classified as `'modifier'` before checking `modifiers.ctrl || modifiers.alt || modifiers.meta` (which `uiohook-napi` sets to `true` on the modifier keydown itself). Previously, pressing or holding `Ctrl` / `Alt` was misclassified as `'shortcut'` (`key=shortcut+C+A`), wiping out `TerminalKeystrokeTracker`'s active line buffer (`prefixLen=0`), clearing `_typedInCurrentFocus`, and triggering repeated UIA snapshots on every key-repeat tick. - Ignores standalone modifier keydowns and D3RO Voice's own `Ctrl+Alt` suggestion navigation/accept chords (`Ctrl+Alt+Up/Down/Left/Right/Enter/Space/Backspace`) in `InputTelemetryService._handleKeyDown` and `TerminalKeystrokeTracker.onKeyDown` without advancing `_inputRevision` / `_lastKeyAt` or resetting the tracked terminal line. - **Terminal suggestion acceptance without clipboard race (`SuggestionService._insertAccepted`).** - - Uses direct Unicode keyboard injection (`insertMethod = 'keyboard'` via `SendInput(KEYEVENTF_UNICODE)`) instead of clipboard `Ctrl+V` when accepting a suggestion in terminal mode (`terminalMode === true`, including `xterm-helper-textarea`, `WindowsTerminal`, and `Kitedesk`), preventing delayed terminal paste processing from pasting the restored previous clipboard content (such as copied URLs) and synchronizing `TerminalKeystrokeTracker` via `applyProgrammaticReplacement`. + - Uses direct Unicode keyboard injection (`insertMethod = 'keyboard'` via `SendInput(KEYEVENTF_UNICODE)`) instead of clipboard `Ctrl+V` when accepting a suggestion in terminal mode (`terminalMode === true` or `isTerminalApp(appName)`, including `xterm-helper-textarea`, `WindowsTerminal`, and `Kitedesk`), preventing delayed terminal paste processing from pasting the restored previous clipboard content (such as copied URLs) and synchronizing `TerminalKeystrokeTracker` via `applyProgrammaticReplacement`. - Stops the background candidate fill loop (`_fillRemainingCandidates`) immediately when `SuggestionService.accept()` is triggered so new candidates do not continue streaming while waiting for modifier release. - **UIA snapshot timer optimization (`InputTelemetryService._scheduleTextSnapshot`, `_readTextSnapshot`).** - Skips scheduling the 780 ms `_settleTimer` UIA snapshot on non-typing keys (`Enter`, `Arrow`, `Shortcut`, `Navigation`, `Function`, `Tab`) and automatically cancels any pending `_settleTimer` once the 380 ms `_textTimer` snapshot determines the field cannot trigger a suggestion (`prefixLen < minPrefixChars`, non-editable, or password), cutting redundant UIA bridge calls in half during everyday typing and navigation. diff --git a/apps/desktop/src/main/bootstrap.ts b/apps/desktop/src/main/bootstrap.ts index 0a4aa2a..717e722 100644 --- a/apps/desktop/src/main/bootstrap.ts +++ b/apps/desktop/src/main/bootstrap.ts @@ -284,7 +284,7 @@ async function initInputIntelligence(): Promise { // 제안 창이 떠 있는 동안만 제안 단축키를 OS 에서 잡는다 — Ctrl+Alt+Enter 가 앱에도 전달돼 // 개행이 들어가던 문제(2026-10-03). 창이 사라지면 바로 푼다. const syncSuggestionKeyCapture = (): void => - getKeyBindingService().setSuggestionCaptureActive(suggestion.isPresentationActive) + getKeyBindingService().setSuggestionCaptureActive(suggestion.isOverlayOrCaptureActive) suggestion.on('updated', (state) => { overlay.onUpdated(state) syncSuggestionKeyCapture() @@ -319,7 +319,7 @@ async function initInputIntelligence(): Promise { trackModifierKeys() uIOhook.on('keydown', (event: UiohookKeyboardEvent) => { if (uiohookCodeToVk(event.keycode) !== VK.Escape) return - const shouldDismiss = shouldDismissOnEscape(suggestion.isPresentationActive, { + const shouldDismiss = shouldDismissOnEscape(suggestion.isOverlayOrCaptureActive, { ctrl: event.ctrlKey === true, alt: event.altKey === true, shift: event.shiftKey === true, diff --git a/apps/desktop/src/main/services/KeyBindingService.ts b/apps/desktop/src/main/services/KeyBindingService.ts index 91acdbb..5ba9866 100644 --- a/apps/desktop/src/main/services/KeyBindingService.ts +++ b/apps/desktop/src/main/services/KeyBindingService.ts @@ -17,7 +17,11 @@ import { getLogger } from './LoggerService' import { acquireGlobalInputHook } from './global-input-hook' import { forgetHeldModifiers } from './modifier-state' import { configGet, loadKeyBindings, onConfigChanged } from './ConfigService' -import { acceleratorsToReserve, suggestionCaptureAccelerators } from './keybinding-accelerator-policy' +import { + acceleratorsToReserve, + bindingToAccelerator, + suggestionCaptureAccelerators +} from './keybinding-accelerator-policy' import type { ReservableBinding } from './keybinding-accelerator-policy' import { D3ROError, ErrorCode } from '@d3ro/core/errors' import { @@ -33,7 +37,12 @@ import type { ChordClock, ChordTriggerEvent } from '@d3ro/core/keybinding-runtime' -import type { KeyBinding, KeyBindingActionSpec, MouseButtonCode } from '@d3ro/core/types' +import type { + KeyBinding, + KeyBindingActionId, + KeyBindingActionSpec, + MouseButtonCode +} from '@d3ro/core/types' const logger = getLogger('KeyBindingService') @@ -205,9 +214,22 @@ const VK_TO_UIOHOOK: ReadonlyMap = new Map([ [VK.NumLock, UiohookKey.NumLock] ]) -const UIOHOOK_TO_VK: ReadonlyMap = new Map( - Array.from(VK_TO_UIOHOOK, ([vk, uiohookCode]) => [uiohookCode, vk] as const) -) +const UIOHOOK_TO_VK: ReadonlyMap = new Map([ + ...Array.from(VK_TO_UIOHOOK, ([vk, uiohookCode]) => [uiohookCode, vk] as const), + // 넘패드 확장 키(NumpadEnter / Numpad 방향키)는 Windows VK 에 별도 코드가 없어 + // 일반 Enter / 방향키 VK 로 합류시킨다 — 넘패드 Enter 로도 Ctrl+Alt+Enter 수락이 동작하도록 한다. + [UiohookKey.NumpadEnter, VK.Enter], + [UiohookKey.NumpadArrowLeft, VK.ArrowLeft], + [UiohookKey.NumpadArrowUp, VK.ArrowUp], + [UiohookKey.NumpadArrowRight, VK.ArrowRight], + [UiohookKey.NumpadArrowDown, VK.ArrowDown], + [UiohookKey.NumpadHome, VK.Home], + [UiohookKey.NumpadEnd, VK.End], + [UiohookKey.NumpadPageUp, VK.PageUp], + [UiohookKey.NumpadPageDown, VK.PageDown], + [UiohookKey.NumpadInsert, VK.Insert], + [UiohookKey.NumpadDelete, VK.Delete] +]) /** * uiohook 이트 키코드 → Windows VK (정본 좌표계). @@ -263,7 +285,12 @@ class KeyBindingService extends EventEmitter { /** press / release · 더블프레스 · AltGr 보류 판정 (순수 정책, core) */ private readonly _machine = new ChordStateMachine({ clock: systemClock, - onTrigger: (event) => this.emit('triggered', event), + onTrigger: (event) => { + if (event.type === 'pressed') { + this._lastPressedAt.set(event.actionId, Date.now()) + } + this.emit('triggered', event) + }, debug: (message) => logger.debug(message) }) @@ -279,6 +306,8 @@ class KeyBindingService extends EventEmitter { /** 제안 창이 떠 있는 동안만 잡는 제안 단축키 (키를 앱에 넘기지 않으려고) */ private _suggestionCaptureWanted = false private _capturedAccelerators: Set = new Set() + private _lastPressedAt: Map = new Map() + private _captureFallbackTimers: Set> = new Set() /** 상태 머신에 등록한 바인딩과 액션 — accelerator 예약 정책의 입력 */ private _reservable: ReservableBinding[] = [] @@ -509,7 +538,9 @@ class KeyBindingService extends EventEmitter { for (const accelerator of suggestionCaptureAccelerators(this._reservable, process.platform, this._ownedAccelerators)) { try { const ok = globalShortcut.register(accelerator, () => { - // noop — 동작은 uiohook 이 낸다. 등록 목적은 키를 앱에 넘기지 않는 것이다. + // 기본 경로는 uiohook 이나, 관리자 창(UIPI)·수정자 비동기 등으로 uiohook 이 놓쳤을 때 + // OS 핫키만 삼켜지고 동작이 안 나가는 일을 막기 위해 25ms 뒤 폴백 트리거를 보낸다. + this._scheduleCapturedSuggestionFallback(accelerator) }) if (ok) this._capturedAccelerators.add(accelerator) else logger.debug(`제안 단축키를 잡지 못함 (다른 곳에서 사용 중): ${accelerator}`) @@ -519,7 +550,37 @@ class KeyBindingService extends EventEmitter { } } + private _scheduleCapturedSuggestionFallback(accelerator: string): void { + const timer = setTimeout(() => { + this._captureFallbackTimers.delete(timer) + if (!this._suggestionCaptureWanted || !this._isRunning) return + const now = Date.now() + for (const { actionId, binding } of this._reservable) { + if (bindingToAccelerator(binding, process.platform) !== accelerator) continue + const lastPressed = this._lastPressedAt.get(actionId) ?? 0 + if (now - lastPressed <= 250) continue + this._lastPressedAt.set(actionId, now) + logger.info(`제안 단축키 OS 캡처 폴백 발동: ${actionId} (${accelerator})`) + this.emit('triggered', { + actionId, + type: 'pressed', + isDoublePress: false, + holdMode: false, + timestamp: now, + durationMs: 0, + binding: { ...binding } + }) + } + }, 25) + timer.unref?.() + this._captureFallbackTimers.add(timer) + } + private _releaseSuggestionCapture(): void { + for (const timer of this._captureFallbackTimers) { + clearTimeout(timer) + } + this._captureFallbackTimers.clear() for (const accelerator of this._capturedAccelerators) { try { globalShortcut.unregister(accelerator) diff --git a/apps/desktop/src/main/services/SuggestionService.ts b/apps/desktop/src/main/services/SuggestionService.ts index aa5c1e4..40a63a4 100644 --- a/apps/desktop/src/main/services/SuggestionService.ts +++ b/apps/desktop/src/main/services/SuggestionService.ts @@ -468,6 +468,11 @@ export class SuggestionService extends EventEmitter { return this.isVisible || this._generating || this._warmingUp || this._partialText.length > 0 } + /** 오버레이가 화면에 떠 있거나("생성 중" 보류·수락 대기 포함) 제안 단축키 캡처가 필요한 상태인가 */ + get isOverlayOrCaptureActive(): boolean { + return this.isPresentationActive || this._pending || this._acceptInFlight + } + get activeText(): string | null { return this._candidates[this._activeIndex]?.text ?? null } @@ -2116,6 +2121,26 @@ export class SuggestionService extends EventEmitter { if (index !== undefined && index >= 0 && index < this._candidates.length) { this._activeIndex = index } + if (!this._candidates[this._activeIndex] && (this._inFlight || this._generating || this._pending)) { + if (this._pending && !this._inFlight && this._lastContext) { + const config = this.readPolicyConfig() + const prefix = normalizeRequestPrefix(this._lastContext.prefix) + if (prefix.length > 0) { + this._clearPending(false) + void this._generate(prefix, this._lastContext, config.maxCandidates, config.maxChars) + } + } + logger.info('제안 수락 대기: 첫 후보 생성 중 — 완료 즉시 수락합니다') + this._acceptInFlight = true + try { + await this._waitForFirstCandidate(2500) + } finally { + this._acceptInFlight = false + } + if (index !== undefined && index >= 0 && index < this._candidates.length) { + this._activeIndex = index + } + } const candidate = this._candidates[this._activeIndex] if (!candidate) { // 창이 이미 닫힌 뒤의 클릭·단축키 — 조용히 끝나면 "골라도 안 들어간다" 의 원인이 안 보인다. @@ -2204,6 +2229,34 @@ export class SuggestionService extends EventEmitter { } } + private _waitForFirstCandidate(timeoutMs: number): Promise { + if (this._candidates.length > 0) return Promise.resolve(true) + if (!this._inFlight && !this._generating && !this._pending) return Promise.resolve(false) + return new Promise((resolve) => { + let settled = false + const finish = (ok: boolean): void => { + if (settled) return + settled = true + clearTimeout(timer) + this.off('updated', onUpdated) + this.off('cleared', onCleared) + resolve(ok) + } + const onUpdated = (): void => { + if (this._candidates.length > 0) { + finish(true) + } else if (!this._inFlight && !this._generating && !this._pending) { + finish(false) + } + } + const onCleared = (): void => finish(false) + const timer = setTimeout(() => finish(this._candidates.length > 0), timeoutMs) + timer.unref?.() + this.on('updated', onUpdated) + this.on('cleared', onCleared) + }) + } + /** 단어 단위 수락 뒤 남은 문장을 같은 자리에 다시 띄운다 — 세션 접두는 방금 넣은 글까지로 맞춘다. */ private _presentRemainder( prefixAfterInsert: string, @@ -2277,7 +2330,8 @@ export class SuggestionService extends EventEmitter { // 터미널(xterm-helper-textarea, Windows Terminal, Kitedesk 등)에서는 Ctrl+V 붙여넣기가 // 클립보드 복원 타이밍(250ms)과 경합해 이전 클립보드(URL 등)가 대신 붙여넣어지거나 ^V 가 입력될 수 있으므로 // 클립보드를 건드리지 않는 직접 유니코드 키보드 주입('keyboard')을 사용한다. - const insertMethod = method === 'keyboard' || terminalMode ? 'keyboard' : 'clipboard' + const isTerminal = terminalMode || isTerminalApp(appName) + const insertMethod = method === 'keyboard' || isTerminal ? 'keyboard' : 'clipboard' try { if (deleteCount > 0) { // 확정용 Space(+1)·백스페이스·붙여넣기(Ctrl, V) 키는 사용자 입력 통계에서 뺀다. @@ -2296,7 +2350,7 @@ export class SuggestionService extends EventEmitter { logger.warn(`제안 삽입 실패 (method=${result.method}, len=${result.textLength})`) return { ok: false, reason: 'generation-failed' } } - if (terminalMode) { + if (isTerminal) { this._learning.applyProgrammaticReplacement?.(deleteCount, text) } } catch (error) { diff --git a/apps/desktop/src/main/services/TypoCorrectionService.ts b/apps/desktop/src/main/services/TypoCorrectionService.ts index c396c78..6fb9a62 100644 --- a/apps/desktop/src/main/services/TypoCorrectionService.ts +++ b/apps/desktop/src/main/services/TypoCorrectionService.ts @@ -368,7 +368,12 @@ export class TypoCorrectionService extends EventEmitter { let fromModel: TypoCorrection[] = [] const model = configGet('typoAutoCorrectUseModel') !== false ? this._deps.warmModel() : null - const worthAsking = hasSuspiciousTypo(region) || (options.thorough === true && this._worthModelCheck(region)) + // handleTypingContext 의 자동 교정(_runModelCheck)이 이미 같은 구간을 모델로 검사해 + // 교정 사항 없음으로 확인했다면, 제안 채우기 중(_proposeLateCorrection) 같은 구간을 + // 다시 모델에 물어 Ollama KV 캐시를 밀어내지 않는다. + const worthAsking = + !this._isRegionChecked(region) && + (hasSuspiciousTypo(region) || (options.thorough === true && this._worthModelCheck(region))) if (model && worthAsking) { const abort = new AbortController() const forward = (): void => abort.abort() @@ -377,6 +382,9 @@ export class TypoCorrectionService extends EventEmitter { timer.unref?.() try { fromModel = await this._askModel(model, prefix, abort.signal, ignoredWords, vocabulary.known) + if (!abort.signal.aborted && fromModel.length === 0) { + this._markRegionChecked(region) + } } catch (error) { if (!abort.signal.aborted) { logger.debug(`제안용 오타 검사 실패: ${error instanceof Error ? error.message : String(error)}`) diff --git a/apps/desktop/tests/main/services/KeyBindingService.test.ts b/apps/desktop/tests/main/services/KeyBindingService.test.ts index 130b4f2..773b0cf 100644 --- a/apps/desktop/tests/main/services/KeyBindingService.test.ts +++ b/apps/desktop/tests/main/services/KeyBindingService.test.ts @@ -507,5 +507,35 @@ describe('KeyBindingService', () => { expect.any(Function), ) }) + + it('triggers suggestion-accept for NumpadEnter and via OS capture fallback when uiohook misses the key', () => { + vi.useFakeTimers() + try { + const service = getKeyBindingService() + const triggered: KeyBindingTriggerPayload[] = [] + service.on('triggered', (payload) => triggered.push(payload)) + service.loadFromConfig() + service.start() + service.setSuggestionCaptureActive(true) + + // 1) NumpadEnter via uiohook + hook.keydown({ keycode: UiohookKey.NumpadEnter, ctrlKey: true, altKey: true }) + hook.keyup({ keycode: UiohookKey.NumpadEnter, ctrlKey: true, altKey: true }) + expect(triggered.filter((t) => t.actionId === 'suggestion-accept' && t.type === 'pressed')).toHaveLength(1) + + // 2) OS globalShortcut callback fires without a recent uiohook press (e.g. elevated window / UIPI) + vi.advanceTimersByTime(300) + const returnCall = vi + .mocked(globalShortcut.register) + .mock.calls.find(([accelerator]) => accelerator === 'Control+Alt+Return') + const callback = returnCall?.[1] as (() => void) | undefined + expect(callback).toBeDefined() + callback?.() + vi.advanceTimersByTime(30) + expect(triggered.filter((t) => t.actionId === 'suggestion-accept' && t.type === 'pressed')).toHaveLength(2) + } finally { + vi.useRealTimers() + } + }) }) }) diff --git a/apps/desktop/tests/main/services/suggestion-accept-hold.test.ts b/apps/desktop/tests/main/services/suggestion-accept-hold.test.ts index 2d2b0aa..3684a74 100644 --- a/apps/desktop/tests/main/services/suggestion-accept-hold.test.ts +++ b/apps/desktop/tests/main/services/suggestion-accept-hold.test.ts @@ -169,4 +169,32 @@ describe('단축키 수락 — 손을 뗄 때까지 창을 띄워 두고 기다 await first expect(harness.insertText).toHaveBeenCalledTimes(1) }) + + it('첫 후보가 스트리밍 중일 때 Ctrl+Alt+Enter 를 누르면 첫 후보가 완성되는 즉시 수락한다', async () => { + let finishStream: () => void = () => undefined + harness.streamGenerate.mockImplementation(async function* () { + yield ' 내일' + await new Promise((resolve) => { + finishStream = resolve + }) + yield ' 다시 볼게.' + }) + + const service = create() + const context = typingContext() + ;(service as unknown as Internal)._lastContext = context + const genPromise = (service as unknown as Internal)._generate(PREFIX, context, 1, 160) + + await vi.waitFor(() => expect(service.getState().partialText).toBe('내일')) + expect(service.getState().candidates).toHaveLength(0) + + const acceptPromise = service.accept() + finishStream() + await genPromise + + const result = await acceptPromise + expect(result.ok).toBe(true) + expect(harness.insertText).toHaveBeenCalledTimes(1) + expect(harness.insertText.mock.calls[0]?.[0]).toContain('내일 다시 볼게.') + }) }) diff --git a/apps/mobile-rn/metadata/android/en-US/changelogs/1150300.txt b/apps/mobile-rn/metadata/android/en-US/changelogs/1150300.txt new file mode 100644 index 0000000..a6c5788 --- /dev/null +++ b/apps/mobile-rn/metadata/android/en-US/changelogs/1150300.txt @@ -0,0 +1 @@ +Stability and performance improvements. diff --git a/apps/mobile-rn/metadata/android/ko-KR/changelogs/1150300.txt b/apps/mobile-rn/metadata/android/ko-KR/changelogs/1150300.txt new file mode 100644 index 0000000..183fbc1 --- /dev/null +++ b/apps/mobile-rn/metadata/android/ko-KR/changelogs/1150300.txt @@ -0,0 +1 @@ +안정성과 성능을 개선했습니다. diff --git a/docs/map/00-index.md b/docs/map/00-index.md index 0f786a9..28be13e 100644 --- a/docs/map/00-index.md +++ b/docs/map/00-index.md @@ -2,7 +2,7 @@ > Status: ACTIVE > Last full audit: 2026-09-13 -> Last update: 2026-10-31 — **v1.15.1 릴리스 + 터미널·xterm.js 환경 한글 1글자씩 씹힘 근본 해결(`INPUT-04`, `INPUT-19`, `GAP-INPUT-08`, `GAP-INPUT-11`).** 터미널(`Agent Switchboard.exe` `xterm-helper-textarea`, `WindowsTerminal.exe`, `Kitedesk.exe`, `pwsh.exe`, `cmd.exe` 등)에서 한글 연속 타이핑 시 글자가 한 글자씩 씹히던 4가지 원인을 전수 제거했다: (1) `InputTelemetryService._handleKeyDown`에서 터미널 표면일 때 매 키다운마다 호출하던 크로스-프로세스 `isForegroundKoreanIme`(`SendMessageTimeoutW(WM_IME_CONTROL)`)가 Windows TSF/DefIME 조합 상태를 흔들던 문제를 제거하고 유휴 스냅샷 시점 1회 동기화(`TerminalKeystrokeTracker.syncKoreanIme`)로 전환, (2) `sidecar/uia_bridge.py`에서 `xterm-helper-textarea` 조회 시 Chromium 렌더러 메인 스레드를 최대 1,500ms 블로킹하고 `comp=True` 고착을 유발하던 `GetTopLevelControl()`·`TextPattern.GetSelection()`·`ExpandToEnclosingUnit(Character)`·`TextEditPattern.GetActiveComposition()` 호출을 건너뛰는 고속 경로 추가 및 `_WAKE_TTL_SECONDS` 60s→86,400s 연장, (3) 일반 한글 단어(`"근데 "`, `"터미널 "` 등) 입력 중 공백 직후 40ms 경계 스냅샷·680ms 중복 타이머·800ms 타이핑 중 폴링 억제(`_shouldRunFastTerminalBoundarySnapshot`, `_sampleWhileTyping`), (4) `TypoCorrectionService`에서 터미널의 공백 전 완성형 한글 음절(`[가-힣]$`)에 대해 `commitComposition`(`VK_SPACE`+`VK_BACK`) 주입을 원천 차단. 직전 같은 날 `v1.15.0`: `CommandsPage.tsx` 다단계 명령 파이프라인 복수 선택·순서 조정 UI 및 단일 패스 합성 실행(`AI-05`, `AI-07`). +> Last update: 2026-10-31 — **v1.15.2 릴리스 + `Ctrl+Alt+Enter` 제안 수락 불발 근본 해결 + 터미널·xterm.js 한글 씹힘 및 UIA·LLM 캐시 최적화(`INPUT-04`, `INPUT-06`, `INPUT-19`, `GAP-INPUT-08`, `GAP-INPUT-11`).** (1) **`Ctrl+Alt+Enter` 제안 수락 근본 해결:** ① `classifyKeyStroke`가 수정자 VK(`0x10..0x12`, `0x5b..0x5c`, `0xa0..0xa5`)보다 수정자 플래그를 먼저 검사해 `Ctrl`/`Alt`를 누르는 순간 `'shortcut'`(`key=shortcut+C+A`)으로 분류되어 `TerminalKeystrokeTracker` 버퍼가 `prefixLen=0`으로 초기화되고 `Enter`를 누르기 전에 제안 창이 닫히던 버그 수정, ② `ChordStateMachine.keyUp`에서 `Ctrl` 또는 `RightAlt`를 먼저 놓았을 때 `command`(`Ctrl+RightAlt`)만 해제하고 `break`/`return`으로 빠져나가 `suggestion-accept`(`Ctrl+Alt+Enter`)가 `_isDown`에 영구 고착되어 이후 입력이 auto-repeat으로 무시되던 버그 수정, ③ `KeyBindingService`에 `UiohookKey.NumpadEnter` 매핑 및 OS `globalShortcut` 캡처 25ms 폴백 트리거 추가, ④ `"생성 중..."` 또는 첫 후보 스트리밍 중 `Ctrl+Alt+Enter`를 누르면 무시하지 않고 첫 후보 완성(최대 2.5s) 즉시 수락(`_waitForFirstCandidate`)하도록 개선, ⑤ 터미널(`terminalMode` / `isTerminalApp`) 수락 시 클립보드 `Ctrl+V` 경합 대신 `KEYEVENTF_UNICODE` 직접 주입 및 백그라운드 채우기 루프 즉시 중단. (2) **UIA·Ollama 최적화:** 비타이핑 키 및 짧은 입력에서 780ms 중복 `_settleTimer` 스냅샷을 취소하고, `TypoCorrectionService.propose`가 이미 검사 완료된 구간(`_isRegionChecked`)에 대해 336토큰 오타 LLM 호출을 중복 실행해 제안 KV 캐시를 밀어내던 문제를 제거했다. (3) 직전 `v1.15.1`: 터미널 `WM_IME_CONTROL` 키다운 호출 제거 및 `uia_bridge.py` `xterm-helper-textarea` 고속 경로 적용. > > Previous update: 2026-10-30 — **백로그 26건 일괄 해소 (`GAP-INPUT-03`, `GAP-LLM-01`, `GAP-UX-01/02/03/05/06/07`, `GAP-I18N-01`, `GAP-REL-11/14/15`, `GAP-INFRA-01/02/04/06`, `GAP-OPS-01`, `GAP-QA-02`, `GAP-KEY-01/03`, `GAP-ADS-02`, `GAP-ID-01/02`, `GAP-TEAM-02`, `GAP-SHELL-01`, `GAP-PUSH-03`, `GAP-MTG-01`, `DOC-01`) + 입력 누락 검증 인프라 및 서비스 결함 재현(`INPUT-04/19`, `INFRA-20`, `GAP-INPUT-11`).** (1) **백로그 26건 해소:** CJK 무공백 어절 집계(`countWords`), 12개 번역 대상 언어 설정(`targetLanguage`), 12개 로케일 2,716개 키 100% 동기화(`sync-i18n-locales.mjs`), 데스크톱 strict 타입체크 0 에러(`tsconfig.node.json` + `tsconfig.web.json`), Forgejo 릴리스 태그 푸시 순서·SHA 고정(`GAP-REL-14`), 포터블 워크플로 매니페스트 검증(`GAP-REL-11`), 네이티브 ABI 스위처(`rebuild:app`/`rebuild:test`), Supabase 마이그레이션 정합성 검사기(`check:migrations`), NAS 배포 런북(`nas-deploy-runbook.md`), 오프라인 격리 테스트 하네스(`GAP-QA-02`), `KeyBindingService` 단위 테스트·`command` 전용 액션 핸들러, 데스크톱 광고 보상 쿼터 연동(`grantRewardQuota`), 회의 종료 후 메모 추가·노트패드 동기화, 이력 SQLite 커서 페이지네이션·인라인 편집·전체 내보내기, 회의 요약 `[MM:SS]` 타임스탬프 인용·클릭 시크 연동(데스크톱·웹·모바일), `resolveEntitlement` 정본 통일, 통합 검색(`UnifiedSearchService`) 취소·세그먼트 검색·페이로드 경량화, 웹 팀 초대 수락(`/app/accept-invite`), 관리자 고객지원 콘솔(`/support`), Web Push 서비스워커(`sw.js`)·iOS APNs 토큰 등록을 완료했다. (2) **입력 누락 검증 인프라(`GAP-INPUT-11`):** `typing-race-proof.mjs`가 체크아웃을 바꾸지 않고 3개 서비스만 HEAD `f49acf0`와 수정본으로 바꿔 같은 현재 의존성·시험에서 비교했다: HEAD 1/17, 수정본 17/17. 3개 문자열 손상 사례와 13개 스냅샷·메타데이터·조회 병합 계약 실패를 구분했고, 정상 교정 대조군은 양쪽 모두 통과했다. `typing-fixture`(scan-code·IME·CPU 부하)와 `typing-runtime`(별도 로컬 프로필·실제 제품 번들)을 준비했으며, 실제 GUI·IME·CPU·모델 cold/warm 시험은 아직 미실행이다. 증거: `test-results/typing-load/race-proof-2026-10-30T00-50-32-284Z/report.json`; 실행 명령은 `02` §3, 검증 경계는 `04` §6과 `11` GAP-INPUT-11. > diff --git a/docs/map/04-desktop-app.md b/docs/map/04-desktop-app.md index cb1627a..64ca9ca 100644 --- a/docs/map/04-desktop-app.md +++ b/docs/map/04-desktop-app.md @@ -84,7 +84,7 @@ Singleton + `EventEmitter` pattern (`getXService()` accessors). | Service / file | Purpose | |---|---| | `InputTelemetryService` | Global input telemetry and context observer: keystroke/click/scroll counters, mouse travel (Manhattan sum of per-axis deltas), active time, per-hour-per-app buckets flushed every 5 s; typed-text learning via UIA snapshot diffs. **Since 2026-10-26**, the UIA context observer runs by default whenever `typoAutoCorrectEnabled !== false` (or `suggestionEnabled === true`), while SQLite `input_activity` persistence only runs when `inputTelemetryEnabled === true` (opt-in). **Since 2026-10-27**, includes `TerminalKeystrokeTracker` (`@d3ro/core/input-intelligence`) + `isForegroundKoreanIme` (`utils/win32-foreground.ts`) to reconstruct the active terminal/Vim line (`reconcileWithScreen` for UIA screen buffers like Windows Terminal/pwsh/cmd, `reconcileWithXtermValue` for `xterm.js` `