Skip to content

fix(gesture): learn from a swiped word deleted and retyped (#946) - #954

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

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

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Fixes #946

Problem

Swipe corrections were learned only when another suggestion was picked from the strip. Deleting the swiped word with backspace and typing the right word taught nothing. With suggestions hidden, that is the only way to correct a swipe.

Change

  • When backspace removes a swiped word, the word and the swipe's other candidates are remembered.
  • The first word typed in the same place is recorded in GestureWordBias (the same store as picking a suggestion) if it was one of those candidates.
  • Without suggestion lookups (suggestions hidden and auto-correct off) letters are committed one by one, so the word is read from the text at the next separator or the next swipe.
  • Nothing is recorded when: the word was no candidate, the user deletes past the swipe, it is not the first word, incognito mode, the field disallows suggestions, or Personalized suggestions is off.
  • Picking a suggestion after a swipe now also respects Personalized suggestions (sibling fix).
  • Normal word learning is unchanged: it still stops while suggestions are hidden (upstream intent).

Side effects

Only GestureWordBias is affected: a relative score adjustment capped at 3% that fades over time, applied to swipe candidates only. It decides close calls and never changes typing.

Testing

  • InputLogicTest: 150 tests, 0 failures (11 new: candidate, next swipe commits, no candidate, deleting further, first word only, incognito/personalized off, suggestions hidden, and 4 for the no-lookup mode).
  • Waydroid, with suggestions hidden and auto-correct off: deleting a swiped "very" and typing "bet" was recorded; "dog" (no candidate) and deleting past the swipe were not; a fixed typo ("bew" + backspace + "t") was recorded; typing a word then swiping again recorded it. After the corrections, the same swipe path produced "bet" instead of "very".
  • Same scenarios with suggestions shown: recorded and not recorded as expected.

Swipe corrections were only learned when another suggestion was picked
from the strip. Deleting the swiped word with backspace and typing a
word in its place taught nothing, which is the only way to correct a
swipe with suggestions hidden.

Now the deleted swipe and its other candidates are remembered, and the
first word typed in the same place is recorded in GestureWordBias when
it was one of them. Without suggestion lookups (suggestions hidden and
auto-correct off) letters are committed one by one, so the word is read
from the text at the next separator or swipe. Deleting past the swipe,
a word that was no candidate, incognito mode, fields without
suggestions or Personalized suggestions off record nothing. Picking a
suggestion after a swipe now also respects Personalized suggestions.
@LeanBitLab
LeanBitLab merged commit e01a196 into main Nov 27, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the fix/swipe-retype-learning branch November 27, 2026 10:12
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.

[Bug]: Words are not learned properly when using glide typing.

1 participant