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

[HOLD for payment 2023-09-29] [$250] Tooltip flickers when click 3 dots menu on task report #26831

Closed
1 of 6 tasks
kavimuru opened this issue Sep 5, 2023 · 34 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Sep 5, 2023

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


Action Performed:

  1. Go to any task repot
  2. On report header, hover 3 dots menu
  3. Verify that tooltip with "More" text shows
  4. click 3 dots menu

Expected Result:

Tooltip should be hidden or should keep showing

Actual Result:

Tooltip flickers - disappears and re-appears

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.64-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

264001674-fffc9e65-58fe-494d-af34-9d12ce15ff1c.mov
Recording.1562.mp4

Expensify/Expensify Issue URL:
Issue reported by: @situchan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693310046653569

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e970a8827f09ba1a
  • Upwork Job ID: 1699787320958922752
  • Last Price Increase: 2023-09-14
  • Automatic offers:
    • 0xmiroslav | Reviewer | 26737206
    • bernhardoj | Contributor | 26737208
    • situchan | Reporter | 26737209
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

Triggered auto assignment to @puneetlath (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@bernhardoj
Copy link
Contributor

Proposal

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

Tooltip flickers when clicking the three-dot menu

What is the root cause of that problem?

The 3-dot menu uses PopoverMenu which uses PopoverWithMeasuredContent to show the menu. In PopoverWithMeasuredContent, it will render an invisible View with an absolute position to measure the size of the menu.

return isContentMeasured ? (
<Popover
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
anchorPosition={shiftedAnchorPosition}
>
<View onLayout={measurePopover}>{props.children}</View>
</Popover>
) : (
/*
This is an invisible view used to measure the size of the popover,
before it ever needs to be displayed.
We do this because we need to know its dimensions in order to correctly animate the popover,
but we can't measure its dimensions without first rendering it.
*/
<View
style={styles.invisible}
onLayout={measurePopover}
>
{props.children}
</View>
);

The invisible menu is put on top of the 3-dot menu icon which triggers the onMouseLeave of Hoverable.

Screen.Recording.2023-08-29.at.19.53.07.mov

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

Render the invisible menu off-screen by setting the left position to be -9999 for example (or windowWidth).

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Sep 7, 2023
@melvin-bot melvin-bot bot changed the title Tooltip flickers when click 3 dots menu on task report [$500] Tooltip flickers when click 3 dots menu on task report Sep 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

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

@puneetlath puneetlath changed the title [$500] Tooltip flickers when click 3 dots menu on task report [$250] Tooltip flickers when click 3 dots menu on task report Sep 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

Upwork job price has been updated to $250

@puneetlath
Copy link
Contributor

I'm going to reduce the bounty to $250 since this is a very minor design bug that a user is unlikely to notice.

Out of curiosity, why doesn't this happen with the global create menu?

image

@bernhardoj
Copy link
Contributor

Both the FAB button and its menu have a position: absolute, so the View parent has 0 height. This makes both FAB and menu rendered outside of the screen, but the FAB button is positioned using bottom and right which makes it impossible for both elements to overlap each other.

Screen.Recording.2023-09-08.at.00.09.14.mov

@spapierz
Copy link

spapierz commented Sep 8, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.
Tooltip flickers when clicking the three-dot menu

What is the root cause of that problem?

In React, layout and rendering can be affected by the nesting of components within <View> elements. Wrapping the PopoverMenu component in a <View> helps stabilize the layout and rendering, ensuring that it behaves as expected.

By enclosing the PopoverMenu within its own <View>, you create a clear separation between the button (the trigger) and the menu. This separation can prevent unexpected interactions between the two components, which is what causes the flashing or flickering.

What changes do you think we should make in order to solve the problem?
src > components > ThreeDotsMenu > index.js

wrap PopoverMenu with the <View> tag. – it works

            <View>
                <PopoverMenu
                    onClose={hidePopoverMenu}
                    isVisible={isPopupMenuVisible}
                    anchorPosition={anchorPosition}
                    anchorAlignment={anchorAlignment}
                    onItemSelected={hidePopoverMenu}
                    menuItems={menuItems}
                    withoutOverlay
                    anchorRef={buttonRef}
                />
            </View>

** Video of working solution **

three-dotted-menu-tooltip-bug-spapierz.mov

Sarah Papierz

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

📣 @spapierz! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@spapierz
Copy link

spapierz commented Sep 8, 2023

Contributor details
Your Expensify account email: sarah.papierz@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~017e3c2bd26318290f

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@puneetlath, @0xmiroslav Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@puneetlath, @0xmiroslav Whoops! This issue is 2 days overdue. Let's get this updated quick!

@puneetlath
Copy link
Contributor

@0xmiroslav thoughts on the proposals?

@melvin-bot melvin-bot bot removed the Overdue label Sep 11, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Sep 13, 2023

I don't think anyone provided the exact root cause. As seen in video, this issue doesn't happen on "Start a call" button but only 3 dots menu.

Screen.Recording.2023-09-13.at.7.28.33.PM.mov

Out of curiosity, why doesn't this happen with the global create menu?

Also, nobody answered to this question

@bernhardoj
Copy link
Contributor

@0xmiroslav I answered the FAB here. Start a call button doesn't use PopoverMenu.

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

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

@0xmiros
Copy link
Contributor

0xmiros commented Sep 14, 2023

@0xmiroslav I answered the FAB here. Start a call button doesn't use PopoverMenu.

Base component of both are Popover. Why can't we apply same solution if works on other popovers?

@bernhardoj
Copy link
Contributor

The issue is on PopoverWithMeasuredContent, not on the Popover

@spapierz
Copy link

spapierz commented Sep 14, 2023

@0xmiroslav –

After reevaluating this problem, I believe the issue lies within the functions that run outside of a controlled React component mounting lifecycle in the PopoverWithMeasuredContent.js file. The conditional logic responsible for measurement and visibility is floating within the function. This uncontrolled timing might not trigger at the right moment, potentially leading to inaccurate measurements and popover positioning. To ensure consistent behavior, we can address this by adding a useEffect that runs as early as the component mounts, handling the measurement and visibility checks reliably.

Here is the new proposed fix:

useEffect(() => {
    if (!isVisible && props.isVisible) {
        // When the popover is shown, recalculate
        setIsContentMeasured(props.popoverDimensions.width > 0 && props.popoverDimensions.height > 0);
        setIsVisible(true);
    } else if (isVisible && !props.isVisible) {
        setIsVisible(false);
    }
}, []);

This is consistent with the popover being used for the Start a Chat if you take a look in the BaseVideoChatButtonAndMenu.js file. you'll notice that the measurement logic is placed inside a useEffect that runs when the component mounts:

This organized approach ensures that the measurement and visibility checks are executed consistently and at the appropriate times.

This solves the flickering issue when clicking.

@0xmiros
Copy link
Contributor

0xmiros commented Sep 16, 2023

@bernhardoj's proposal looks good to me.
cc: @puneetlath
🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

📣 @0xmiroslav 🎉 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

📣 @bernhardoj 🎉 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 19, 2023
@bernhardoj
Copy link
Contributor

PR is ready

cc: @0xmiroslav

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

🎯 ⚡️ Woah @0xmiroslav / @bernhardoj, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @bernhardoj got assigned: 2023-09-18 18:04:08 Z
  • when the PR got merged: 2023-09-20 08:10:45 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 22, 2023
@melvin-bot melvin-bot bot changed the title [$250] Tooltip flickers when click 3 dots menu on task report [HOLD for payment 2023-09-29] [$250] Tooltip flickers when click 3 dots menu on task report Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-09-29. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@0xmiroslav] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@puneetlath] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@puneetlath
Copy link
Contributor

@0xmiroslav friendly reminder on the checklist so that we can pay this out later this week 🙂

@0xmiros
Copy link
Contributor

0xmiros commented Sep 25, 2023

BZ Checklist:

This came from combination of invisible view and Hoverable onMouseLeave callback in Tooltip.
Invisible view for popover position and size measurement was added in #1678 (2.5 years ago).
And there were several back and forth refactors of Tooltip so difficult to find offending PR. Also, not sure if issue always existed after tooltip implementation.

This is very minor and not worthy of adding regression test which should run every deploy.

@puneetlath
Copy link
Contributor

Payment summary:

@situchan - $50 for reporting (paid in Upwork)
@bernhardoj - $250 + $125 bonus (paid in Upwork)
@0xmiroslav - $250 + $125 bonus (to be tracked by @0xmiroslav separately)

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants