fix: Dictation text not inserted into the active app#175
Open
UmairSharif wants to merge 1 commit intoaltic-dev:mainfrom
Open
fix: Dictation text not inserted into the active app#175UmairSharif wants to merge 1 commit intoaltic-dev:mainfrom
UmairSharif wants to merge 1 commit intoaltic-dev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes silent text insertion failure when concluding a dictation session. Transcribed text appeared correctly in the overlay but was never inserted into the active application.
The root cause was in
TypingService.insertTextBulkInstant— it sent text viaCGEvent.keyboardSetUnicodeStringposted to the target PID, which silently fails forElectron-based apps (VS Code, Slack, Notion) and web text fields (Chrome, Safari) because
these apps do not route raw unicode CGEvents through their text input pipeline. The function
always returned
trueregardless of delivery success, so all fallback methods (AccessibilityAPI, clipboard paste) were never reached — text was silently dropped.
Fix adds
insertTextViaClipboardToPidwhich posts aCmd+Vkey event directly to the targetprocess PID via
postToPid. This is universally handled across all app types. The previousunicode key-event method is kept as a secondary fallback. Clipboard contents are saved before
and restored after insertion.
Type of Change
Related Issues
Closes #174
Testing
brew install swiftlint && swiftlint --strict --config .swiftlint.ymlbrew install swiftformat && swiftformat --config .swiftformat SourcesScreenshots / Video
Screen.Recording.2026-02-20.at.3.20.03.PM.mov