-
Notifications
You must be signed in to change notification settings - Fork 3k
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-05-25] [$1000] On click of ESC while 'copy URL to clipboard' popup is open, app closes both 'copy URL to clipboard' popup and RHN #18558
Comments
Triggered auto assignment to @mallenexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.We are trying to handle the escape key in a priority order. So the last modal opened should be the first one closed. What is the root cause of that problem?The problem is related to the whole right side modal, any open context menu will be closed along with the right side modal itself on escape press. What changes do you think we should make in order to solve the problem?When escape is pressed, we should check if the context menu is open and if it is we should prevent the modal from closing. There are 2 approaches to this Approach 1: Global changes (Suggested)We can update the isVisible() {
return this.state.isPopoverVisible
} and also add it to function isVisible() {
return contextMenuRef.current.isVisible();
} Now in the App/src/components/ScreenWrapper/index.js Line 44 in 2c3eec0
by updating it with this if (this.props.modal.willAlertModalBecomeVisible || ReportActionContextMenu.isVisible()) { This will correctly handle the escape listener. Additionally instead of just passing the visible state we can pass the current state from the function getCurrentState() {
return contextMenuRef.current.getCurrentState();
} so we can use this for much more conditional checks. Important: The above changes will focus the Approach 2: Local changesWe do local updates to the App/src/pages/settings/InitialSettingsPage.js Line 252 in 2c3eec0
with onSecondaryInteraction={!_.isEmpty(item.link) ? e => {
return ReportActionContextMenu.showContextMenu(
CONTEXT_MENU_TYPES.LINK,
e,
item.link,
this.popoverAnchor.current,
'0',
{},
'',
() => { /* context menu got opened: store bool in state */ },
() => { /* context menu got closed: update bool in state */},
)
} : undefined} and store state value for when context menu is opened/closed. Next we add a new prop App/src/components/ScreenWrapper/index.js Line 44 in 2c3eec0
we update the condition to check if we should prevent escape key from closing the modal if (this.props.modal.willAlertModalBecomeVisible || this.props.preventDismissOnEscKey) {
return
// ... Finally we have to pass the prop from the <ScreenWrapper
includeSafeAreaPaddingBottom={false}
preventDismissOnEscKey={ /* here we pass the state value stored earlier */ }
> What alternative solutions did you explore? (Optional)N/A |
@dhanashree-sawant and/or @huzaifa-99 , can you please document all areas of the app where this is happening so we can fix them at one time? I see two more instances here |
HI @mallenexpensify, Sure will go through it and let you know all the instances. |
@mallenexpensify, @dhanashree-sawant I was able to find these
All of these can be fixed by the |
Few more instances of the issue which @huzaifa-99 missed: |
Thanks for spotting @dhanashree-sawant. @mallenexpensify I did a quick test against the newly spotted areas, and |
Job added to Upwork: https://www.upwork.com/jobs/~01f4c841961ae2e365 |
Current assignee @mallenexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
Triggered auto assignment to @techievivek ( |
Thanks @huzaifa-99 and @dhanashree-sawant , teamwork!!! |
My proposal here solves this issue by actually fixing the root cause. |
@huzaifa-99 Thanks for the proposal. I don't think your RCA is complete. It seems that you are treating this bug as a feature request but it's actually a bug, the feature is already implemented on ScreenWrapper. |
@allroundexperts Thanks for the proposal. Your RCA is correct; We are missing the case where the modal is initially rendered visible. The suggested fix makes sense; Cover that case by calling I just have a non-blocking question, what cases would it cover calling 🎀 👀 🎀 C+ reviewed And please copy the proposal from the other issue to this for visibility. |
Thanks for your review @s77rt. |
@allroundexperts Yeah I got the idea. I'm asking if you can pinpoint a real existing case. I'm asking because although we mostly have 1 visible modal at a time, we may have n rendered modal at a time. If we are going to call |
@s77rt I'm not sure if I am following your question exactly but I'll take a shot. Even the context menu (as in this bug) is a real case. Without the function in unmount, when you'll press |
📣 @allroundexperts You have been assigned to this job by @techievivek! |
Not overdue. Job has been assigned to @allroundexperts |
PR created #18982 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.15-12 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-05-25. 🎊 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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
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:
|
Regression Test Proposal
|
@s77rt , @allroundexperts , @dhanashree-sawant can you please accept the job and reply here once you have? |
@mallenexpensify Accepted! |
Thanks @mallenexpensify, Accepted the offer. |
@mallenexpensify Accepted. |
Not overdue, we are waiting for the payment to complete. |
@dhanashree-sawant paid $250 for reporting, @s77rt and @allroundexperts paid $1500, including the 50% timeliness bonus. TestRail update GH Thanks all! |
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:
Expected Result:
App should only close 'copy URL to clipboard' popup on ESC click like it does for delete workspace popup
Actual Result:
App closes both 'copy URL to clipboard' popup and RHN on single ESC click
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?
Version Number: 1.3.11.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
Recording.520.mp4
on.esc.app.closes.both.RHN.and.copy.popup.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683388261937479
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: