Page MenuHomePhabricator

[web] introduce useNavigationSidebarTooltip hook
ClosedPublic

Authored by ginsu on Dec 15 2023, 12:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 20 2024, 8:13 AM
Unknown Object (File)
Feb 20 2024, 2:48 AM
Unknown Object (File)
Feb 19 2024, 10:55 PM
Unknown Object (File)
Feb 19 2024, 6:43 PM
Unknown Object (File)
Feb 18 2024, 11:38 AM
Unknown Object (File)
Feb 18 2024, 9:20 AM
Unknown Object (File)
Feb 17 2024, 8:50 PM
Unknown Object (File)
Feb 17 2024, 3:07 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