Repository navigation
Track keyboard field controllers to route dictation results correctly - #362
Closed
alexkroman wants to merge 1 commit into
Closed
alexkroman wants to merge 1 commit into
alexkroman wants to merge 1 commit into
Conversation
… keyboard process (#346) A DictationResult named only a keyboard process, so a new controller in the same process - the field the user tapped into while the words were still processing - would insert them. The result now carries the controllerID of the field that sent the accepted stop (else the press): the relay copies to the clipboard at once when the presence record names another controller, and a keyboard inserts only a result for its own controller (or none, from an older build). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1TTNwsgcqxJKiGZw4b
alexkroman
enabled auto-merge
November 24, 2026 22:50
alexkroman
disabled auto-merge
November 24, 2026 22:58
Collaborator
Author
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.
What & why
When a user dictates into a field and then taps into another field in the same keyboard app before the words arrive, they should go to the clipboard, not the new field. This change adds field-level tracking via
controllerIDthroughout the dictation pipeline so results are routed to the exact field that requested them, not just the keyboard process.Key changes:
KeyboardAddressstruct wraps a keyboard process and its controller (field) to identify the target preciselyDictationResultnow carriescontrollerIDto specify which field within a process should receive the wordsKeyboardCommandandCommandRouter.DecisionpropagatecontrollerIDfrom the keyboard through the routing layerDictationCoordinator.Presstracks both the pressing field's controller and the stop recipient's controller viaresultAddresscomputed propertyKeyboardModelrejects results meant for a different controller in the same processKeyboardRelayInjectorcompares both process and controller when deciding whether to insert or copy to clipboardThe change is backward-compatible:
controllerIDis optional, and older keyboard builds that don't send it are treated as "any controller in that process" (matching current behavior).How it was tested
scripts/check.shpasses (or CI will, if I'm not on a Mac)Test coverage:
relayToPressingField()verifies that words meant for one field don't insert when another field in the same keyboard is on screenreleaseAddressesField()confirms the stop command's controller is captured and routed with the resultendingNamesController()validates that accepted endings (release/cancel) name the field that sent themKeyboardModelProtocolTestsextended to verify results for another field are left in the store for the clipboard path