Skip to content

Fix Android autocomplete text replacement - #403

Merged
Tryanks merged 1 commit into
Tryanks:mainfrom
guivieiras:pr/mobile-autocomplete
Sep 11, 2026
Merged

Tryanks merged 1 commit into
Tryanks:mainfrom
guivieiras:pr/mobile-autocomplete

Conversation

@guivieiras

Copy link
Copy Markdown
Contributor

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

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)
@Tryanks
Tryanks merged commit 248329a into Tryanks:main Sep 11, 2026
6 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