You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-12-03] [$250] Composer - Emoji picker does not open when opening context menu and clicking emoji picker #51114
Version Number: 9.0.51-1 Reproducible in staging?: Y Reproducible in production?: N Issue was found when executing this PR:#50974 Email or phone of affected tester (no customers):applausetester+kh081006@applause.expensifail.com Issue reported by: Applause Internal Team
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
Emoji picker doesn't show when we open emoji picker first, and then context menu, and then emoji picker button again.
What is the root cause of that problem?
When we open the emoji picker and then context menu, you can notice that the emoji picker button tooltip won't show. It's because isPopoverRelatedToTooltipOpen is not updated properly.
isPopoverRelatedToTooltipOpen tells whether the tooltip element contains/is the same as the visible/active popover anchor. It's to prevent the tooltip of a button that shows the popover from showing while the popover is active. For example, if we open the emoji picker, the emoji picker button tooltip won't show.
So, currently, isPopoverRelatedToTooltipOpen for the emoji picker button is true. When we press the emoji picker button again, isPopoverRelatedToTooltipOpen will update from true to false (because the context menu is closed) which will re-render the emoji picker button, so the press/click event is never received.
When we open an emoji picker and then the context menu, the isOpen state of the popover stays true, so the memo is not recalculated.
What changes do you think we should make in order to solve the problem?
We need to create a new state to store the active popover to re-trigger the isPopoverRelatedToTooltipOpen memo. Because we only want to get the anchor ref, we can store the anchor ref only to the state instead of the whole popover element.
This doesn't happen in prod because, in prod, you can't open the chat context menu while an emoji picker is visible. But this issue happens in prod if you open the LHN context menu. So, I posted my proposal above because it's an existing issue.
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] 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:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: Not Required
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test should only be on large screen view (Web/Desktop)
Activity
melvin-bot commentedon Oct 19, 2024
Triggered auto assignment to @MonilBhavsar (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Oct 19, 2024
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Oct 19, 2024
Triggered auto assignment to @MitchExpensify (
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.github-actions commentedon Oct 19, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
bernhardoj commentedon Oct 19, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Emoji picker doesn't show when we open emoji picker first, and then context menu, and then emoji picker button again.
What is the root cause of that problem?
When we open the emoji picker and then context menu, you can notice that the emoji picker button tooltip won't show. It's because
isPopoverRelatedToTooltipOpenis not updated properly.App/src/components/Tooltip/PopoverAnchorTooltip.tsx
Lines 11 to 32 in 66cf824
isPopoverRelatedToTooltipOpentells whether the tooltip element contains/is the same as the visible/active popover anchor. It's to prevent the tooltip of a button that shows the popover from showing while the popover is active. For example, if we open the emoji picker, the emoji picker button tooltip won't show.So, currently,
isPopoverRelatedToTooltipOpenfor the emoji picker button is true. When we press the emoji picker button again,isPopoverRelatedToTooltipOpenwill update fromtruetofalse(because the context menu is closed) which will re-render the emoji picker button, so the press/click event is never received.App/src/components/Tooltip/PopoverAnchorTooltip.tsx
Lines 27 to 38 in 66cf824
isPopoverRelatedToTooltipOpendoesn't update properly because it depends on a (active popover) ref (other than the isOpen state).App/src/components/Tooltip/PopoverAnchorTooltip.tsx
Line 25 in 66cf824
When we open an emoji picker and then the context menu, the
isOpenstate of the popover stays true, so the memo is not recalculated.What changes do you think we should make in order to solve the problem?
We need to create a new state to store the active popover to re-trigger the
isPopoverRelatedToTooltipOpenmemo. Because we only want to get the anchor ref, we can store the anchor ref only to the state instead of the whole popover element.App/src/components/Tooltip/PopoverAnchorTooltip.tsx
Line 19 in 66cf824
First, in PopoverProvider, create the new state.
App/src/components/PopoverProvider/index.tsx
Lines 21 to 24 in 66cf824
Then, set the popover anchor state when a popover is shown.
App/src/components/PopoverProvider/index.tsx
Lines 105 to 111 in 66cf824
Clear it here too.
App/src/components/PopoverProvider/index.tsx
Lines 25 to 32 in 66cf824
Then, pass the state to the context value,
App/src/components/PopoverProvider/index.tsx
Lines 116 to 124 in 66cf824
Last, replace all
popover.anchorRef.currenttopopoverAnchor.App/src/components/Tooltip/PopoverAnchorTooltip.tsx
Lines 8 to 25 in 66cf824
bernhardoj commentedon Oct 19, 2024
This doesn't happen in prod because, in prod, you can't open the chat context menu while an emoji picker is visible. But this issue happens in prod if you open the LHN context menu. So, I posted my proposal above because it's an existing issue.
web.mp4
MonilBhavsar commentedon Oct 21, 2024
@bernhardoj looks like it is coming from regression from this PR #50974?
49 remaining items
melvin-bot commentedon Dec 6, 2024
@MonilBhavsar, @MitchExpensify, @bernhardoj, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
MitchExpensify commentedon Dec 7, 2024
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
MitchExpensify commentedon Dec 7, 2024
@shubham1206agra please complete the BZ steps above and accept this offer: https://www.upwork.com/nx/wm/offer/105238174
bernhardoj commentedon Dec 8, 2024
Requested in ND.
JmillsExpensify commentedon Dec 9, 2024
Waiting on the payment summary.
melvin-bot commentedon Dec 11, 2024
@MonilBhavsar, @MitchExpensify, @bernhardoj, @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!
MitchExpensify commentedon Dec 11, 2024
Payment summary:
Reminder about the BZ steps, @shubham1206agra : #51114 (comment)
shubham1206agra commentedon Dec 11, 2024
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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: Fix when emoji picker is opened, right-clicking on message opens and closes context menu #50974 (comment)
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: Not Required
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
JmillsExpensify commentedon Dec 11, 2024
$250 approved for @bernhardoj
shubham1206agra commentedon Dec 12, 2024
@JmillsExpensify Can you pay me here https://www.upwork.com/nx/wm/offer/105238174?
MitchExpensify commentedon Dec 13, 2024
Paid and contract ended @shubham1206agra