-
-
Notifications
You must be signed in to change notification settings - Fork 112
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): gesture-selection 🐵 #9407
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
653238a
to
cd086b3
Compare
cd086b3
to
b6d5a0c
Compare
4bc38c5
to
dcaef3d
Compare
dcaef3d
to
ecffcb3
Compare
6869733
to
a0acb08
Compare
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.
LGTM I guess? It's pretty abstract at this point so hard to know really what it's all doing without the entire model of it in my mind. So I've just looked at the code, lots of comments which is good, nothing obviously messy.
I don't know how this will perform?
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'm not sure why this is needed for this module when none of our other mocha-based unit tests need it?
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.
Until now, I've generally been running the mocha tests from the command-line and placing breakpoints when debugging is necessary. I've actually avoided setting up any launch.json
configurations within VS Code until now. Breakpoints from main-project code seem to activate more consistently during TS-spec'd tests for me when I launch them through a launch.json
configuration than when I run them via console. I'd been having trouble with that when validating recent code changes... since I started writing tests for these newer parts of the gesture engine in TS rather than plain JS.
This file exists to facilitate launch.json
debugging configurations, ensuring that it refers to the "correct" tsconfig.json file when using ts-node. As gesture-recognizer needs to target ES5, but its tests don't, things go funky during TS-test loading should the ES5 config (the one in the project's root folder, thus most likely to be treated as "default") be picked.
|
||
// Ensure that any essentially-synchronous resolving GestureMatchers resolve in order of | ||
// their specified `resolutionPriority`, with larger values first. | ||
await this.promisePrioritizer.queueWithPriority(matcher.model.resolutionPriority); |
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.
Huh. Revisited this after noting the main comment of #9453 (review):
I don't really understand the big picture gestures use case as the mechanical unit test of correctness doesn't really explain why the gestures design would need such a thing.
I did have a vacation since then, so I figured the refresher might help. Turns out... the unit tests actually pass now with this disabled!
I think I see what happened now:
keyman/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/matcherSelector.ts
Lines 138 to 146 in d03cd7f
/* | |
* Easiest way to ensure resolution priorities are respected: keep 'em sorted in descending order. | |
* When we iterate through on update-steps, we go sequentially; the first Promise to be marked | |
* 'resolved' wins. | |
*/ | |
this.potentialMatchers.sort((a, b) => b.model.resolutionPriority - a.model.resolutionPriority); | |
// Now that all GestureMatchers are built, reset ALL of our sync-update-check hooks. | |
this.resetSourceHooks(); |
I'd been having some serious issues getting certain multitap scenarios to work correctly, largely due to the timing by which source-subview updates were being processed and how that related to the processsing of path-termination.
Lines 145-146 above were part of the last additions to this PR - additions that fixed some "fun" underlying problems with update timings. Ensuring that updates were processed in the correct order probably fixed the same issues that were previously undermining resolutionPriority ordering - for some gesture types, path updates can trigger resolution of their corresponding gesture matcher, after all.
So... we might actually able able to straight-up drop the Promise prioritizer thing after all. At least it did help lead me to the true underlying cause for the issues I'd been using it to address.
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.
And now... fully dropped.
…' into feat/web/gesture-selection
The new
MatcherSelector
class facilitates proper update synchronization among allGestureMatcher
s that share one or more commonGestureSource
s and ensures that if more than one match completes successfully at the same time, the highest priority one wins and is selected as the "correct" gesture component model for this "stage" of the ongoing gesture.@keymanapp-test-bot skip