Page MenuHomePhabricator

[web] Introduce `getMessageActionTooltipStyle` util function
ClosedPublic

Authored by jacek on Aug 23 2022, 4:59 AM.
Tags
None
Referenced Files
F3517897: D4915.diff
Sun, Dec 22, 6:33 PM
Unknown Object (File)
Thu, Dec 19, 4:07 AM
Unknown Object (File)
Sun, Dec 1, 7:33 PM
Unknown Object (File)
Sun, Dec 1, 7:32 PM
Unknown Object (File)
Sun, Dec 1, 7:32 PM
Unknown Object (File)
Sun, Dec 1, 7:32 PM
Unknown Object (File)
Mon, Nov 25, 5:14 PM
Unknown Object (File)
Nov 11 2024, 1:52 AM
Subscribers

Details

Summary

Introduce getMessageActionTooltipStyle to calculate style object for tooltip

Test Plan

Flow; Tested with the rest of diffs stack.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

jacek held this revision as a draft.
tomek requested changes to this revision.Aug 26 2022, 6:42 AM

This should also have some tests. Ideally, a test plan should include some description of how particular positions were tested.

web/chat/tooltip-utils.js
194 ↗(On Diff #15856)

We should avoid using switch

197–198 ↗(On Diff #15856)

What is the meaning of these coordinates? I guess it's not a simple offset because it doesn't depend on the tooltip size.

200 ↗(On Diff #15856)

It's not that intuitive that for top we use bottom. Can you explain this a bit?

272 ↗(On Diff #15856)

Please include tooltipPosition in the message

This revision now requires changes to proceed.Aug 26 2022, 6:42 AM
web/chat/tooltip-utils.js
194 ↗(On Diff #15856)

I'll change it, but I still disagree with this, because for me it looks a lot better here that if-else?

197–198 ↗(On Diff #15856)

It's the anchor point - best to explain on the picture:

Screenshot_Linear_2022-08-29_141646.png (898×781 px, 681 KB)

The horizontalPosition and verticalPosition are relative to this point. That's why for top-aligned position, we display the tooltip below (bottom)

tomek added inline comments.
web/chat/tooltip-utils.js
197–198 ↗(On Diff #15856)

If it's the anchor point then maybe include that info in the name?

This revision is now accepted and ready to land.Sep 2 2022, 3:04 AM
web/chat/tooltip-utils.js
197–198 ↗(On Diff #15856)

Yes, I'll do the rename from xCoord, yCoord to anchorPointX, anchorPointY in a separate diff.