Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Don't show tab preview unless mouse velocity is low enough (and decelerating?) #3271

Closed
BrendanEich opened this issue Aug 20, 2016 · 6 comments · Fixed by #9887
Closed

Don't show tab preview unless mouse velocity is low enough (and decelerating?) #3271

BrendanEich opened this issue Aug 20, 2016 · 6 comments · Fixed by #9887

Comments

@BrendanEich
Copy link
Member

BrendanEich commented Aug 20, 2016

Test plan

See #9887

Original issue description

Did you search for similar issues before submitting this one?

Yes. Related issues: #3113 #3149. Fixing this may relieve pressure on those, or not, TBD.

Describe the issue you encountered:

Tab previews are generally liked but most users I've talked to, but it's an unscientific sample and some users dislike them because they trigger too easily and cause flicker and distraction when moving the mouse over the tab bar.

Expected behavior:

When moving quickly enough, especially when accelerating away from the tab bar, no preview.

  • Platform (Win7, 8, 10? macOS? Linux distro?):

All.

  • Brave Version:

0.11.5

@BrendanEich
Copy link
Member Author

Might want to treat v as vector and only preview if slow enough, decelerating, and aimed "into" tab by some simple criteria.

@lucidNTR
Copy link
Contributor

alternative to improve behaviour would be to add an initial wait time before previews are shown, after the initial preview was shown hovering over different tabs does not have a wait time so you can find the desired tab faster. vivaldi (and probably opera) have a nice behaviour for this

lucidNTR pushed a commit to lucidNTR/browser-laptop that referenced this issue Sep 30, 2016
- fixes brave#3271: Dont show tab preview unless mouse velocity is low enough
- tab preview requires that either:
  mouse be moving slower than a velocity threshold relative to tab size (so should be relative to resolution)
  mouse hover for longer than a new mouseover duration threshold (this may be unnecessary, velocity seems fine)
- 50% higher mouse velocity is tolerated if user is in "preview mode" (moving mouse from one tab to another, see issue brave#1434)
  to avoid flashing out when mousing from one tab preview to another
- velocity threshold is set in `constants/settings.js`: `tabs.tab-previews.mouse-velocity-threshold`
- mouseover duration threshold is set in `constants/settings.js`: `tabs.tab-previews.mouseover-duration-threshold-ms`
lucidNTR pushed a commit to lucidNTR/browser-laptop that referenced this issue Sep 30, 2016
- fixes brave#3271: Dont show tab preview unless mouse velocity is low enough
- tab preview requires that either:
  mouse be moving slower than a velocity threshold relative to tab size (so should be relative to resolution)
  mouse hover for longer than a new mouseover duration threshold (this may be unnecessary, velocity seems fine)
- 50% higher mouse velocity is tolerated if user is in "preview mode" (moving mouse from one tab to another, see issue brave#1434)
  to avoid flashing out when mousing from one tab preview to another
- velocity threshold is set in `constants/settings.js`: `tabs.tab-previews.mouse-velocity-threshold`
- mouseover duration threshold is set in `constants/settings.js`: `tabs.tab-previews.mouseover-duration-threshold-ms`
lucidNTR pushed a commit to lucidNTR/browser-laptop that referenced this issue Oct 1, 2016
- fixes brave#3271: Dont show tab preview unless mouse velocity is low enough
- tab preview requires that either:
  mouse be moving slower than a velocity threshold relative to tab size (so should be relative to resolution)
  mouse hover for longer than a new mouseover duration threshold (this may be unnecessary, velocity seems fine)
- 50% higher mouse velocity is tolerated if user is in "preview mode" (moving mouse from one tab to another, see issue brave#1434)
  to avoid flashing out when mousing from one tab preview to another
- velocity threshold is set in `constants/settings.js`: `tabs.tab-previews.mouse-velocity-threshold`
- mouseover duration threshold is set in `constants/settings.js`: `tabs.tab-previews.mouseover-duration-threshold-ms`
@michalbe
Copy link
Contributor

Whats the status of this issue? I can see there was some work done but no PR sent.

@luixxiul luixxiul added feature/tabsbar needs-info Another team member needs information from the PR/issue opener. labels Feb 11, 2017
@bsclifton
Copy link
Member

@michalbe I don't believe we have any solutions. If this is one you'd like to solve, please feel free to grab it 😄

@alexwykoff alexwykoff added this to the 1.2.0 milestone Mar 9, 2017
@cezaraugusto cezaraugusto self-assigned this Apr 27, 2017
@cezaraugusto cezaraugusto modified the milestones: 0.15.2, 1.2.0 Apr 28, 2017
@alexwykoff alexwykoff modified the milestones: 0.15.4, 0.15.3 May 5, 2017
@cezaraugusto
Copy link
Contributor

after taking this for a while here's my findings:

  1. Velocity should work differently for X and Y axis. Reason is that a user going left/right || right/left is more likely to want to preview tabs than a user going/coming from tab/webview to urlbar.
  2. Based on 1, a speed of 0.025px/milliseconds seemed to be the golden number, but that regressed flickering tab issue. The reason is that mouse was still too slow to trigger vertical mouse changes.
  3. Movement from bottom to top is slower than top to bottom -- tested with 3 different people, and velocity will drastically change between two, so they should also be treated separately. Maybe by tracking negative/positive values. To make it work I had to get rid of velocity and make use of speed (which is linear) for each axis. But the point is that mouse movement isn't linear. After questioning life's meaning I stopped to find better alternatives.
  4. Acceleration wouldn't work because sometimes velocity can start at 0 speed. So if we track it by deceleration it would first need to accelerate then track reducing value. If we just skip 0 values the flickering tab issue would be undercovered since at that moment tab would be already unintentionally previewed.

The best solution I found is to track relatedTarget on mouseEnter and check which element mouse was before. This way we can easily know if user is going/coming to webview/urlbar (vertical axis) or just coming from another tab. I did this a long time ago (ca9e4f8) and is the current approach we have. What is missing is a better RegExp test match so it can track every possible element.

@cezaraugusto
Copy link
Contributor

moving back to backlog in favor of #8860.

@cezaraugusto cezaraugusto modified the milestones: Backlog, 0.15.400 May 12, 2017
cezaraugusto added a commit that referenced this issue Jul 24, 2017
cezaraugusto added a commit that referenced this issue Jul 25, 2017
cezaraugusto added a commit that referenced this issue Jul 25, 2017
@bsclifton bsclifton modified the milestones: 0.19.x (Beta Channel), Backlog Jul 29, 2017
@bsclifton bsclifton added release-notes/include and removed needs-info Another team member needs information from the PR/issue opener. labels Jul 29, 2017
cezaraugusto added a commit that referenced this issue Jul 29, 2017
@luixxiul luixxiul modified the milestones: 0.21.x (Nightly Channel), 0.19.x (Beta Channel) Aug 7, 2017
cezaraugusto added a commit that referenced this issue Aug 8, 2017
@cezaraugusto cezaraugusto modified the milestones: 0.20.x (Developer Channel), 0.21.x (Nightly Channel) Aug 8, 2017
dfperry5 pushed a commit to dfperry5/browser-laptop that referenced this issue Aug 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.