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-10-24] [$500] Web - App keeps both right click LHN popup and delete message popup open together #28324

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

Comments

@izarutskaya
Copy link

izarutskaya commented Sep 27, 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. Open the app
  2. Open any report
  3. Focus on composer
  4. Right on any report in LHN to open right click LHN popup
  5. Type anything and press enter to send
  6. Click up arrow to edit the sent message
  7. Remove all content using backspace and click enter
  8. Observe that app does not close right click LHN popup and opens delete popup too along with it.

Expected Result:

App should close existing open popup on opening any other popup in the app

Actual Result:

App keeps both right click LHN popup and delete popup open together

Workaround:

Unknown

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: v1.3.74-2

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

windows.chrome.both.right.click.LHN.and.delete.popup.open.together.mp4
mac.chrome.desktop.right.click.LHN.and.delete.popup.open.together.mov
20230927_195554.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695654750958139

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b7d70b5aeb6fba4a
  • Upwork Job ID: 1707062073662357504
  • Last Price Increase: 2023-09-27
  • Automatic offers:
    • jjcoffee | Reviewer | 27017549
    • Dhanashree-Sawant | Reporter | 27017552
Issue OwnerCurrent Issue Owner: @dylanexpensify
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 27, 2023
@melvin-bot melvin-bot bot changed the title Web - App keeps both right click LHN popup and delete message popup open together [$500] Web - App keeps both right click LHN popup and delete message popup open together Sep 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

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

melvin-bot bot commented Sep 27, 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

@ikevin127
Copy link
Contributor

ikevin127 commented Sep 27, 2023

Proposal

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

App keeps both right click LHN popup and delete popup open together.

What is the root cause of that problem?

The problem is that within the PopoverReportActionContextMenu.js component, the LHN popup is not being closed before the delete message popup is opened.

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

Within the PopoverReportActionContextMenu.js component I called the hideContextMenu function within the showDeleteModal function which makes sure the LHN popup is closed before the delete message popup is being opened:

   const showDeleteModal = (reportID, reportAction, shouldSetModalVisibility = true, onConfirm = () => {}, onCancel = () => {}) => {
        onCancelDeleteModal.current = onCancel;
        onComfirmDeleteModal.current = onConfirm;

        reportIDRef.current = reportID;
        reportActionRef.current = reportAction;

-        setShouldSetModalVisibilityForDeleteConfirmation(shouldSetModalVisibility);
-        setIsDeleteCommentConfirmModalVisible(true);
+        hideContextMenu(() => {
+            setShouldSetModalVisibilityForDeleteConfirmation(shouldSetModalVisibility);
+            setIsDeleteCommentConfirmModalVisible(true);
+        });
    };

What alternative solutions did you explore? (Optional)

A different way to go about this would be to add an event listener for keydown such that whenever specific keyboard interactions are performed outside of LHN and the LHN popup is open we would close it by calling hideContextMenu.

Videos

web.mp4

@astrohunter62
Copy link
Contributor

astrohunter62 commented Sep 27, 2023

Proposal

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

The LHN does not receive focus when clicking on it.

What is the root cause of that problem?

In the OptionRowLHN, default actions are prevented when the mouse is clicked.

onMouseDown={(e) => {
if (!e) {
return;
}
// Prevent losing Composer focus
e.preventDefault();
}}

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

We can add DomUtils.blurActiveElement() into the onSecondaryInteraction within OptionRowLHN.

onSecondaryInteraction={(e) => showPopover(e)}

And adding ReportActionComposeFocusManager.focus(); to this point to ensure that the ReportActionComposer is in focus.

const closePopover = React.useCallback((anchorRef) => {
if (!activePopoverRef.current || (anchorRef && anchorRef !== activePopoverRef.current.anchorRef)) {
return;
}
activePopoverRef.current.close();
activePopoverRef.current = null;
setIsOpen(false);
}, []);

Results:

28324.safari.webm
28324.chrome.webm

What alternative solutions did you explore? (Optional)

If you prefer not to have this behavior, you have the option to call the hideContextMenu function within the showDeleteModal function to ensure the LHN popup is closed before opening the delete message popup.

@kaushiktd
Copy link
Contributor

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

The LHN popup is still open after opening the delete message popup.

What is the root cause of that problem?

The root cause of the issue is in the file PopoverReportActionContextMenu.js, within the showDeleteModel function. The issue occurs because the delete modal is opened without closing it first, resulting in both the delete modal and any previously open popups remaining visible simultaneously.

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

