Skip to content

[HOLD for payment 2024-06-06] [$250] Web - New search - Hold request education modal opens on the top left #42007

Closed

Description

@m-natarajan

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

Activity

  1. added
    Daily
    Bug
    on May 10, 2024
  2. melvin-bot commented on May 10, 2024

    @melvin-bot

    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.

  3. m-natarajan commented on May 10, 2024

    @m-natarajan
    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

  4. nkdengineer commented on May 13, 2024

    @nkdengineer
    Contributor

    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

  5. ShridharGoel commented on May 13, 2024

    @ShridharGoel
    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.

  6. joekaufmanexpensify commented on May 13, 2024

    @joekaufmanexpensify
    Contributor

    Will triage today

  7. dragnoir commented on May 13, 2024

    @dragnoir
    Contributor

    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
  8. added
    External
    on May 14, 2024
  9. 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[/+] on May 14, 2024
  10. melvin-bot commented on May 14, 2024

    @melvin-bot
  11. 32 remaining items

  12. added
    Daily
    and removed
    Weekly
    on Jun 6, 2024
  13. joekaufmanexpensify commented on Jun 6, 2024

    @joekaufmanexpensify
    Contributor

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

  14. rojiphil commented on Jun 7, 2024

    @rojiphil
    Contributor
    • [@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.
  15. rojiphil commented on Jun 7, 2024

    @rojiphil
    Contributor

    @joekaufmanexpensify Accepted offer and completed BZ. Thanks

  16. joekaufmanexpensify commented on Jun 7, 2024

    @joekaufmanexpensify
    Contributor

    TY!

  17. joekaufmanexpensify commented on Jun 7, 2024

    @joekaufmanexpensify
    Contributor

    All set to issue payment. We need to pay:

  18. joekaufmanexpensify commented on Jun 7, 2024

    @joekaufmanexpensify
    Contributor

    @rojiphil $250 sent and contract ended!

  19. joekaufmanexpensify commented on Jun 7, 2024

    @joekaufmanexpensify
    Contributor

    @ShridharGoel please accept upwork offer so we can pay you

  20. joekaufmanexpensify commented on Jun 10, 2024

    @joekaufmanexpensify
    Contributor

    @ShridharGoel $250 sent and contract ended!

  21. joekaufmanexpensify commented on Jun 10, 2024

    @joekaufmanexpensify
    Contributor

    All set. Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions