fix(desktop): prevent modifier key buffer resets, clipboard race on terminal accept, and redundant UIA settle snapshots

This commit is contained in:
Yun Chan 2026-10-31 04:19:53 +09:00
parent 6d909dd0e5
commit 41901c1ec5
10 changed files with 198 additions and 23 deletions

View file

@ -12,6 +12,21 @@ 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.2] - 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
- **Modifier key (`Ctrl` / `Alt` / `Shift` / `Win`) classification & terminal buffer preservation (`@d3ro/core/input-intelligence`, `@d3ro/core/terminal-prompt`, `InputTelemetryService`).**
- 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`.
- 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.
## [1.15.1] - 2026-10-31
> Published from an annotated tag. Installer and update metadata are served by the