Skip to content

Paste dictation into the field focused at dictation start#32

Merged
execsumo merged 1 commit into
mainfrom
claude/dictation-paste-target-96p4vy
Jul 6, 2026
Merged

Paste dictation into the field focused at dictation start#32
execsumo merged 1 commit into
mainfrom
claude/dictation-paste-target-96p4vy

Conversation

@execsumo

@execsumo execsumo commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Previously the transcript was pasted (Cmd+V) into whatever app/field had
keyboard focus when transcription finished, so switching apps or clicking
elsewhere while speaking sent the text to the wrong place.

AppModel.toggleDictation now snapshots the focused AX element and its
owning app pid synchronously at trigger time; TextInjector.inject
re-activates that app, raises the element's window, and restores AX focus
(with a short settle delay) before sending the paste keystroke. Falls back
to the old paste-at-current-focus behavior when no target could be
captured, focus was on Heard itself, or the target app has quit.

onUtterance is now typed @mainactor since its handler reads main-actor
state.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01K5HoQZ6SHoLhyn3CGPtPsg

Previously the transcript was pasted (Cmd+V) into whatever app/field had
keyboard focus when transcription finished, so switching apps or clicking
elsewhere while speaking sent the text to the wrong place.

AppModel.toggleDictation now snapshots the focused AX element and its
owning app pid synchronously at trigger time; TextInjector.inject
re-activates that app, raises the element's window, and restores AX focus
(with a short settle delay) before sending the paste keystroke. Falls back
to the old paste-at-current-focus behavior when no target could be
captured, focus was on Heard itself, or the target app has quit.

onUtterance is now typed @mainactor since its handler reads main-actor
state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5HoQZ6SHoLhyn3CGPtPsg
@execsumo
execsumo merged commit 98dcdc8 into main Jul 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants