Fix clipboard paste and Windows native typing failures #17

Merged
kleb merged 2 commits from fix/windows-typing-recovery into main 2026-10-29 08:44:48 +01:00
Owner

Typing could fail before pasting when Electron returned an empty clipboard entry. Windows native insertion also stopped streaming when the focused control did not expose ValuePattern.

Empty entries now stay empty instead of constructing an invalid ClipboardItem, while all nonempty representations are resolved before replacing the clipboard. Windows probes ValuePattern without throwing and falls back only on an explicit unsupported-pattern result before any native write. Other failures are never replayed.

Actual Windows testing also caught PowerShell SendKeys turning a literal caret into an ampersand on a German keyboard. Windows direct typing and the native fallback now send Unicode through the existing serialized background worker, without using the clipboard. Native batches are bounded and blocked or partial injection is reported rather than retried. Clipboard paste keeps its existing proven key sequence.

Short Parakeet phrases still abstain from language identification below three seconds, without an expected warning for every phrase. Transcription text and honest unknown-language metadata are unchanged.

Proven with 210 passing tests, bun run check, bun run lint:eslint, bun run build, and 19 real Windows 10/Electron 45.1.0 cases on the final head: empty/rich clipboard restoration, supported WPF ValuePattern, unsupported WinForms fields, selection replacement, repeated streaming phrases, German and CJK text, literal punctuation, newlines, surrogate pairs across a native batch boundary, and read-only native failures without fallback. The native harness executes the production typing modules and worker with real OS APIs; it does not rerun ASR or recording. Target applications can still reject synthetic input, particularly across integrity levels. macOS behavior was not changed or rerun. The disposable VM and test processes were removed.

Windows baseline, final results, executed hashes and reproduction harness: windows-typing-runtime-evidence.tar.gz

Additional real Electron Linux clipboard proof: clipboard-electron45.json

Typing could fail before pasting when Electron returned an empty clipboard entry. Windows native insertion also stopped streaming when the focused control did not expose ValuePattern. Empty entries now stay empty instead of constructing an invalid ClipboardItem, while all nonempty representations are resolved before replacing the clipboard. Windows probes ValuePattern without throwing and falls back only on an explicit unsupported-pattern result before any native write. Other failures are never replayed. Actual Windows testing also caught PowerShell SendKeys turning a literal caret into an ampersand on a German keyboard. Windows direct typing and the native fallback now send Unicode through the existing serialized background worker, without using the clipboard. Native batches are bounded and blocked or partial injection is reported rather than retried. Clipboard paste keeps its existing proven key sequence. Short Parakeet phrases still abstain from language identification below three seconds, without an expected warning for every phrase. Transcription text and honest unknown-language metadata are unchanged. Proven with 210 passing tests, bun run check, bun run lint:eslint, bun run build, and 19 real Windows 10/Electron 45.1.0 cases on the final head: empty/rich clipboard restoration, supported WPF ValuePattern, unsupported WinForms fields, selection replacement, repeated streaming phrases, German and CJK text, literal punctuation, newlines, surrogate pairs across a native batch boundary, and read-only native failures without fallback. The native harness executes the production typing modules and worker with real OS APIs; it does not rerun ASR or recording. Target applications can still reject synthetic input, particularly across integrity levels. macOS behavior was not changed or rerun. The disposable VM and test processes were removed. Windows baseline, final results, executed hashes and reproduction harness: [windows-typing-runtime-evidence.tar.gz](https://git.kleb.sh/attachments/f2423d06-328c-496c-bec4-9ecee110837b) Additional real Electron Linux clipboard proof: [clipboard-electron45.json](https://git.kleb.sh/attachments/ca4ce4fb-2917-4350-b6b7-11564d5cb274)
Collaborator

kReview review

Verdict: no findings

No verified defects were found in the reviewed changes.

kReview checked only the PR diff, metadata, and supplied repository context at 453b740f93. It reports only issues supported by this material.

Estimated cost: ~$0.07 total (123.3k in / 417 out); this run ~$0.04 (69.0k in / 210 out) / gpt-6.1-terra.

Run time: 0:29 total; this run 0:12.

<!-- codex-forgejo-review --> <!-- codex-forgejo-review-head:453b740f93ad4f7634dc40b30eda916b8f74758b --> <!-- codex-forgejo-review-comparison:v1:5b597003bf272d3b079ace6619ba051e66efe3411bc30cd6caabf365913aaa19 --> ## kReview review **Verdict:** no findings No verified defects were found in the reviewed changes. _kReview checked only the PR diff, metadata, and supplied repository context at `453b740f93`. It reports only issues supported by this material._ _Estimated cost: ~$0.07 total (123.3k in / 417 out); this run ~$0.04 (69.0k in / 210 out) / gpt-6.1-terra._ _Run time: 0:29 total; this run 0:12._ <!-- codex-forgejo-review-state:eyJoZWFkU2hhIjoiNDUzYjc0MGY5M2FkNGY3NjM0ZGM0MGIzMGVkYTkxNmI4Zjc0NzU4YiIsImNvbXBhcmlzb25LZXkiOiJ2MTo1YjU5NzAwM2JmMjcyZDNiMDc5YWNlNjYxOWJhMDUxZTY2ZWZlMzQxMWJjMzBjZDZjYWFiZjM2NTkxM2FhYTE5Iiwic3VtbWFyeSI6Ik5vIHZlcmlmaWVkIGRlZmVjdHMgd2VyZSBmb3VuZCBpbiB0aGUgcmV2aWV3ZWQgY2hhbmdlcy4iLCJmaW5kaW5ncyI6W10sImN1bXVsYXRpdmVDb3N0Ijp7InVzZCI6MC4wNjgyMjUwMDAwMDAwMDAwMSwiaW5wdXRUb2tlbnMiOjEyMzI5Miwib3V0cHV0VG9rZW5zIjo0MTcsIm1vZGVsIjoiZ3B0LTYuMS10ZXJyYSJ9LCJjdW11bGF0aXZlRHVyYXRpb25NcyI6MjkxOTZ9 -->
kleb merged commit 89ba9bc635 into main 2026-10-29 08:44:48 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kleb/VoiceTyper!17
No description provided.