Page MenuHomePhabricator

[native] switched fixed tooltip component from a vertical layout to horizontal
ClosedPublic

Authored by ginsu on Oct 17 2022, 7:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 10:38 PM
Unknown Object (File)
Mon, Nov 25, 7:10 PM
Unknown Object (File)
Sun, Nov 24, 12:45 PM
Unknown Object (File)
Sun, Nov 24, 12:45 PM
Unknown Object (File)
Sun, Nov 24, 12:44 PM
Unknown Object (File)
Sun, Nov 24, 12:44 PM
Unknown Object (File)
Sun, Nov 24, 12:44 PM
Unknown Object (File)
Sun, Nov 24, 12:44 PM

Details

Summary

Tooltips that have a fixed location now have a horizontal layout, don't render the triangles, and have a minWidth of the screen size with 8px of padding on each side. Also created a fixedTooltipHeight variable since the tooltip height for fixed tooltips will always be the same, and using inspector found out that the height of the new tooltip is 53px.

Screen Shot 2022-10-17 at 5.18.58 PM.png (1×1 px, 762 KB)


Depends on D5468
Linear Task: ENG-2037
Design: Figma

Test Plan

Please review the screenshots below to see the changes I made, before and after:

Create Thread Case:

Screen Shot 2022-10-17 at 10.28.42 AM.png (1×1 px, 615 KB)

Open Thread Case:

Screen Shot 2022-10-17 at 11.15.40 AM.png (1×1 px, 634 KB)

Inspector View:

Screen Shot 2022-10-17 at 10.10.42 AM.png (1×958 px, 526 KB)

Video Demo:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Oct 17 2022, 7:35 AM

removed extra console.log

Really cool, pulled it down locally and everything looks good to me! Just a question below

native/navigation/tooltip.react.js
524 ↗(On Diff #17618)

Since you removed the triangle style, does anything in this function change? I don't have too much context on this so just wondering if removing the triangle style impacts the calculation based on the in-line comment here.

atul requested changes to this revision.Oct 17 2022, 10:32 AM

Looks close, left a few comments inline

native/chat/text-message-tooltip-modal.react.js
59–64 ↗(On Diff #17618)

Personally think we should keep the old copy even if the designs may differ.

(CC @ashoat)

native/navigation/tooltip.react.js
311–317 ↗(On Diff #17618)

Looks like style.minWidth is the same regardless of extraLeftSpace < extraRightSpace... can we just pull it out of the if/else block?

499–512 ↗(On Diff #17618)

These changes are clean

524 ↗(On Diff #17618)

Yeah let's make sure the calculation here is correct

This revision now requires changes to proceed.Oct 17 2022, 10:32 AM
native/chat/text-message-tooltip-modal.react.js
59–64 ↗(On Diff #17618)

I think we're good to change copy

Also don't think it's a huge deal, but you could've probably split this diff even further into

  1. Remove triangle stuff (and make any necessary changes to tooltipHeight(...))
  2. Change layout from vertical to horizontal

Personally think it's fine to leave this diff as is, but just a thought for next time.

ginsu edited the summary of this revision. (Show Details)

addressed feedback

switched tooltipHeight from function to constant

Looks good!

(Make sure to separate out copy changes before landing!)

edit: jk it looks like it was discussed

native/chat/text-message-tooltip-modal.react.js
57–64 ↗(On Diff #17630)

I think this is an unrelated change? Changing the copy here should be in a separate diff

This revision is now accepted and ready to land.Oct 19 2022, 10:25 AM
native/chat/text-message-tooltip-modal.react.js
57–64 ↗(On Diff #17630)

I'm down with the copy change but it seems like we could dedup these now that they have the same title. Makes sense to handle that in a separate diff

updated diff to consider ThreadSettingsMemberTooltipModal and RelationshipListItemTooltipModal

removed tooltipHeight in exports since it is no longer being used in other files

ginsu retitled this revision from [native] switched tooltip component from a vertical layout to horizontal to [native] switched fixed tooltip component from a vertical layout to horizontal.Oct 25 2022, 12:26 PM
ginsu edited the summary of this revision. (Show Details)
ginsu edited the test plan for this revision. (Show Details)
ginsu added 1 blocking reviewer(s): atul.
This revision now requires review to proceed.Oct 25 2022, 12:26 PM
atul requested changes to this revision.Oct 26 2022, 12:22 PM

Super close, minor nit/question inline

native/chat/multimedia-message.react.js
23 ↗(On Diff #17907)

Super minor nit, but let's make "tooltip" one word to remain consistent with the rest of the codebase.

Should be something like:

fixedTooltipHeight
native/navigation/tooltip.react.js
580 ↗(On Diff #17907)

Why are we deleting this comment?

Should it be replaced with a comment that explains "the new math?"

This revision now requires changes to proceed.Oct 26 2022, 12:22 PM

addressed atul's comments

atul requested changes to this revision.Oct 27 2022, 9:41 AM

Let's update the comment at tooltip.react.js:618 to correctly reflect the "math" below and this should be good to land.

native/navigation/tooltip.react.js
618 ↗(On Diff #17955)

We should update this comment to reflect the "math" below

This revision now requires changes to proceed.Oct 27 2022, 9:41 AM

Spoke to atul, for now the math of tooltipHeight is outside the scope of this diff, made a linear task to track this issue

This revision is now accepted and ready to land.Oct 27 2022, 12:01 PM