Fix Android autocomplete text replacement - #403
Merged
Merged
Conversation
Publish completed IME edits with their selection and composing region, then synchronize the Android buffer with GPUI draft and cursor changes. Preserve UTF-16 replacement ranges and reject stale edits after the app changes text. Add device regressions for autocomplete, Unicode deletion and retired input connections, plus editor selection and native synchronization coverage. Validation: workspace build/tests, Android target check, formatting, seven backend tests and three Android emulator tests passed. The editor regression fails with the previous selection hook. Existing unrelated Clippy warnings remain; a full-app keyboard check was blocked by emulator GPU initialization. (cherry picked from commit 5a5b713)
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.
Accepting an Android keyboard suggestion could leave the wrong word or duplicate text in the message box. An old keyboard update could also bring back a draft after it was cleared or sent.
The keyboard and Tcode now share the full text, cursor position, and word being edited. When a suggestion arrives as several edits, Tcode applies them together. Replacements account for emoji so they affect the intended text. Old keyboard updates cannot overwrite a newer draft.
The new tests cover accepting suggestions, replacing selected text, deleting text that includes emoji, and ignoring keyboard updates that arrive too late.
Implemented with GPT-6 Astra in Tcode
Tested manually on a real Android phone, it works great now