Add tooltips to buttons with dynamic visibility support #825
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.
I was taking a look at #405 and thought that a decent middle ground on solving this is instead of adding a new button to hold a variable that will dictate whether to show tooltips, we could instead use hovering while holding a modifier key on the keyboard to control that display logic.
This PR adds integrated tooltips across score control buttons to provide contextual guidance to users, but only when the
Control
key is being held & the user is actively hovering over an element with the classtooltip
that has a child element with the classtooltiptext
. I couldn't add thetooltiptext
span directly as a child of thebutton
or the button's display rules interfere with getting the tooltip to show up on top of the other elements on the page.Notes:
Because of the way browsers detect key presses, the user will have had to interact with the page in some format before the control + hover functionality will work. This could be pressing a button or even just clicking anywhere on the page.
I am in zero way tied to where this javascript code should live nor what the styling should be, so please feel free to adjust that or make suggestions on what changes I should make!
And finally, I only added a few tooltip texts because I'm still learning how to use this program and am the prime audience for needing these help bubbles!