Skip to content
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

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

jahorton
Copy link
Contributor

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

@jahorton jahorton added this to the A17S20 milestone Aug 30, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Aug 30, 2023

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcdurdin mcdurdin modified the milestones: A17S21, A17S22 Sep 15, 2023
@github-actions github-actions bot added web/ and removed web/ labels Sep 26, 2023
Copy link
Contributor Author

@jahorton jahorton left a 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.

Comment on lines +15 to +16
* 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,
Copy link
Contributor Author

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.

Base automatically changed from feat/web/gesture-selection to feature-gestures September 27, 2023 01:55
@jahorton jahorton merged commit 85bb8e8 into feature-gestures Sep 27, 2023
2 checks passed
@jahorton jahorton deleted the refactor/web/matcher-abstraction branch September 27, 2023 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants