Page MenuHomePhabricator

[web] introduce getTooltipScreenOverflowRightCorrection function
ClosedPublic

Authored by ginsu on Aug 17 2023, 6:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 1 2024, 5:42 AM
Unknown Object (File)
Mar 5 2024, 11:48 PM
Unknown Object (File)
Feb 23 2024, 5:18 AM
Unknown Object (File)
Feb 19 2024, 5:05 AM
Unknown Object (File)
Feb 19 2024, 4:16 AM
Unknown Object (File)
Feb 19 2024, 4:12 AM
Unknown Object (File)
Feb 19 2024, 3:11 AM
Unknown Object (File)
Feb 19 2024, 3:11 AM

Details

Summary

As I was doing some final tests for the ReactionTooltip, I noticed a scenario where the reaction tooltip for the most right reaction pill of a viewer message was overflowing off the screen if the tooltip was at its maxWidth. To address this I created a helper function which calculates the overFlow and shifts the tooltip x anchor point

Depends on D8859

Test Plan

Please see the screenshots below

Before:

Screenshot 2023-08-17 at 9.45.59 PM.png (2×3 px, 1 MB)

Screenshot 2023-08-17 at 9.45.51 PM.png (2×3 px, 1 MB)

After:

Screenshot 2023-08-17 at 10.52.48 PM.png (2×3 px, 1 MB)

Screenshot 2023-08-17 at 10.52.36 PM.png (2×3 px, 1 MB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Aug 17 2023, 7:12 PM

Just one quick question, discovered it in D8859 but asking here.

Are you sure that overlapping thread list a bit is okay? (not sure what was original design and how it influence the UI)

image.png (350×376 px, 37 KB)

web/utils/tooltip-utils.js
63–68 ↗(On Diff #30057)

that's what's more readable for me, if you have the opposite opinion stick to your version 😅

This revision is now accepted and ready to land.Aug 24 2023, 2:39 PM

Are you sure that overlapping thread list a bit is okay?

Currently all our tooltips do this, so I thought it was okay to keep this consistent behavior.

Screenshot 2023-08-24 at 5.43.06 PM.png (2×3 px, 1 MB)

Screenshot 2023-08-24 at 5.43.13 PM.png (2×3 px, 1 MB)

Curious for Ted's take
cc @ted

In D8860#263537, @ginsu wrote:

Are you sure that overlapping thread list a bit is okay?

Currently all our tooltips do this, so I thought it was okay to keep this consistent behavior.

Screenshot 2023-08-24 at 5.43.06 PM.png (2×3 px, 1 MB)

Screenshot 2023-08-24 at 5.43.13 PM.png (2×3 px, 1 MB)

Curious for Ted's take
cc @ted

Thanks for the tag! Yea, I think it is okay if it overlaps. It's clear enough to me that the tooltip element is above the rest of the content.

address comments / rebase before landing

ginsu retitled this revision from [web] introduce getTooltipScreenOverflowXCorrection function to [web] introduce getTooltipScreenOverflowRightCorrection function.Aug 27 2023, 9:36 PM