-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat(web): add and enable auto-correction 📚 #11866
base: change/web/track-prediction-base-corrections
Are you sure you want to change the base?
feat(web): add and enable auto-correction 📚 #11866
Conversation
User Test ResultsTest specification and instructions
Test Artifacts
|
72c37f8
to
3632a12
Compare
3632a12
to
7779125
Compare
@@ -559,6 +568,53 @@ export default class ModelCompositor { | |||
return suggestions; | |||
} | |||
|
|||
private predictionAutoSelect(suggestionDistribution: CorrectionPredictionTuple[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential followup:
Note that this method does not actually reference anything in the class. We could make it static... or even better, we could make it a standalone method.
Why this point is significant: it's isolated in a manner great for unit testing. No need to mock inputs or anything! I haven't actually defined any unit tests for it yet, though.
... I'd be more proactive about unit testing this if the effects weren't already easy to see during actual KMW use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the unit test is probably a good idea for future maintenance.
Test Results
|
This establishes something I've been waiting a long time to enable: when one prediction is sufficiently more likely than all alternatives, it will be automatically selected for application when tapping the space bar. In short: auto-correct.
Current conditions for auto-correct:
These conditions may, of course, be further tweaked... but this seemed to be a reasonable initial set to use for testing.
One interaction that should probably be reviewed for correctness + user-friendliness: While the banner is receiving any mouse-based or touch-based interaction, the auto-selected suggestion will be deselected - even if just to scroll before releasing the banner. If it was a scrolling interaction, the original auto-selected suggestion will be reselected and rehighlighted. If a suggestion was applied, however, there will be no reselection or re-highlighting.
Notes for review:
This PR's changes utilize existing plumbing that was prepared all the way back with #1747 during 12.0-alpha. We prevented it from actually auto-applying anything at the time, but most of the design work was done back then.
#3702 was added a while back in order to swallow a single whitespace tap after applying a suggestion via banner UI. We wish to maintain that here. However, we don't swallow the whitespace after application if it was triggered by pressing the spacebar... because we'd have already tapped the spacebar once.
User Testing
TEST_LOOK_AND_FEEL: Using Keyman for Android, play around with predictive text and report back on how the interactions feel.
tempta
to be a good "prompt" input for this. Do try others, though.TEST_POST_APPLY_WHITESPACE: Using Keyman for Android...
TEST_POST_APPLY_BACKSPACE: Using Keyman for Android...