Repository navigation
Migrate split expense routes to dynamic URL navigation - #98945
mjasikowski merged 4 commits into
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f68c475c1e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…-request-part-6-part-2-suneox
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-21.at.13.08.43.mov |
|
🚧 mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.4.59-0 🚀
|
Help site review — no changes requiredI reviewed the changes in this PR against Expensify's help site files under Why: This PR is an internal navigation refactor. It migrates the split expense routes to dynamic URL navigation (
Since no user-facing behavior changed, no draft docs PR was created (and there is therefore no linked help site PR to review). |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.59-5 🚀
Bundle Size Analysis (Sentry): |
|
ping @suneox for comment: #98945 (comment) |
@jponikarchuk Issue #99265 was not introduced by this PR and has already been resolved by this PR |
Explanation of Change
Part 2 of #83853 migrates the split expense routes to dynamic URL navigation:
SPLIT_EXPENSE→split-expense-overview,SPLIT_EXPENSE_SEARCH→split-expense-overview-searchandSPLIT_EXPENSE_CREATE_DATE_RANGE→split-expense-create-date-range. The screen a flow was opened from now lives in the URL itself instead of abackToparam, which also retires theTODO: Remove backTo from route once we have find another way to fix navigation issues with tabsworkaround: both overview routes keep hosting the amount/percentage/date tab navigator, and their tab paths stay nested under the dynamic pattern (noexact: true) becauseamountanddateare not globally unique patterns on their own.Fixed Issues
$ #83853
PROPOSAL:
Tests
Group 1 —
MONEY_REQUEST_SPLIT_EXPENSE(split-expense-overview)Case 1.1 — Entry via "Amount • Split" chip (edit mode)
Target:
src/components/ReportActionItem/MoneyRequestView.tsx:1213Precondition: A transaction thread whose expense is already split (≥ 2 split children) → split indicator shows on the Amount row.
Steps:
/<base>/split-expense-overview?splitReportID=<id>&transactionID=<id>&splitExpenseTransactionID=<id>; nobackToadded by the dynamic route.Expected: Suffix + all three query params present; no NotFound.
Case 1.2 — Entry via header ⋮ menu → Split
Target:
src/components/MoneyRequestHeaderSecondaryActions.tsx:397Precondition: Open expense report with exactly 1 splittable expense; user is submitter; policy expense chat enabled.
Steps:
<base>/split-expense-overview/amount?splitReportID=…&transactionID=…(initial-split mode includes the tab segment).Expected: Split overview renders, correct suffix + query, no
backToadded by the route.Case 1.3 — Back from overview
Steps: From the overview, tap Back (←). Verify it returns to the source screen with suffix + dynamic query params stripped cleanly.
Case 1.4 — Refresh restores overview + active tab
Steps: Switch to the Percentage tab (URL gains
/percentage) → F5 → verify the overview restores with Percentage tab active → Back returns to the source screen.Case 1.5 — Tab switch updates URL segments
Steps: Switch Amount → Percentage → Date. Verify each tab corresponds to a URL segment (
/percentage,/date), query params preserved, and switching tabs does not pop the screen (back stack intact).Case 1.6 — Cold deep-link in a new tab
Steps: Paste the overview URL (with
/percentage) into a new tab → verify it boots straight into the Split overview with the right tab, no NotFound, and Back goes to the source screen.Case 1.7 — Row tap → SPLIT_EXPENSE_EDIT → back to dynamic overview
Target:
src/pages/iou/DynamicSplitExpensePage.tsx:624Precondition: An existing split (overview in edit mode with rows).
Steps:
/edit/split-expense/overview/...?backTo=<encoded dynamic overview URL>.splitExpenseTransactionID).Case 1.8 — Delete-last-child redirect into edit flow
Target:
src/libs/actions/SplitExpenses.ts:130Precondition:⚠️ Redirect only triggers for per-diem split sources (guard
shouldRedirectDeleteToSplitExpenseEditrequiresisPerDiemRequest). Split a per-diem expense first.Steps:
backTodecodes to the dynamic overview URL (…/split-expense-overview?splitReportID=…&transactionID=…), not the legacy static path.Case 1.9 — Legacy overview URL → NotFound
Steps: Navigate to
/create/split-expense/overview/<reportID>/<transactionID>/<splitTxnID>/<backTo>→ verify graceful "Oops, this page cannot be found" + "Go back to home page" (accepted regression; no redirect added in this PR).Group 2 —
MONEY_REQUEST_SPLIT_EXPENSE_SEARCH(split-expense-overview-search)Case 2.1 — Entry via Search bulk action
Target:
src/hooks/useSearchBulkActions.ts:2575Steps:
/search/split-expense-overview-search/amount?q=<search query>&splitReportID=…&transactionID=…(search queryqpreserved,-searchsuffix variant).Case 2.2 — Back → Search
Steps: From the search overview, tap Back → verify return to
/search?q=…with the query intact and suffix stripped.Case 2.3 — Refresh
Steps: F5 on the search overview URL → verify it restores without NotFound.
Case 2.4 — Base
/search/r/<reportID>(search report RHP)Steps: Open a report RHP from Search (
/search/r/<id>), open a transaction thread, ⋮ → Split → verify/search/r/<id>/split-expense-overview-search/…opens and Back returns to/search/r/<id>.Group 3 —
MONEY_REQUEST_SPLIT_EXPENSE_CREATE_DATE_RANGE(split-expense-create-date-range)Case 3.1 — Entry via "Split dates" row
Target:
src/pages/iou/DynamicSplitExpensePage.tsx:580Steps: On the overview (Date tab), tap "Split dates" → verify the URL appends
/split-expense-create-date-rangeto the overview URL (tab segment included) and the query params are inherited (the route declares no query params of its own).Case 3.2 — Save/Back → overview
Steps: Set start/end dates, Save (or Back) → verify return to the dynamic overview with the child suffix stripped.
Case 3.3 — Refresh on date-range URL
Steps: F5 on the date-range URL → verify both layers restore (overview + date-range page), no NotFound.
Offline tests
QA Steps
Test case 1: Split an expense from its transaction thread
/split-expense-overview/amount?splitReportID=…&transactionID=…(nobackTois added).Test case 2: Pick a split date range
/split-expense-create-date-rangeto the overview URL, without adding new query params.Test case 3: Split an expense from Search
/split-expense-overview-search/amount?q=<search query>&splitReportID=…&transactionID=…, with the search query preserved.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
CleanShot.2026-08-21.at.11.10.51.1.mp4
Sync main
CleanShot.2026-08-21.at.11.41.26.1.mp4
Case 1.1 — Entry via "Amount • Split" chip (edit mode)
Case 1.2 — Entry via header ⋮ menu → Split
Case 1.3 — Back from overview
Case 1.4 — Refresh restores overview + active tab
Case 1.5 — Tab switch updates URL segments
Case 1.6 — Cold deep-link in a new tab
Case 1.7 — Row tap → SPLIT_EXPENSE_EDIT → back to dynamic overview
Case 1.8 — Delete-last-child redirect into edit flow
Case 1.9 — Legacy overview URL → NotFound
Not support
Case 2.1 — Entry via Search bulk action
Case 2.2 — Back → Search
Case 2.3 — Refresh
Case 2.4 — Base `/search/r/` (search report RHP)
Case 3.1 — Entry via "Split dates" row
Case 3.2 — Save/Back → overview
Case 3.3 — Refresh on date-range URL