Page MenuHomePhabricator

[web] Introduce `onMouse` calbacks for tooltip component in `TooltipContext`
ClosedPublic

Authored by jacek on Aug 23 2022, 4:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 5, 2:24 PM
Unknown Object (File)
Sun, Apr 28, 11:08 PM
Unknown Object (File)
Sun, Apr 28, 11:08 PM
Unknown Object (File)
Sun, Apr 28, 11:08 PM
Unknown Object (File)
Sun, Apr 28, 11:07 PM
Unknown Object (File)
Sun, Apr 28, 11:06 PM
Unknown Object (File)
Sun, Apr 28, 10:40 PM
Unknown Object (File)
Mon, Apr 22, 9:42 AM
Subscribers

Details

Summary

Intrroducing mause actions callbacks on tooltip component, to correctly handle clearing the tooltip.

Test Plan

Flow; Tested with the rest of diffs stack.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jacek held this revision as a draft.
This revision is now accepted and ready to land.Aug 25 2022, 10:31 AM
atul added inline comments.
web/chat/tooltip-provider.js
9 ↗(On Diff #15851)

Was it an arbitrary choice to make the leave tooltip timeout half the time of the leave source timeout? Just wondering what the relationship between them is and how the values were determined (since both time periods are so short I think they'd be indistinguishable to me)

Would it maybe make the user experience slightly more predictable if both timeouts were 200ms?

100–104 ↗(On Diff #15851)

If I understand correctly, this means if the cursor re-enters the current tooltip the 200ms countdown to clear the tooltip gets cancelled.

If the user moves their mouse quickly, would it be possible for multiple tooltips to become visible? Does that break any assumptions?

web/chat/tooltip-provider.js
9 ↗(On Diff #15851)

I'm open to changes here. The original reason was that the user needs more time to move cursor between message and tooltip, and the onMouseLeaveTooltipDisappearTimeoutMs was set just to prevent disappearing the tooltip when the user leaves it accidentally for a really short period of time.
I feel these values work well now, but we can easily change it

100–104 ↗(On Diff #15851)

If I understand correctly, this means if the cursor re-enters the current tooltip the 200ms countdown to clear the tooltip gets cancelled.

Yes - any countdown - the 200ms countdown after mouse leaving the message, or 100ms timeout after mouse leaving the tooltip.

If the user moves their mouse quickly, would it be possible for multiple tooltips to become visible? Does that break any assumptions?

No, when user enters the component that calls renderTooltip the previously rendered one immediately disappears and existing timer is cancelled.

removed parameter from onMouseLeaveTooltip