Add this line of code which closes LHN popup before opening the delete popup
https://github.com/Expensify/App/blob/main/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.js#L264

if (this.state.isPopoverVisible) {
            this.hideContextMenu();
     }

Video:-

https://drive.google.com/file/d/1ifmq4_JOlrPy7gMaT7ahxPTgGQuQRFMl/view?usp=sharing

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

@jjcoffee, @dylanexpensify Huh... This is 4 days overdue. Who can take care of this?

@dylanexpensify
Copy link
Contributor

@jjcoffee mind giving these proposals a review today?

@melvin-bot melvin-bot bot removed the Overdue label Oct 3, 2023
@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 4, 2023

Oh I'm sorry, not sure how this one slipped past me! Reviewing today!

@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 4, 2023

Looks like the correct RCA here is in @astrohunter62's proposal, as we are always keeping focus on the composer when we should be defocusing since we're opening the right click menu.

It looks like this is a regression from this PR, which was attempting to ensure that the composer refocuses when clicking an already-open chat in the LHN. So, we want to keep that behaviour but right clicking LHN should lose focus from composer.

Could you update your proposal based on the above @astrohunter62? Also a side-note, can you please link to the code snippet you mention in your proposal - makes it much easier to review!

The other two proposals are decent, but miss out because of not identifying the correct RCA.

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

@astrohunter62
Copy link
Contributor

@jjcoffee
I updated my proposal #28324 (comment)

@jjcoffee
Copy link
Contributor

jjcoffee commented Oct 4, 2023

@astrohunter62 Perfect, thanks! I think the code block you're proposing to remove would cause a regression from this PR though.

@astrohunter62
Copy link
Contributor

astrohunter62 commented Oct 4, 2023

@jjcoffee Thank you.
If you prefer not to remove it, you can alternatively insert DomUtils.blurActiveElement(); into the onSecondaryInteraction within OptionRowLHN.

onSecondaryInteraction={(e) => {
    showPopover(e);
    DomUtils.blurActiveElement();  // add
}}

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

melvin-bot bot commented Oct 4, 2023

📣 @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

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

📣 @astrohunter62 You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@astrohunter62
Copy link
Contributor

@jjcoffee Can you review this PR?

@jjcoffee
Copy link
Contributor

Fix is merged!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 17, 2023
@melvin-bot melvin-bot bot changed the title [$500] Web - App keeps both right click LHN popup and delete message popup open together [HOLD for payment 2023-10-24] [$500] Web - App keeps both right click LHN popup and delete message popup open together Oct 17, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 17, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.85-4 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-10-24. 🎊

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 Oct 17, 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:

  • [@jjcoffee] The PR that introduced the bug has been identified. Link to the PR:
  • [@jjcoffee] 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:
  • [@jjcoffee] 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:
  • [@jjcoffee] Determine if we should create a regression test for this bug.
  • [@jjcoffee] 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.
  • [@dylanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@astrohunter62
Copy link
Contributor

@jjcoffee Hi,
When can I get an offer?

@jjcoffee
Copy link
Contributor

Regression test proposal

  1. Open any report and click on the composer to focus it.
  2. Right click on any report in LHN to open the context menu.
  3. Verify that the composer loses focus.
  4. Click on the same chat in LHN and verify that the composer regains focus.

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

@astrohunter62 Payment will be coming soon as I've now completed the checklist! cc @dylanexpensify 🙇

@dylanexpensify
Copy link
Contributor

Payment summary:

Please request money or apply to upwork job!

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@dylanexpensify
Copy link
Contributor

@astrohunter62 sent offer!

@dhanashree-sawant and @jjcoffee payment sent!

@jjcoffee
Copy link
Contributor

@dylanexpensify Oops! Looks like you overpaid (I received $500) - is there anything I can do my end?

@astrohunter62
Copy link
Contributor

@dylanexpensify
I have sent my work. Could you approve it?

@melvin-bot melvin-bot bot added the Overdue label Nov 1, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

@MariaHCD, @jjcoffee, @dylanexpensify, @astrohunter62 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@dylanexpensify
Copy link
Contributor

@jjcoffee ah I requested half back for you to refund! It was easier than sending a new offer, waiting for you to accept, etc. haha! @astrohunter62 looking now!

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@dylanexpensify
Copy link
Contributor

payments sent!

@jjcoffee
Copy link
Contributor

jjcoffee commented Nov 6, 2023

@dylanexpensify Oooh, interesting, for some reason Upwork didn't send a notification with the refund request. Refunded now!

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants