Page MenuHomePhabricator

[web] introduce useNavigationSidebarTooltip hook
ClosedPublic

Authored by ginsu on Dec 15 2023, 12:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 1:08 AM
Unknown Object (File)
Wed, Oct 30, 11:54 PM
Unknown Object (File)
Wed, Oct 30, 11:54 PM
Unknown Object (File)
Wed, Oct 30, 11:54 PM
Unknown Object (File)
Wed, Oct 30, 11:54 PM
Unknown Object (File)
Wed, Oct 30, 11:54 PM
Unknown Object (File)
Oct 3 2024, 11:39 AM
Unknown Object (File)
Sep 19 2024, 10:38 PM
Subscribers

Details

Summary

This diff introduces the useNavigationSidebarTooltip hook. Every tooltip has a hook similar to this that will calculate the size of the tooltip, create the tooltip instance and return the onMouseEnter + onMouseLeave callbacks that we will pass to the elements in the navigation sidebar that have tooltips. For context on how we use these hooks to build tooltips here are the useReactionSidebarTooltip hook and useMessageTooltip.

https://github.com/CommE2E/comm/blob/master/web/utils/tooltip-action-utils.js#L446

https://github.com/CommE2E/comm/blob/master/web/utils/tooltip-action-utils.js#L391

Part of https://linear.app/comm/issue/ENG-5948/hovering-over-every-clickable-element-in-this-sidebar-will-have-a

Depends on D10357

Test Plan

Please see demo video below

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: atul, rohan, kamil.
ginsu edited the test plan for this revision. (Show Details)
ginsu requested review of this revision.Dec 15 2023, 1:25 PM
atul added inline comments.
web/utils/tooltip-action-utils.js
493–495 ↗(On Diff #34745)

Looks like we have this same check in useMessageTooltip and useReactionTooltip, so assuming it's fine.

This revision is now accepted and ready to land.Dec 20 2023, 9:58 PM