-
-
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
refactor(web): matched gesture-component abstraction 🐵 #9525
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
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
common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureMatcher.ts
Show resolved
Hide resolved
common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureMatcher.ts
Outdated
Show resolved
Hide resolved
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.
Meant to post this yesterday, but apparently never actually submitted it.
common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureMatcher.ts
Outdated
Show resolved
Hide resolved
* host apps when it was in an embedded state. While that pattern has been dropped, | ||
* the abstraction gained from reaching compatibility with it is useful. Either way, |
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.
In particular, I've found that the process resulted in much clearer field names and helped to clarify some of the connections among all the moving pieces.
Also, I'd based a lot of things off the abstraction before #9591 landed, it's pretty well integrated into the code that follows... and it's an interface, meaning it compiles completely out when converted to JS. No filesize contribution, save maybe due to change in the length of names of the fields.
This PR's primary changes seek to facilitate app/webview's delegated longpress behavior as used by our Android app.
While working on #9455, I noticed that a little abstraction would be needed in order to be compatible with such longpresses. In such cases, the "subkey menu" aspect of a longpress would not have any corresponding
GestureMatcher
instance... and up until now, I've written further implementation assuming that one would exist.Long story short, this led to the
PredecessorMatch
interface defined herein; it's reasonable to construct a version of this on behalf of a delegated longpress/subkey menu. Doing so allows us to treat the result of that delegation similarly to a gesture component recognized by the gesture-engine itself, mitigating the need for further code divergence in support of Android-app longpresses.While I was at it, I figured that one of the Matcher properties could use a better, clearer name... so I made that change.
Both sets of changes forced a bit of unit-test maintenance, but it was fortunately pretty small-scale - and it even makes one aspect of certain test-setups clearer, which was a nice bonus.
@keymanapp-test-bot skip