Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…oving The forked Plottable Pointer interaction listens on the chart's root element instead of the document, and Plottable decides whether the pointer exited a component only from the event coordinates. A mouseout whose coordinates are still inside the plot (the pointer moved onto an element overlapping the chart, or left the window via macOS Mission Control or an app switch) was handled as a move, so the tooltip stayed until the chart was hovered and left again. Treat a mouseout towards an element outside the chart, or towards no element at all, as a pointer exit. Fixes tensorflow#3753.
Axfff
force-pushed
the
fix/scalar-tooltip-stuck-on-window-leave
branch
from
December 3, 2026 13:47
cd47985 to
31ec643
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation for features / changes
Fixes #3753.
In the Scalars dashboard (and the other dashboards built on
vz-line-chart2: Custom Scalars, PR Curves, HParams), the hover tooltip stays on screen when the pointer leaves a chart without moving across its edge. Two ways to trigger it:The tooltip only goes away after hovering the same chart again and leaving it through an edge. The Time Series dashboard is not affected because its chart listens for
mouseleave.Technical description of changes
The legacy charts use a forked Plottable
Pointerinteraction (vz_chart_helpers/plottable-interactions.ts). Its mouse dispatcher listens on the chart's root element instead ofdocument, for Shadow DOM compatibility. Plottable decides whether the pointer left a component only from the coordinates of each mouse event, and it handlesmouseoutas a move.Because the listener is scoped to the chart, that
mouseoutis the last event the chart receives. When the pointer leaves without crossing the edge (onto an element overlapping the chart, or out of the window), the coordinates are still inside the plot. The event is handled as an ordinary move, so the exit callbacks that hide the tooltip never run.This change sends mouse events in
PointerInteractionthrough a small wrapper. AmouseoutwhoserelatedTargetis outside the chart's root element, or isnull(the pointer left the window), is handled as an exit whatever its coordinates. All other events go through Plottable's existing logic unchanged.Screenshots of UI changes (or N/A)
N/A. This fixes behavior and has no visual change.
Detailed steps to verify changes work correctly (as executed by you)
I loaded the original and the patched
plottable-interactions.tsside by side with Plottable 3.13.0, the version inyarn.lock. Each chart was rendered inside a shadow root likevz-line-chart2, with the tooltip shown and hidden fromonPointerMove/onPointerExit.mouseoutwithrelatedTarget: nullat the pointer's current position, which is what the browser sends when the window loses the pointer. Original: the tooltip stays visible. Patched: the tooltip is hidden.mouseoutbetween two elements inside the chart keeps it. Moving onto the axis area or off the chart hides it, as before.tsctype-check of the file with the lax config this target uses, andprettier --check, both pass.Not run: the full Bazel build (
bazel run //tensorboard).Alternate designs / implementations considered (or N/A)
mouseleavelistener on the chart root inline-chart.ts. It works the same way, but it needs its own listener lifecycle. Fixing the sharedPointerInteractionkeeps all exit detection in one place.windowblurorvisibilitychange. The tooltip already hides onvisibilitychange, and neither event covers the overlay case in Mouseover for plot does not go away when changing from scalars to images #3753.🤖 Generated with Claude Code