Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Web - LHN - Blank tooltip displayed when created a workspace and hover over workspace selector #48691

Closed
1 of 6 tasks
IuliiaHerets opened this issue Sep 6, 2024 · 29 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 6, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.30-4
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+omh5@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Tap on Workspace selector
  3. Tap on Plus button to create a workspace
  4. Tap on back arrow button twice in a row
  5. Hover over the Workplace Selector
  6. Reload page
  7. Hover over the Workspace Selector
  8. Repeat steps 2-5

Expected Result:

Tooltip "Choose a workspace" should be displayed when user created a workspace and hovers over the workspace selector

Actual Result:

Blank tooltip displayed when user created a workspace and hover over workspace selector. If user reloads the page, the workspace selector tooltip will be displayed properly.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6594725_1725577761937.Screen_Recording_2024-09-06_at_02.00.09.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021833240040535012696
  • Upwork Job ID: 1833240040535012696
  • Last Price Increase: 2024-09-23
  • Automatic offers:
    • jjcoffee | Reviewer | 104119257
    • QichenZhu | Contributor | 104119259
Issue OwnerCurrent Issue Owner: @jjcoffee
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 6, 2024
Copy link

melvin-bot bot commented Sep 6, 2024

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@IuliiaHerets
Copy link
Author

@anmurali FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@melvin-bot melvin-bot bot added the Overdue label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

@anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!

@anmurali anmurali added the External Added to denote the issue can be worked on by a contributor label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021833240040535012696

@melvin-bot melvin-bot bot changed the title Web - LHN - Blank tooltip displayed when created a workspace and hover over workspace selector [$250] Web - LHN - Blank tooltip displayed when created a workspace and hover over workspace selector Sep 9, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 9, 2024
Copy link

melvin-bot bot commented Sep 9, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)

@melvin-bot melvin-bot bot removed the Overdue label Sep 9, 2024
@anmurali
Copy link

anmurali commented Sep 9, 2024

Waiting on proposals.

@QichenZhu
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

The tooltip size becomes small after displaying it, navigating two screens away, then returning and displaying the tooltip again.

What is the root cause of that problem?

The code below calculates the tooltip size. It works correctly the first time, but when called again, it calculates the size as 0 because the animation applied a scale(0) transformation.

useLayoutEffect(() => {
// Calculate the tooltip width and height before the browser repaints the screen to prevent flicker
// because of the late update of the width and the height from onLayout.
setContentMeasuredWidth(contentRef.current?.getBoundingClientRect().width);
setWrapperMeasuredHeight(rootWrapper.current?.getBoundingClientRect().height);
}, []);

The reason it is called again is that the component is frozen after navigating away for two screens and then resumed when returning.

What changes do you think we should make in order to solve the problem?

A straightforward solution is to temporarily set the transformation to scale(1) before calculating the size.

const rootWrapperStyle = rootWrapper?.current?.style;
const isScaled = rootWrapperStyle?.transform === 'scale(0)';
if (isScaled) {
    rootWrapperStyle.transform = 'scale(1)';
}
setContentMeasuredWidth(contentRef.current?.getBoundingClientRect().width);
setWrapperMeasuredHeight(rootWrapper.current?.getBoundingClientRect().height);
if (isScaled) {
    rootWrapperStyle.transform = 'scale(0)';
}

What alternative solutions did you explore? (Optional)

We could calculate the size only once if we intend not to update it further.

if (!contentMeasuredWidth) {
    setContentMeasuredWidth(contentRef.current?.getBoundingClientRect().width);
}
if (!wrapperMeasuredHeight) {
    setWrapperMeasuredHeight(rootWrapper.current?.getBoundingClientRect().height);
}

@jjcoffee
Copy link
Contributor

Thanks for the proposal @QichenZhu!

the animation applied a scale(0) transformation.

Could you clarify which animation you're talking about and where the scale(0) transform is being applied?

@QichenZhu
Copy link
Contributor

@jjcoffee I’m referring to the animation of the tooltip scaling down as it disappears.

Screen.Recording.2024-09-11.at.11.13.04.PM.mov

scale(0) is applied to Animated.View.

<Animated.View
ref={viewRef(rootWrapper)}
style={[rootWrapperStyle, animationStyle]}
>

@jjcoffee
Copy link
Contributor

@QichenZhu Thanks, I see what you mean now! For now I think the proposed solution sounds like a bit too much of a workaround, and I don't think the alternative solution necessarily works (unless you can argue for it's robustness).

@QichenZhu
Copy link
Contributor

@jjcoffee Thank you for the review.

The alternative solution works if GenericTooltip instances correctly follow the usage described below.

// We pass a key, so whenever the content changes this component will completely remount with a fresh state.
// This prevents flickering/moving while remaining performant.
key={[text, ...renderTooltipContentKey, preferredLocale].join('-')}

In my understanding, this means that by design, a fresh new BaseGenericTooltip instance will be created whenever the content changes, so we only need to calculate the size once for each instance.

Details can be found here: #18189 (comment).

@jjcoffee
Copy link
Contributor

@QichenZhu Hmm interesting, thanks for the clarification!

After a bit of further investigation, I'm happy to go with @QichenZhu's proposal. I agree with their RCA and don't think there's another way to solve this. We could probably go with either the main or alternative solution, but the main one might be a bit safer.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 13, 2024

Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Sep 16, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Sep 16, 2024
Copy link

melvin-bot bot commented Sep 16, 2024

@marcochavezf, @anmurali, @jjcoffee Whoops! This issue is 2 days overdue. Let's get this updated quick!

@jjcoffee
Copy link
Contributor

Not overdue - just waiting for @marcochavezf to assign.

@melvin-bot melvin-bot bot removed the Overdue label Sep 17, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

@marcochavezf @anmurali @jjcoffee this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

@marcochavezf, @anmurali, @jjcoffee Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@jjcoffee
Copy link
Contributor

@marcochavezf Are you able to assign @QichenZhu here? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Sep 23, 2024
Copy link

melvin-bot bot commented Sep 23, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added Overdue and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Sep 25, 2024
Copy link

melvin-bot bot commented Sep 25, 2024

📣 @jjcoffee 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Sep 25, 2024

📣 @QichenZhu 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 1, 2024

Deployed to production yesterday, so should be due for payment 2024-10-07. cc @anmurali

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@QichenZhu
Copy link
Contributor

Deployed to production 7 days ago, and no regressions were reported. cc @anmurali

@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 8, 2024

Regression Test Proposal
Desktop platforms only

  1. Hover over the Workspace selector, and note the tooltip that displays.
  2. Tap the Workspace selector and tap the + button to create a workspace.
  3. Tap the back arrow button twice.
  4. Hover over the Workspace selector again.
  5. Verify that the tooltip Choose a workspace is displayed at the correct size.

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

@anmurali Friendly bump for payment 🙇

@QichenZhu
Copy link
Contributor

Gentle bump @anmurali

@anmurali
Copy link

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
No open projects
Status: Polish
Development

No branches or pull requests

6 participants