-
-
Notifications
You must be signed in to change notification settings - Fork 130
refactor(web): use tokenization analysis to maintain delayed reversion feature 🚂 #14880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(web): use tokenization analysis to maintain delayed reversion feature 🚂 #14880
Conversation
User Test ResultsTest specification and instructions
|
After changes added in #14880, one of our unit tests failed. After lots of investigation, it turns out that the `isSubstitutionAlignable` does not catch certain cases that `determineContextSlideTransform` does. The latter does need some improvement to work as a fix, but a small change lets it pick up the slack and replace the former. As it's also used during context-state transition, re-using the same method in both places gives us far more confidence that we won't have an error the second time around. Build-bot: skip build:web Test-bot: skip
c96a604 to
0cf7930
Compare
3541216 to
79abb65
Compare
79abb65 to
aa477a9
Compare
…/delayed-reversion-via-tokenization-analysis
…nstructor parameterization Build-bot: build Test-bot: test
18a0647 to
646fdc1
Compare
Test Specification
Here are the following results: Test Results
|
|
Isolating this:
On step 3, if the word suggestion manually applied via a tap, the reversion worked. Here are the test:
|
This works fine in standalone Web and in the Android app (under emulation) for me; can you confirm that this reproduces, @Meng-Heng?
Double-checked this and confirmed that my locally-built version has this PR's code in place. |
Prerequisites
|

In #14877, we kept the old
computeAlignmentpathway alive because it was necessary for determining the portion of the most recent keystroke's effects that should not be affected by applied suggestions. With #14880 in place, we can now replace the other scenarios previously reliant uponcomputeAlignment, allowing us to discontinue its use and rely fully on the new tokenization strategy.User Testing
Run all tests via Keyman for Android. Use the keyboard in-app.
TEST_PRED_CHAIN_APPLY: Apply numerous suggestions in sequence and verify that they apply properly.
TEST_PRED_TEXT_SUGGEST_ANDROID: Verify that predictive text produces appropriate suggestions and that they apply properly.
gff_amharic.TEST_CLEAR_CONTEXT: Verify that predictive text throws no errors when clearing the context / deleting all text.
TEST_PRED_LONG_TEXT_REVERSIONS: Verify that predictive text produces appropriate suggestions and that they apply properly.
Test with
sil_euro_latin.Type the following text, in full:
Tap the
breakfastsuggestion.Tap backspace.
Tap the reversion (
"breakf")Verify that the reversion is properly applied and that Android does not signal any errors (via toasts, notifications, or otherwise).
TEST_PERIOD_APPLY_OVERWRITE: Using the
sil_euro_latinkeyboard, check if punctuation typed immediately after applying a suggestion erases the whitespace.testitestingsuggestion.key.testing.is the result, with no appended whitespace.TEST_SPACE_APPLY_OVERWRITE: Using the
sil_euro_latinkeyboard, check if punctuation typed immediately after applying a suggestion erases the whitespace.testitestingsuggestionkey.testingis the result.TEST_PERIOD_APPLICATION: Using the
sil_euro_latinkeyboard, check if punctuation typed with a highlighted suggestion applies it and appears afterward.testiand verify that it is selected / highlighted. (If it isn't, delete its text and retype - tap accuracy may help.).key.testing.is the result, with no appended whitespace..again and verify that it outputs a new..TEST_SPACE_APPLICATION: Using the
sil_euro_latinkeyboard, check if punctuation typed with a highlighted suggestion applies it and appears afterward.testiand verify that it is selected / highlighted. (If it isn't, delete its text and retype - tap accuracy may help.)key.testingis the result, with no appended whitespace.and verify that it outputs a new.TEST_PERIOD_OVERWRITE_REVERSION: Using the
sil_euro_latinkeyboard, check if punctuation typed immediately after applying a suggestion erases the whitespace.testitestingsuggestion.key.testing.is the result, with no appended whitespace..and verify that a proper reversion is displayed:"testi"TEST_PERIOD_APPLICATION_REVERSION: Using the
sil_euro_latinkeyboard, check if punctuation typed immediately after applying a suggestion erases the whitespace.testiand verify that it is selected / highlighted. (If it isn't, delete its text and retype - tap accuracy may help.).key.testing.is the result, with no appended whitespace.., landing attesting, and verify that a proper reversion is displayed:"testi"TEST_PERIOD_APPLICATION_DELAYED_REVERSION: Using the
sil_euro_latinkeyboard, check if punctuation typed immediately after applying a suggestion erases the whitespace.testiand verify that it is selected / highlighted. (If it isn't, delete its text and retype - tap accuracy may help.).key.testing.is the result, with no appended whitespace..again and verify that it outputs a new...and verify that a proper reversion is displayed:"testi"TEST_MULTITAPS: Verify that the
.key onenglish_punct_rotarotates through the desired punctuation marks.Install the keyboard package found at https://jahorton.github.io/english_punct_rota.kmp.
It may be installed via the following QR link as well:
.key four times, rotating through.,,, and?, landing on!.Testing is important. (Include the space mark.)TEST_MULTITAP_OVERWRITE: Using a keyboard with a multitap punctuation rota key, check if punctuation typed immediately after applying a suggestion erases the whitespace, even on repeated taps.
Install the keyboard package found at https://jahorton.github.io/english_punct_rota.kmp.
It may be installed via the following QR link as well:
Type
testiManually apply the
testingsuggestion.Then tap the
.key four times, rotating through.,,, and?, landing on!.Verify that the results are
testing.,testing,,testing?, and the final result istesting!, with no appended whitespace.TEST_MULTITAP_APPLICATION: Using a keyboard with a multitap punctuation rota key, check if punctuation typed with a highlighted suggestion applies it and appears afterward, even on repeated taps.
Install the keyboard package found at https://jahorton.github.io/english_punct_rota.kmp.
It may be installed via the following QR link as well:
Type
testiand verify that it is selected / highlighted. (If it isn't, delete its text and retype - tap accuracy may help.)Then tap the
.key four times, rotating through.,,, and?, landing on!.Verify that the results are
testing.,testing,,testing?, and the final result istesting!, with no appended whitespace.TEST_SUGGESTIONS_ON_BKSP: Using Keyman for Android, verify that reasonable suggestions are displayed for text after using BKSP to reach the end of a previous word.
termTEST_DELAYED_ON_WORD: Using the
sil_euro_latinkeyboard, check if deleting characters up to the end of an applied suggestion's main body displays a reversion.trials.andsuggestion.testi, then tapspaceto automatically apply it. (Restart this test if it is not automatically highlighted somehow.)ab.abso that you end up immediately aftertesting."testi"reversion is displayed.trials and testi.TEST_DELAYED_ON_SPACE: Using the
sil_euro_latinkeyboard, check if deleting characters up to the end of an applied suggestion's main body displays a reversion.trials.andsuggestion.testi, then tapspaceto automatically apply it. (Restart this test if it is not automatically highlighted somehow.)ab.abso that you end up immediately after the whitespace aftertesting."testi"reversion is displayed.trials and testi.TEST_DOUBLE_DELAYED: Using the
sil_euro_latinkeyboard, check if two suggestions can be reverted in rapid succession.that.p, then apply thepointsuggestion.ofsuggestion, giving youthat point of.""suggestion is displayed.""suggestion and verify that the text becomesthat point."p"suggestion is displayed."p"suggestion and verify that the text becomesthat p.TEST_ROBUSTNESS: Spend at least 5 minutes trying to "break" predictive text and/or cause it to work improperly. Report back on any issues discovered.