fix(web): improve prediction whitespace-input, backspace-input edge case handling 🚂 - #16273
fix(web): improve prediction whitespace-input, backspace-input edge case handling 🚂#16273jahorton wants to merge 7 commits into
Conversation
User Test ResultsTest specification and instructions
Test Artifacts |
Test Specs
Test Results
|
This will help in cases where a user wishes to revert a suggestion after numerous other edits.
| import { RewindableCache } from "keyman/common/web-utils"; | ||
|
|
||
| const TRANSCRIPTION_BUFFER_SIZE = 10; | ||
| const TRANSCRIPTION_BUFFER_SIZE = 20; |
There was a problem hiding this comment.
The old user tests specs no longer pass as-is without this change - in part because English suggestions now apply two separate Transforms in sequence. This leads to a greater required rewind / backspace length within the main engine.
|
I believe that the latest commit should address two of the user tests: Test-bot: retest TEST_DELAYED_ON_WORD TEST_DELAYED_ON_SPACE |
Could you capture a video for this? I'm not clear on exactly what you're doing here, as that screenshot is for a very unexpected state. Also, are the failing tests failing on the first try, or only some of the time after retries? |
The two failed tests in this PR has been consistent for me. It failed on the first try, and keep failing on the retries. This is the video for applying the left-most Screen.Recording.2026-07-24.at.3.01.53.in.the.afternoon.movThis is the video for applying the second-left-most Screen.Recording.2026-07-24.at.3.10.27.in.the.afternoon.movPlease let me know where I went wrong with this. |
On the "left-most" case: note how the That does highlight the cause of the duplicate suggestion you reported, which is helpful - I hadn't thought to check for duplicated "keep" suggestions in such a scenario. Thanks for catching that! |
Test Result
Note Apply the auto |
|
Test-bot: retest TEST_PERIOD_OVERWRITE_REVERSION There's a chance the latest fixes may have also addressed the previously-detected user-test failure. |
…ep vs revert suggestions
Test Specs
Test Results
|
|
OK, that one's on me. Somehow thought it was a slightly different test. Pushing up a fix now that should address the remaining failing test, so... Test-bot: retest TEST_PERIOD_OVERWRITE_REVERSION |
Test Results
|

Fixes: #16271
Fixes: #16272
Build-bot: skip release:web,android,ios
User Testing
Perform all tests with the
sil_euro_latinkeyboard and an English-language lexical model active within this PR's artifact for Keyman for Android.TEST_SUGGESTIONS_ON_BKSP: Verify that reasonable suggestions are displayed for text after using BKSP to reach the end of a previous word.
TEST_PERIOD_OVERWRITE_REVERSION: Check if punctuation typed immediately after applying a suggestion erases the whitespace.
sil_euro_latin: Typesearchi.gff_amharic: Typeውስጥል. (Positionally, QWERTYxskl.)sil_euro_latin:.will do nicely.gff_amharic: the base-layer!key will work nicely.searchiorጽሕdepending on the test's keyboard.)TEST_PERIOD_APPLICATION_DELAYED_REVERSION: Check if punctuation typed immediately after applying a suggestion erases the whitespace.
sil_euro_latin: Typesearchi.gff_amharic: Typeውስጥል. (Positionally, QWERTYxskl.)sil_euro_latin:.will do nicely.gff_amharic: the base-layer!key will work nicely.TEST_DELAYED_ON_WORD: Check if deleting characters up to the end of an applied suggestion's main body displays a reversion.
sil_euro_latin: Typesearchi.gff_amharic: Typeውስጥል. (Positionally, QWERTYxskl.)TEST_DELAYED_ON_SPACE: Check if deleting characters up to the end of an applied suggestion's main body displays a reversion.
sil_euro_latin: Typesearchi.gff_amharic: Typeውስጥል. (Positionally, QWERTYxskl.)TEST_REVERT_MATCHING_KEEP: Check if applied 'keep' suggestions display both a 'revert' and 'keep' in reversion-triggering contexts.
sil_euro_latin: Typesearchi.gff_amharic: Typeውስጥል. (Positionally, QWERTYxskl.)"searchi"is displayed - not two.