This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
Only show tab previews if mouse is moving slow enough (#3271) #3300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
git rebase -i
to squash commits if needed.Just taking a stab at issue #3271 here: Don't show tab preview unless mouse velocity is low enough
Changes:
(1) the mouse is moving slower than a velocity threshold (in coordinates scaled by client tab dimensions so that this isn't tuned to particular screen resolution)
(2) the mouse hovers for longer than a new mouseover duration threshold (I'm on the fence, this may actually be unnecessary, velocity by itself seems fine)
N.B. This only checks if velocity is low enough, not whether it is decreasing, and does not look at if the mouse is headed "into the tab", but it seems to work pretty well, so I thought I'd let people judge the simpler approach first. It would be easy to check if velocity was decreasing, or whether mouse is headed towards middle of component, so let me know if you want that too.
New settings variables:
constants/settings.js
:tabs.tab-previews.mouse-velocity-threshold
constants/settings.js
:tabs.tab-previews.mouseover-duration-threshold-ms