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

Fixes an edge case when the tooltip wouldn't move closer to the mouse cursor in some situations #3663

Conversation

julienw
Copy link
Contributor

@julienw julienw commented Nov 22, 2021

This would happen in this situation:

  • The user hovers an element, whose tooltip is too big for the available
    space: the tooltip would align with the window's left edge.
  • Then the user hovers another element whose tooltip would have space to
    go either at the right or left of the cursor. In that case we reuse the
    previous position, so that the tooltip stays stable.
    But if the previous position was the window-edge, then the tooltip
    would stay at that location and could be far from the mouse cursor.

You can test with these links by reducing the window width a lot, or using the devtools docked at the right and increasing the devtools width to reduce the window width:

production / deploy preview

Before:
Screencast_22-11-2021_16:09:21 webm

After:
Screencast_22-11-2021_16:10:25 webm

… cursor in some situations

This would happen in this situation:
* The user hovers an element, whose tooltip is too big for the available
  space: the tooltip would align with the window's left edge.
* Then the user hovers another element whose tooltip would have space to
  go either at the right or left of the cursor. In that case we reuse the
  previous position, so that the tooltip stays stable.
  But if the previous position was the window-edge, then the tooltip
  would stay at that location and could be far from the mouse cursor.
@julienw julienw changed the title Fixes an edge case when the tooltip wouldn't move closer to the mouse… Fixes an edge case when the tooltip wouldn't move closer to the mouse cursor in some situations Nov 22, 2021
@julienw julienw requested a review from canova November 22, 2021 15:12
@codecov
Copy link

codecov bot commented Nov 22, 2021

Codecov Report

Merging #3663 (fd8b0da) into main (040c16f) will increase coverage by 0.13%.
The diff coverage is 100.00%.

❗ Current head fd8b0da differs from pull request most recent head e63777f. Consider uploading reports for the commit e63777f to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3663      +/-   ##
==========================================
+ Coverage   88.77%   88.91%   +0.13%     
==========================================
  Files         259      258       -1     
  Lines       21746    21547     -199     
  Branches     5564     5509      -55     
==========================================
- Hits        19305    19158     -147     
+ Misses       2262     2214      -48     
+ Partials      179      175       -4     
Impacted Files Coverage Δ
src/components/tooltip/Tooltip.js 91.07% <100.00%> (+0.33%) ⬆️
src/selectors/url-state.js 97.94% <0.00%> (-0.54%) ⬇️
src/components/timeline/TrackContextMenu.js 91.03% <0.00%> (-0.20%) ⬇️
src/actions/profile-view.js 85.26% <0.00%> (-0.13%) ⬇️
src/reducers/app.js 99.32% <0.00%> (-0.01%) ⬇️
src/components/shared/TrackSearchField.js
src/reducers/url-state.js 98.10% <0.00%> (+0.22%) ⬆️
src/utils/string.js 100.00% <0.00%> (+3.12%) ⬆️
src/profile-logic/tracks.js 93.13% <0.00%> (+7.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 040c16f...e63777f. Read the comment docs.

Copy link
Member

@canova canova left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@julienw julienw enabled auto-merge (squash) November 24, 2021 15:10
@julienw julienw merged commit 98493ee into firefox-devtools:main Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants