googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.12k stars 691 forks source link

PLEASE do not display tooltips beneath targets #4635

Open GaryGen opened 2 weeks ago

GaryGen commented 2 weeks ago

Is your feature request related to a problem? Please describe. I am VERY frustrated by the tooltips in CoLab. When I try to mouse over a "play" icon next to the top code block on the screen, if I go just a little bit too high, I trigger the "+ Code" tooltip which obscures the play icon for the next 2-3 seconds. Similar issues occur when moving the mouse to the menu and passing over the document title.

Describe the solution you'd like Tooltips should never prevent you from performing operations, especially operations that are completely unrelated to the tooltip being displayed. Solution: display tooltips like 99% of the rest of the world. Or at very least, provide a way to turn them off.

Describe alternatives you've considered I've considered tearing my hair out, getting a light snack, and reading War & Peace a few words at a time given the number of times I have to pause for the unwanted tooltips.

Additional context This may be partially an accessibility issue. My fine motor control in my mousing hand is not what it used to be. But seriously, mouse past a target by 5-10 pixels and you're waiting.

zelliott commented 2 weeks ago

Thanks for the feedback @GaryGen. We just pushed a change to Colab's tooltips that makes it so a tooltip doesn't appear unless you're hovering on its host element for at least 500ms, roughly following the guidance at https://www.nngroup.com/articles/timing-exposing-content/. We also reduced the amount of time that needs to pass before a tooltip disappears. If you haven’t done so already, try refreshing your browser to catch these most recent changes.

Does this address your feedback? If not, screenshots, repro notebooks, and/or video will be really helpful to identify how we can further improve things!

GaryGen commented 1 week ago

Thank you for the reply. The new delay is a big improvement.

The behavior still seems very different from something like Google Chrome Bookmark Bar (Mac or Windows). The biggest difference is that the tooltips in Chrome only persist if the mouse is over the target. In Google CoLab, the tooltip persist when the mouse is over the target OR the tooltip. Also, in terms of the delay, the initial delay for a bookmark bar tooltip in Chrome is multiple seconds. However, once engaged, the tooltips for each item appear almost immediately.

The persistent tooltip leads to the problem I ran into with the "+ Code" button and the "Play" button directly under it, if the tooltip does get triggered, the "+ Code" button is obscured until the mouse is removed from the area. As noted previously, this also occurs with the "Rename notebook" tooltip covering the menu.

Video of this behavior attached.

https://github.com/googlecolab/colabtools/assets/10538343/877fc4a0-16fb-4347-9a68-5b1dbb6cca80

zelliott commented 1 week ago

Thanks for the helpful reply @GaryGen, glad we're moving in the right direction! :)

In Google CoLab, the tooltip persist when the mouse is over the target OR the tooltip.

You're right - this was actually a recent change to satisfy https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus. From that link:

If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing;

So unfortunately we likely can't change that behavior, otherwise we'd fail that success criteria. But maybe we can further improve things some other way.

Also, in terms of the delay, the initial delay for a bookmark bar tooltip in Chrome is multiple seconds. However, once engaged, the tooltips for each item appear almost immediately.

The persistent tooltip leads to the problem I ran into with the "+ Code" button and the "Play" button directly under it, if the tooltip does get triggered, the "+ Code" button is obscured until the mouse is removed from the area. As noted previously, this also occurs with the "Rename notebook" tooltip covering the menu.

Lots of ideas for us to explore here, including:

For now, I filed a ticket on our side to track this investigation internally (b/347921812). One final tip that may improve things for you in the interim, you can press ESC to dismiss any tooltip on the page, even if you're hovered over the target or the tooltip. I've found that this is sometimes a faster way to dismiss pesky tooltips.

GaryGen commented 1 week ago

Thanks for the reply and the consideration. I'm not sure what's driving the standard you're referring to or your interpretation of it applying to tooltips, but you clearly have a specific requirement set in mind. Thanks again.