Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.12k stars 2.61k forks source link

[$250] mWeb-Distance rate-From more features page tapping back directed to distance rate #43755

Open lanitochka17 opened 3 weeks ago

lanitochka17 commented 3 weeks ago

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.83 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:

  1. Go to https://staging.new.expensify.com/home
  2. Tap profile icon -- Workspaces -- Workspace
  3. Tap more features
  4. Toggle on distance rate
  5. Tap settings
  6. Tap more features link
  7. Tap app back button

Expected Result:

From more features page tapping back user must be directed to settings page

Actual Result:

From more features page tapping back user directed to distance rate instead settings

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/992778dd-b05c-43c4-b23e-a91bed2b75d9

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01dbdf127f2f018440
  • Upwork Job ID: 1803050291810403386
  • Last Price Increase: 2024-06-18
  • Automatic offers:
    • dominictb | Contributor | 102856221
melvin-bot[bot] commented 3 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

@sonialiap Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

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

dominictb commented 2 weeks ago

Proposal

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

From more features page tapping back user directed to distance rate instead settings

What is the root cause of that problem?

In https://github.com/Expensify/App/blob/main/src/pages/workspace/distanceRates/PolicyDistanceRatesSettingsPage.tsx#L143-L144, the app uses navigate so the Distance Rate page will still remain in the navigation stack, so when go back it will go back to it.

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

Replace https://github.com/Expensify/App/blob/main/src/pages/workspace/distanceRates/PolicyDistanceRatesSettingsPage.tsx#L143-L144 with

Navigation.goBack(ROUTES.WORKSPACE_MORE_FEATURES.getRoute(policyID));

Doing it this way will make sure the Distance Rate page was popped from the navigation stack and when going back from More Features page, it will correctly go back to the Settings page

Optional: 2nd param shouldEnforceFallback could be put as true

What alternative solutions did you explore? (Optional)

Use Navigation.resetToHome(); to reset the navigation state correctly, after that navigate to the more features page So this will be updated to

Navigation.resetToHome();
Navigation.navigate(ROUTES.WORKSPACE_MORE_FEATURES.getRoute(policyID));

Another idea is to manually pop the navigation route until we meet the Settings page (can be as simple as going back twice first), then navigate to more features page

dominictb commented 2 weeks ago

I updated proposal to add an alternative solution.

mananjadhav commented 2 weeks ago

Will review this today. Will need to check the current navigation screens.

mananjadhav commented 2 weeks ago

I think @dominictb's solution would work using goBack.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 1 week ago

πŸ“£ @dominictb πŸŽ‰ 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 πŸ“–