Previously, an "alt text" tooltip would only appear for the sidebar button. This enables it for the reply button.
Before:
After:
(Styling, tooltip arrow, etc coming in future diffs)
Differential D3355
[web] Introduce `toggleReplyTooltip` and `toggleSidebarTooltip` atul on Mar 7 2022, 10:55 AM. Authored by Tags None Referenced Files
Details Previously, an "alt text" tooltip would only appear for the sidebar button. This enables it for the reply button. Before: After: (Styling, tooltip arrow, etc coming in future diffs) Manual testing
Diff Detail
Event TimelineComment Actions Is it a part of a stack, or are your diffs independent?
Comment Actions
It's generally a part of the MessageActionButtons work, but I think it stands alone (was able to land the other diffs without this one)
Yeah you're right, I'll change this to TooltipType
With the current approach, we have "one" tooltip component that conditionally appears above either the reply or sidebar buttons when they're hovered over. Because of this, we need to be able to dynamically change the text that appears within the tooltip depending on which icon is being pointed to. We could create two separate tooltip components--one for each button--and set the text statically, but I'm not sure if that's a good idea? Based on the design it looks like we're going to have more buttons added to this row, so we'd have to create a separate tooltip for all of them? Maybe that's not crazy if we break the tooltip into its own component?
Yeah it looks like it's not a "real" toggle since it just returns if tooltipVisible if (tooltipVisible) { return; } So I guess really it's a show tooltip if not already visible...so what I really need to do is rename the functions to make their behavior more clear? Comment Actions
Ah, you're right. Even when two buttons are visible we show only one tooltip so it's not possible to determine the tooltip state when creating a button. It would be nice if we could do that, but that would require significant changes and they are not worth it. When we will be introducing new buttons, we can figure out if we need some improvements here. Sorry for requesting changes again, but I have some ideas that could improve the code here.
Comment Actions
I think we still need two callbacks to pass into each onMouseEnter. If we were to include the type as an argument to show tooltip, we'd still need showSidebarTooltip = React.useCallback((event) => showTooltip('sidebar', event)); Can still make that change if we think it would be an improvement
Got rid of tooltipVisible state! Thanks for that suggestion, it's definitely cleaner Comment Actions
Actually, I think it's a definite improvement so I made that change Comment Actions https://linear.app/comm/issue/ENG-799/message-tooltip-position-is-incorrect -- @atul assuming you're working on this. Could you update the linear task if you're taking this issue on? Comment Actions
This diff is part of https://linear.app/comm/issue/ENG-794/create-sidebar-pointer-icon-is-borked and has to do with the message action buttons. Looks like ENG-799 is a separate issue regarding the timestamp tooltip. I could take a look after this issue is completed? I guess they're kind of related Comment Actions This makes sense to me
|