Skip to content

fix(gesture): harden learning from a retyped swipe (#946) - #957

Merged
LeanBitLab merged 1 commit into
mainfrom
fix/swipe-learning-hardening
Nov 27, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
fix/swipe-learning-hardening

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Follow-up to #954, found in a review of today's changes.

Fixes

  • Crash (StringIndexOutOfBoundsException in stripWordSeparatorsFromEnd): suggestions hidden and auto-correct off, delete a swiped word, move the cursor right past a space, then type a separator or swipe. The word read back was empty. Empty words are now skipped.
  • A cursor move by the user now forgets the deleted swipe, so text the user never typed in its place cannot be learned as a correction.
  • Live text style: the swiped word is styled while suggestions are plain. The deleted word and, in the existing pick path, the replaced word are now compared as plain text, so retyping the same word is no longer a "correction".
  • Without suggestion lookups, Enter as an editor action (e.g. Send) also reads the retyped word.

Testing

  • New test moving the cursor after a deleted swipe learns nothing and does not crash fails on current main with the crash and passes with this change. InputLogicTest: 152 tests (with fix(settings): reload settings when the field's IME options change #958's test), 0 failures.
  • Waydroid: learning still records with suggestions shown and hidden (candidate, typo fixed while retyping, next swipe commits it), so the new cursor-move clear does not fire during normal typing.

Follow-ups from the review of the retyped swipe learning:
- An empty word (only a space between the deleted swipe and the
  cursor) crashed in stripWordSeparatorsFromEnd. It is now skipped.
- A cursor move by the user forgets the deleted swipe, so text after
  it that the user did not type is never read as the correction.
- With a live text style the swiped word is styled while suggestions
  are plain: both the deleted word and the word replaced by a picked
  suggestion are now compared as plain text.
- Without suggestion lookups, Enter as an editor action also reads the
  retyped word.
@LeanBitLab
LeanBitLab merged commit 12d74fd into main Nov 27, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/swipe-learning-hardening branch November 27, 2026 10:56
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.

1 participant