profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Don't show timeline tooltips outside of the preview selection

Open mstange opened this issue 3 years ago • 2 comments

As of #3840, if there is a preview selection and you click the activity graph outside of that selection, we now ignore that click to some extent: The click only resets the preview selection. It no longer switches the selected track or selects the call node of the clicked sample. You need a second click to do that.

However, we still display the activity graph tooltip if you hover the graph outside of the preview selection. This is misleading: It sends the message that "You can click here to see the stack in the tooltip". But that's not true; clicking doesn't do anything other than resetting the selection.

So I think we should only display the tooltip while the mouse is inside the preview selection. If the mouse is outside the preview selection, no tooltip should be displayed. Once a click happens at that position and the selection is reset, the tooltip should appear immediately.

mstange avatar Feb 01 '22 16:02 mstange

So I think we should only display the tooltip while the mouse is inside the preview selection. If the mouse is outside the preview selection, no tooltip should be displayed.

This should be easy by using stopPropagation in the right place in the mousemove handler in the Selection component. But...

Once a click happens at that position and the selection is reset, the tooltip should appear immediately.

Then we don't have the current move position in the activity graph and we couldn't do that.

If we want both, then I believe we can't use stopPropagation, but instead, in the activity graph component, check the current preview selection information and use that to decide if the tooltip should be displayed.

julienw avatar Feb 07 '22 17:02 julienw

I've mixed feelings about that. On one hand I agree with the reasoning. On the other hand tooltips are useful to navigate the profile, and preventing that they're showing up in this situation might make it more difficult to navigate when a selection is displayed.

julienw avatar Feb 15 '22 16:02 julienw