-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2024-09-07][$250] Chat - Messages stuck highlighted when opening context menus consecutively #45524
Comments
Triggered auto assignment to @anmurali ( |
@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 |
We think that this bug might be related to #vip-vsp |
ProposalPlease re-state the problem that we are trying to solve in this issue.Messages stuck highlighted when opening context menus consecutively What is the root cause of that problem?App/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts Lines 128 to 133 in 9c509a0
if there is an already open context menu, we don't wait until the What changes do you think we should make in order to solve the problem?make showContextMenu and hideContextMenu functions RESULT New-Expensify.19.mp4What alternative solutions did you explore? (Optional) |
@anmurali Eep! 4 days overdue now. Issues have feelings too... |
ProposalPlease re-state the problem that we are trying to solve in this issue.Message background is stuck when open context menu while other context menu is showing. What is the root cause of that problem?When we open a context menu, we pass a show and hide callback to the popover. App/src/pages/home/report/ReportActionItem.tsx Lines 357 to 358 in 1084706
Show callback will set the context menu active to true, while the hide callback will toggle the context menu and set it based on the context menu visibility. When we open the first context menu and then open the second one, the hide callback of the first and second context menus is called. The hide callback is cleared when called. Why the hide callback is called twice? When we open a context menu, if an existing context menu is found, it will hide it first. App/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts Lines 126 to 133 in 1084706
hideContextMenu() will set the context menu visibility to false while runAndResetOnPopoverHide() triggers the hide callback (1st hide callback). Because we set the visibility to false, the context menu popover onModalHide is triggered, calling another runAndResetOnPopoverHide().
What changes do you think we should make in order to solve the problem?If we look at the popover without overlay initial implementation, they face this problem before and that's why they added the code to close the current context menu before opening a new one in this commit. App/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts Lines 126 to 133 in 1084706
But if you notice in the commit, we only call But in this resolve conflict commit, they added Why does the double hide callback happen now? I'm pretty sure it's because the component has gone through several changes. For example, if you move the setting visibility to true here
to outside the promise, then the double hide callback won't happen since There solution is to wait until the current context menu is completely hidden before opening a new one.
Also, there is another bug where the popover instance ID is never cleared, so App/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx Lines 241 to 245 in 5005f59
|
@anmurali Still overdue 6 days?! Let's take care of this! |
@anmurali 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it! |
@anmurali this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
@anmurali 12 days overdue. Walking. Toward. The. Light... |
Job added to Upwork: https://www.upwork.com/jobs/~010fad7b2cd94a8560 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 ( |
Will be on my review list this tomorrow |
@nyomanjyotisa I don't think we allow using |
@bernhardoj Can you provide a little bit more about the code snippet that you mentioned here? TIA
|
"// show context menu" is the showContextMenu code. App/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts Lines 133 to 152 in 5005f59
So, it will look like this
|
I see. I don't think it works, I still can reproduce this issue. Screen.Recording.2024-08-02.at.09.59.14.mov |
Edited by proposal-police: This proposal was edited at 2024-08-03 02:42:43 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Chat messages stuck highlighted when opening context menus consecutively What is the root cause of that problem?App/src/components/PopoverWithoutOverlay/index.tsx Lines 50 to 62 in 5005f59
There is race codition when calling onModalHide for previous popoverWithouOverlay. So when on second right click, the popoverWithoutOverlay will call onModalHide using What changes do you think we should make in order to solve the problem?Actually we can store the instanceID in App/src/components/PopoverWithoutOverlay/index.tsx Lines 52 to 55 in 459759d
add parameter
then add getContextInstanceID function in PopoverProvider: const getContextInstaceID = () => {
return instanceIDRef.current;
}; then in isVisible false of The complete code is in testbranch. |
true |
@hungvu193 Here is the test branch / code changes. Result: macos-web-d.mp4 |
@hungvu193 I found that the App/src/pages/home/report/ContextMenu/ReportActionContextMenu.ts Lines 128 to 129 in 5005f59
I have updated my proposal to fix that too. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
ignore this, my bad. Should have set the |
@anmurali The second attempt was deployed to prod 8 days ago. This issue is now ready for payment |
I think this issue behooves a regression test? |
Regression Test:
Do we 👍 or 👎 ? |
@anmurali Can you please handle the payment summary here? Ty 😄 |
This was deployed to prod on 2024-08-30 so is definitely ready for payment. Marking it as such |
@anmurali, @hungvu193, @roryabraham, @bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
1 similar comment
@anmurali, @hungvu193, @roryabraham, @bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@hungvu193 is paid |
@anmurali I've requested in ND. |
Can I get a payment summary with the amount for @bernhardoj? |
@anmurali, @hungvu193, @roryabraham, @bernhardoj Huh... This is 4 days overdue. Who can take care of this? |
Payment summary
|
$250 approved for @bernhardoj |
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.7-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The second clicked message should not be highlighted
Actual Result:
The second clicked message remains highlighted
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6544401_1721161832467.2024-07-16_16-45-49.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @anmuraliThe text was updated successfully, but these errors were encountered: