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 2024-06-06] [$250] Web - New search - Hold request education modal opens on the top left #42007

Closed
2 of 6 tasks
m-natarajan opened this issue May 10, 2024 · 32 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

@m-natarajan
Copy link

m-natarajan commented May 10, 2024

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: 1.4.72-1
Reproducible in staging?: y
Reproducible in production?: (this is happening in "test preferences")
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
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

Action Performed:

Precondition:

  • User has not held a request (so that Hold request education modal will appear after holding request).
  1. Go to staging.new.expensify.com
  2. Submit two expenses to a user.
  3. Go to one of the transaction threads.
  4. Click 3-dot menu > Hold request.
  5. Enter reason and save it.
  6. Do not click "Got it" on the education RHP. Instead, click on the back button.
  7. Go to Account settings > Troubleshoot.
  8. Click Navigate next to "New Search Page".
  9. Search for the held transaction in Step 4.
  10. Click View.

Expected Result:

Hold request education modal will show up as RHP.

Actual Result:

Hold request education modal opens on the top left.

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6477322_1715374043829.20240511_044053.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c80194fe29f72a2f
  • Upwork Job ID: 1790398130763456512
  • Last Price Increase: 2024-05-14
  • Automatic offers:
    • rojiphil | Reviewer | 0
    • ShridharGoel | Contributor | 0
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 10, 2024
Copy link

melvin-bot bot commented May 10, 2024

