Repository navigation
Migrate money request destination step to dynamic routes (#83850 part 1) - #96949
mjasikowski merged 3 commits into
Conversation
…3850 part 1) Migrate MONEY_REQUEST_STEP_DESTINATION (path `destination`, entry MONEY_REQUEST.CREATE) and MONEY_REQUEST_STEP_DESTINATION_EDIT (path `destination-edit`, entry STEP_CONFIRMATION) to dynamic routes, removing their static routes and the `backTo` param. - Rename IOURequestStepDestination -> DynamicIOURequestStepDestination; edit mode now derived from route.name, back path from useDynamicBackPath. - Forward entries use createDynamicRoute; cross-file goBack targets (Time, report selection) rebuild the absolute path via createDynamicRoute with the MONEY_REQUEST_CREATE base. - Add OldRoutes redirects + getMatchingNewRoute unit tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-07-28.at.15.14.33.movScreen.Recording.2026-07-28.at.15.15.42.mov |
|
🚧 mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.4.46-0 🚀
|
|
No help site changes are required for this PR. This is a pure internal navigation refactor — it migrates the per-diem money-request Destination step (and its edit variant) from static routes to dynamic URL navigation, renames a component ( The help site articles under No draft PR was created since no documentation changes are warranted, so there's no linked help site PR to review here. @suneox, if you believe a user-facing behavior did change and warrants a docs update, let me know and I'll create the draft PR. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Migrate the per-diem money-request Destination step (
MONEY_REQUEST_STEP_DESTINATION, wizard entry fromMONEY_REQUEST.CREATE) and its edit variant (MONEY_REQUEST_STEP_DESTINATION_EDIT, entry fromSTEP_CONFIRMATION) from static routes to dynamic URL navigation, removing thebackTo/backToReportparams. The step page is renamedIOURequestStepDestination→DynamicIOURequestStepDestination; edit mode is now derived fromroute.nameand the back path fromuseDynamicBackPath. Forward entries and cross-file goBack targets (Time step, report-selection step) rebuild the absolute path viacreateDynamicRouteon theMONEY_REQUEST_CREATEbase. OldRoutes redirects cover the legacy URLs, and the dynamic suffixes are namespacedper-diem-destination/per-diem-destination-edit(dynamic paths must be globally unique acrossDYNAMIC_ROUTES, since react-navigation flattens them — a baredestinationcollides with the existing Sage Intacct suffix). Part 1 of #83850 (Time/Subrate are Parts 2/3).Fixed Issues
$ #83850
PROPOSAL:
Tests
DYNAMIC_ROUTES.MONEY_REQUEST_STEP_DESTINATION— wizard destination step (non-edit)Case 1.1 — Workspace select → Destination (forward entry)
Target:
src/pages/iou/request/step/IOURequestStepPerDiemWorkspace.tsx:77Precondition: ≥2 per-diem workspaces (workspace selector is shown).
Steps:
Expected: The Destination step opens; URL ends with
/start/<txn>/<rpt>/per-diem-destination(no?backTo=), title is the tab title.Case 1.2 — Destination back (cut suffix → start)
Steps:
Expected: Returns to the Workspace select / Start screen (suffix
/per-diem-destinationstripped). No/not-found.Case 1.3 — Destination → Time (forward)
Target:
DynamicIOURequestStepDestination updateDestinationSteps:
Expected: Navigates to the Time step (Time is still static in Part 1 — must work normally).
Case 1.4 — Time back → Destination (cross-file goBack)
Target:
src/pages/iou/request/step/IOURequestStepTime.tsx:99Precondition: ≥2 per-diem workspaces (
hasMoreThanOnePolicyWithPerDiemEnabled), global create.Steps:
Expected: Returns to the dynamic Destination step; rates shown and selectable. No
/not-found.Case 1.5 — Report step policy change → Destination (new reportID)
Target:
useReportSelectionActions.ts:165Precondition: per-diem transaction (global create); select a report from a different policy.
Steps:
Expected: Goes back to Destination with the new reportID; subrates cleared; Destination shows the new policy's rates. No
/not-found.Case 1.6 — Deep-link / refresh + OldRoutes redirect
Steps:
/create/submit/destination/123/456.Expected: Redirects to⚠️ Legacy query (
/create/submit/start/123/456/per-diem-destination; Destination opens, stack restored (back → start).?backTo=) is not preserved (append-suffix, accepted — no call site produces a query anymore).DYNAMIC_ROUTES.MONEY_REQUEST_STEP_DESTINATION_EDIT— edit destination from ConfirmationCase 2.1 — Confirmation → edit Destination (forward entry)
Target:
src/components/MoneyRequestConfirmationList/sections/PerDiemFields.tsx:111Precondition: on the Confirmation step of a per-diem expense.
Steps:
Expected: Destination opens in edit mode, title = "Destination"; URL
/confirmation/<txn>/<rpt>/per-diem-destination-edit.Case 2.2 — Edit select → back to Confirmation
Steps:
Expected: Returns to Confirmation (suffix
/per-diem-destination-editstripped); destination updated; subrates cleared if the destination changed.Case 2.3 — Edit back button
Steps:
Expected: Returns to Confirmation, no change.
Case 2.4 — Deep-link edit + OldRoutes redirect
Steps:
/create/submit/destination/123/456/edit.Expected: Redirects to
/create/submit/confirmation/123/456/per-diem-destination-edit; edit mode opens on top of Confirmation.Offline tests
QA Steps
Test case 1: Open the per-diem Destination step from the workspace selector
/per-diem-destination(no?backTo=)./per-diem-destination.Test case 2: Edit the Destination from the per-diem confirmation screen
/per-diem-destination-edit./per-diem-destination-edit.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
CleanShot.2026-07-27.at.18.24.29.1.mp4
CleanShot.2026-07-27.at.18.29.57.1.mp4
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Case 1.1 — Workspace select → Destination (forward entry)
Case 1.2 — Destination back (cut suffix → start)
Case 1.3 — Destination → Time (forward)
Case 1.4 — Time back → Destination (cross-file goBack)
Case 1.5 — Report step policy change → Destination (new reportID)
Case 1.6 — Deep-link / refresh + OldRoutes redirect (non-edit)
Case 2.1 — Confirmation → edit Destination (forward entry)
Case 2.2 — Edit select → back to Confirmation
Case 2.3 — Edit back button
Case 2.4 — Deep-link edit + OldRoutes redirect