Repository navigation
android: the keyboard keeps the text before the caret on reconnect - #1210
Merged
Merged
Conversation
Signed-off-by: fizzy pop-os-claude-1 <slot+pop-os-claude-1@fizzy.invalid>
|
TRIAGE @b9e8e60a auto: mechanical rules met (fizzy-* app author, names work#1181, 24 non-test lines <= 400, no risky path). Labelled |
Contributor
Where this PR standsStage: Done: approved What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):
Reviews at the current commit (
Updated 2026-11-11 17:15 UTC by the PM. This comment is edited in place. |
This branch was successfully deployed
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.
android: the keyboard keeps the text before the caret on reconnect
In plain words
On an Android phone, when fizzy changed a text box itself (cleared it, or you tapped to move the
caret), the keyboard started over as if the box were empty. Its suggestions and its backspace then
worked on the wrong text. Now the keyboard picks up from the text that is really before the caret.
What changes
keyboard library replaces it, instead of after, when it is already gone.
its press and its release.
What you will notice
Type
helloin a text box on an Android phone, tap after theo, and keep typing: the keyboard'ssuggestions and corrections continue from
helloinstead of from nothing. Nothing changes ondesktop or the web.
How we know it works
The cause is read from SDL's own source: its keyboard connection replaces the old one first thing,
so fizzy's code, which looked at the old one afterwards, always found an empty one. The app builds;
the Android package build (which compiles this Java) and the check on a real phone are run after
this page, by the maintainer and QA: with the trace on, the line after
reset("hello")must end in-> "hello…", and a backspace logssendKeyEvent(DEL down)andsendKeyEvent(DEL up).How this serves fizzy
Platform: typing on an
Android phone behaves like typing anywhere else.
Part of fizzyedit/work#1181
Closes fizzyedit/work#1137
Closes fizzyedit/work#1133
For agents: technical summary
Goal
SDL 3.4.16's
SDLDummyEdit.onCreateInputConnectionstarts withic = new SDLInputConnection(this, true);.FizzyEditcalled super first, soicwas always SDL's plain connection,beforewas null andthe new connection was seeded with
"".reset()seeded the old connection and thenrestartInputmade the keyboard ask again, landing here and dropping it.What changed and why
FizzyEdit.onCreateInputConnection: readbeforefromicbefore calling super; comment says why.FizzyInputConnection:logbecametracing()(static,Log.isLoggable(TAG, VERBOSE)) andtrace(call)(Log.v); each caller writesif (tracing()) trace(...), so no string is builtwith the trace off.
sendKeyEvent: the trace moved out of theACTION_DOWNbranch to just beforereturn true,logging
DEL down/DEL up. Edit logic unchanged;reset'sLog.iunchanged.Diff: 14 added, 10 deleted, one file.
How it was verified
scripts/zb build: passes. The apk gate (scripts/zb build apk -Dandroid-sdk=$ANDROID_HOME, theonly step that runs javac) was not run in the slot, per the job (no debug keystore); the PM/Ops
run it before approval. Phone trace (Spec 5) is QA after merge.
Not done / follow-ups
adb shell setprop log.tag.fizzy-ime VERBOSE).Part of fizzyedit/work#1181