Triggered auto assignment to @joekaufmanexpensify (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.

@m-natarajan
Copy link
Author

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

@melvin-bot melvin-bot bot added the Overdue label May 13, 2024
@nkdengineer
Copy link
Contributor

nkdengineer commented May 13, 2024

Proposal

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

Hold request education modal opens on the top left.

What is the root cause of that problem?

We use Popover component here to show ProcessMoneyRequestHoldMenu so it doesn't show in RHP

function ProcessMoneyRequestHoldMenu({isVisible, onClose, onConfirm, anchorPosition, anchorAlignment}: ProcessMoneyRequestHoldMenuProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const popoverRef = useRef(null);
return (
<Popover

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

We should use Modal component instead of Popover

<Modal
    type={CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED}
    isVisible={isVisible}
    onClose={onClose}
    onModalHide={onClose}
    hideModalContentWhileAnimating
    useNativeDriver
    shouldUseModalPaddingStyle={false}
>

What alternative solutions did you explore? (Optional)

NA

@ShridharGoel
Copy link
Contributor

Proposal

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

On web, when using new search - Hold request education modal opens on the top left.

What is the root cause of that problem?

shouldUseNarrowLayout becomes true when isReportOpenInRHP is true.

const shouldUseNarrowLayout = isSmallScreenWidth || isReportOpenInRHP;

This leads to ProcessMoneyRequestHoldMenu being used in MoneyRequestHeader when the report is opened in RHP, while we should be navigating to PROCESS_MONEY_REQUEST_HOLD on web like it is being done when the report is normally opened.

{shouldUseNarrowLayout && shouldShowHoldMenu && (
<ProcessMoneyRequestHoldMenu
onClose={handleHoldRequestClose}
onConfirm={handleHoldRequestClose}
isVisible={shouldShowHoldMenu}
/>
)}
</>

The ProcessMoneyRequestHoldMenu is designed for small screen devices, it shouldn't be used on web.

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

Use isSmallScreenWidth instead of shouldUseNarrowLayout.

{(isSmallScreenWidth) && shouldShowHoldMenu && (
    <ProcessMoneyRequestHoldMenu
        onClose={handleHoldRequestClose}
        onConfirm={handleHoldRequestClose}
        isVisible={shouldShowHoldMenu}
    />
)}

We also need to update the useEffect to check isSmallScreenWidth and navigate based on that.

useEffect(() => {
    if (!shouldShowHoldMenu) {
        return;
    }

    if (isSmallScreenWidth) {
        if (Navigation.getActiveRoute().slice(1) === ROUTES.PROCESS_MONEY_REQUEST_HOLD) {
            Navigation.goBack();
        }
    } else {
        Navigation.navigate(ROUTES.PROCESS_MONEY_REQUEST_HOLD);
    }
}, [isSmallScreenWidth, shouldShowHoldMenu]);

This fixes the issue on web + makes sure that the hold education UI doesn't change on mobile.

@joekaufmanexpensify
Copy link
Contributor

Will triage today

@melvin-bot melvin-bot bot removed the Overdue label May 13, 2024
@dragnoir
Copy link
Contributor

dragnoir commented May 13, 2024

Proposal

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

Hold request education modal opens on the top left

What is the root cause of that problem?

Let's make sure about something first, we are here talking about two components:

1- ProcessMoneyRequestHoldMenu

This component is designed to be displayed only on small screens, it replace the Right Hand Panel educational window on scmall screens.

image

2- ProcessMoneyRequestHoldPage

This is the Right Hand Panel educational component. it's displayed only on large screens.

image

The issue

On the "New Search Page" when we open a report with a hold from Right Hand Panel.
On ReportScreen, the value shouldUseNarrowLayout is true

https://github.com/Expensify/App/blob/97097ff13b086c3d44d26d44335921323b211669/src/pages/home/ReportScreen.tsx#L167C11-L167C33

because isSmallScreenWidth is false but isReportOpenInRHP is true, so shouldUseNarrowLayout is true.

This value shouldUseNarrowLayout is true will be used here

<ProcessMoneyRequestHoldMenu
onClose={handleHoldRequestClose}
onConfirm={handleHoldRequestClose}
isVisible={shouldShowHoldMenu}
/>

where it should be opened only on small screens, it's now open when the report is on Right Hand Panel because the condition isSmallScreenWidth || isReportOpenInRHP

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

1- Fix ProcessMoneyRequestHoldMenu

We should not allow ProcessMoneyRequestHoldMenu to be displayed on Right Hand Panel and fix the value here

{shouldUseNarrowLayout && shouldShowHoldMenu && (
<ProcessMoneyRequestHoldMenu
onClose={handleHoldRequestClose}
onConfirm={handleHoldRequestClose}
isVisible={shouldShowHoldMenu}
/>
)}

We can use isSmallScreenWidth instead of shouldUseNarrowLayout

2- Fix ProcessMoneyRequestHoldPage

We need to allow ProcessMoneyRequestHoldPage to be displayed on Right Hand Panel

We can use isSmallScreenWidth instead of shouldUseNarrowLayout here

if (shouldUseNarrowLayout) {
if (Navigation.getActiveRoute().slice(1) === ROUTES.PROCESS_MONEY_REQUEST_HOLD) {
Navigation.goBack();
}
} else {
Navigation.navigate(ROUTES.PROCESS_MONEY_REQUEST_HOLD);
}
}, [shouldUseNarrowLayout, shouldShowHoldMenu]);

POC video:

20240513_184436.mp4

@joekaufmanexpensify joekaufmanexpensify added the External Added to denote the issue can be worked on by a contributor label May 14, 2024
@melvin-bot melvin-bot bot changed the title Web - New search - Hold request education modal opens on the top left [$250] Web - New search - Hold request education modal opens on the top left May 14, 2024
Copy link

melvin-bot bot commented May 14, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 14, 2024
Copy link

melvin-bot bot commented May 14, 2024

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

@joekaufmanexpensify
Copy link
Contributor

waiting for review of proposals

@rojiphil
Copy link
Contributor

@dragnoir How is your proposal different from this one here?

@dragnoir
Copy link
Contributor

@dragnoir How is your proposal different from this one here?

it's the same, I didn't notice 😅

@rojiphil
Copy link
Contributor

Thanks all for your proposals.
@ShridharGoel proposal LGTM as that was the first one to have the correct RCA and solution.
🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented May 15, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 15, 2024
Copy link

melvin-bot bot commented May 15, 2024

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

Copy link

melvin-bot bot commented May 15, 2024

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

@joekaufmanexpensify
Copy link
Contributor

@ShridharGoel is there an ETA for PR here?

@ShridharGoel
Copy link
Contributor

Will open PR today

@melvin-bot melvin-bot bot added the Overdue label May 18, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels May 18, 2024
@joekaufmanexpensify
Copy link
Contributor

Great. TY!

@joekaufmanexpensify
Copy link
Contributor

PR in review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 30, 2024
@melvin-bot melvin-bot bot changed the title [$250] Web - New search - Hold request education modal opens on the top left [HOLD for payment 2024-06-06] [$250] Web - New search - Hold request education modal opens on the top left May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.77-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 2024-06-06. 🎊

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

Copy link

melvin-bot bot commented May 30, 2024

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:

  • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR: [Search v1] Add ReportScreen to RHP #40570
  • [@rojiphil] 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: https://github.com/Expensify/App/pull/40570/files#r1631231021
  • [@rojiphil] 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: Not Required. Existing checklist is good enough to capture such issues.
  • [@rojiphil] Determine if we should create a regression test for this bug.
  • [@rojiphil] 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.
  • [@joekaufmanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: N/A

@joekaufmanexpensify
Copy link
Contributor

@rojiphil could you handle BZ so we can issue payment this week?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 6, 2024
@joekaufmanexpensify
Copy link
Contributor

bump @rojiphil , we're all set to issue payment here as soon as checklist is done

@rojiphil
Copy link
Contributor

rojiphil commented Jun 7, 2024

  • [@rojiphil] The PR that introduced the bug has been identified. Link to the PR: Offending PR
  • [@rojiphil] 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: Added comment
  • [@rojiphil] 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: Not Required. Existing checklist is good enough to capture such issues.
  • [@rojiphil] Determine if we should create a regression test for this bug. : Not a change prone area or high usage area as this occurs only when the held report is in RHP on large screen devices. We can skip adding a regression test for this.
  • [@rojiphil] 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.

@rojiphil
Copy link
Contributor

rojiphil commented Jun 7, 2024

@joekaufmanexpensify Accepted offer and completed BZ. Thanks

@joekaufmanexpensify
Copy link
Contributor

TY!

@joekaufmanexpensify
Copy link
Contributor

All set to issue payment. We need to pay:

@joekaufmanexpensify
Copy link
Contributor

@rojiphil $250 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@ShridharGoel please accept upwork offer so we can pay you

@melvin-bot melvin-bot bot added the Overdue label Jun 10, 2024
@joekaufmanexpensify
Copy link
Contributor

@ShridharGoel $250 sent and contract ended!

@melvin-bot melvin-bot bot removed the Overdue label Jun 10, 2024
@joekaufmanexpensify
Copy link
Contributor

All set. 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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants