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

change(web): locked flicks 🐵 #9957

Merged
merged 15 commits into from
Nov 21, 2023
Merged

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Nov 7, 2023

Per a recent team meeting to examine how flicks felt, etc, this PR reworks flicks from the form seen in #9909 and #9825 to something that will hopefully feel smoother and more intuitive. To wit:

locked-flicks

There may be a bit of fine-tuning to be done (that first reset attempt on the 'i' seems a bit odd), but the following criteria have been met:

  1. Flicks now "lock" into a specific direction.
    • Among other things, this allows us to make a nice, smoothed scrolling animation showing how close the user is to activating the flick.
  2. This "lock" can be "reset" with a return to the base position.
    • A different flick direction may then be chosen while in the 'reset' state.
    • This has been updated since the recording above; flick-resets are now much cleaner and more reliable.
  3. Attempting a flick in an unsupported direction, with no neighboring supported flick to serve as a reasonable alias, results in cancellation.
  4. There is a "fudge factor" around flicks, allowing their activation "reasonably near" to their correct angle.
    • This "fudge factor" also applies for locked-in flicks; the animation (and activation condition) thresholds are based on how much of the actual motion aligns with the locked-in direction.

There is a "fun" interaction between points 2 and 4 above:

locked-flick-reset-cancel

As the flick-reset occurs (due to vector projection) while quite far from the original, base position, and there is no flick available in the new direction, the flick quickly cancels upon reset. That said, if there were a flick available in the new direction (via temp-edit)...

jumpy-locked-flick-reset

It feels a little abrupt, but not too much so. It's probably "fine"... or at least, low-priority enough that further polish work is "safe" to triage until a later point in time.


Note: I've revised things since the screen capture above, but that was done alongside work on #9972 and is hard to fully display without that. I've gone ahead and rebased the changes originally within #9991 onto this branch and done a git merge -ff-only; its code changes were near-entirely within the same files already changed here, so the review process should be simpler as a result... even if the child PR (#9972) is needed to fully appreciate certain aspects.

As such...

@keymanapp-test-bot skip

User tests will be specified either on #9972 or on its followup #9973.

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Nov 7, 2023
@keymanapp-test-bot keymanapp-test-bot bot changed the title Change/web/locked flicks Change/web/locked flicks 🐵 Nov 7, 2023
@keymanapp-test-bot keymanapp-test-bot bot added this to the A17S25 milestone Nov 7, 2023
@jahorton jahorton changed the title Change/web/locked flicks 🐵 change(web): locked flicks 🐵 Nov 7, 2023
@mcdurdin mcdurdin modified the milestones: A17S25, A17S26 Nov 13, 2023
@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-missing User tests have not yet been defined for the PR label Nov 14, 2023
@jahorton
Copy link
Contributor Author

#9991's changeset has now been folded into this PR; it was a pretty easy rebase -> ff-only merge.

@jahorton jahorton marked this pull request as ready for review November 14, 2023 08:21
Base automatically changed from fix/web/gestures-and-longpress-defaults to feature-gestures November 14, 2023 08:26
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

web/src/engine/osk/src/input/gestures/specsForLayout.ts Outdated Show resolved Hide resolved
Comment on lines 1237 to 1240
this.gestureParams.longpress.flickDist = 0.25 * this.currentLayer.rowHeight;
this.gestureParams.flick.startDist = 0.1 * this.currentLayer.rowHeight;
this.gestureParams.flick.dirLockDist = 0.25 * this.currentLayer.rowHeight;
this.gestureParams.flick.triggerDist = 0.75 * this.currentLayer.rowHeight;
Copy link
Member

Choose a reason for hiding this comment

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

Should these multipliers be consts at the top of the file?

@jahorton jahorton merged commit 65795b8 into feature-gestures Nov 21, 2023
18 of 19 checks passed
@jahorton jahorton deleted the change/web/locked-flicks branch November 21, 2023 02:39
@jahorton jahorton mentioned this pull request Dec 12, 2023
1 task
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