[Performance] Dismiss-first navigation for all remaining expense submission paths#90347
Conversation
fe2d09a to
19595e6
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19595e6e2d
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 604c61b6f4
ℹ️ 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".
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.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a583674fdd
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 150ac852e6
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
Code ReviewWell-structured PR. The extraction of Issues1. In 2. The old code derived the rollback grace from the timeout ( 3. At the PAY QAB path (line ~1721), 4. The effect at line 314 reads Suggestions (non-blocking)
Good
|
There was a problem hiding this comment.
Pull request overview
This PR extends the “dismiss-first” expense submission optimization across remaining IOU submission paths, deferring expensive optimistic writes until after navigation transitions and expanding telemetry + Search optimistic-item handling to better measure “submit-to-destination-visible” performance.
Changes:
- Introduces a shared
submitWithDismissFirst()orchestrator for skip-confirmation submit flows and threads newshouldDeferForSearch/shouldHandleNavigationoverrides through IOU actions. - Adds a new submit handler path (
DISMISS_TO_REPORT) and updates submit decision logic + tests to cover destination-report flows (SPLIT/TRACK) more consistently. - Refactors Search optimistic tracking into dedicated hooks and adds scoped filtering overrides to keep the tracked optimistic item visible until server data arrives.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/submitWithDismissFirstTest.ts | New unit coverage for the shared dismiss-first submit orchestrator branches. |
| tests/unit/getSubmitHandlerTest.ts | Updates decision-tree tests for new snapshot shape and new handler paths. |
| tests/ui/IOURequestStepAmountDraftTest.tsx | Mocks submitWithDismissFirst for UI tests to keep Navigation mocking minimal. |
| tests/actions/IOU/MoneyRequestTest.ts | Adjusts IOU action tests for new write override params and shared mock. |
| tests/mocks/submitWithDismissFirst.ts | Shared test mock that bypasses dismiss-first orchestration. |
| src/pages/iou/request/step/IOURequestStepConfirmation.tsx | Adds dismiss-first handling for PAY in confirmation step; resolves destination report IDs more robustly. |
| src/pages/iou/request/step/IOURequestStepAmount.tsx | Uses submitWithDismissFirst for skip-confirmation amount-entry submissions (PAY/SUBMIT/TRACK). |
| src/pages/iou/request/step/confirmation/useExpenseSubmission.ts | Threads shouldDeferForSearch / shouldHandleNavigation through submit paths; adds options to sendMoney. |
| src/pages/iou/request/step/confirmation/SubmitExpenseOrchestrator.tsx | Adds DISMISS_TO_REPORT handler and improves deferred-channel selection for Search-preserving flows. |
| src/pages/iou/request/step/confirmation/getSubmitHandler.ts | Extends submit handler decision tree for destination-report flows and new handler type. |
| src/libs/SearchUIUtils.ts | Adds optimisticTransactionID to prevent filtering the tracked optimistic item out of status tabs. |
| src/libs/actions/IOU/types/CreateTrackExpenseParams.ts | Adds shouldDeferForSearch to track-expense action params. |
| src/libs/actions/IOU/TrackExpense.ts | Respects explicit shouldDeferForSearch when deciding whether to defer writes. |
| src/libs/actions/IOU/submitWithDismissFirst.ts | New shared dismiss-first orchestration + telemetry setup for skip-confirmation flows. |
| src/libs/actions/IOU/Split.ts | Adds deferred-write support and optional navigation handling for split flows. |
| src/libs/actions/IOU/SendMoney.ts | Adds deferred-write support + optional telemetry start for send-money flows. |
| src/libs/actions/IOU/MoneyRequestBuilder.ts | Extends request params to pass shouldDeferForSearch. |
| src/libs/actions/IOU/MoneyRequest.ts | Applies dismiss-first orchestration to scan/distance skip-confirmation flows and threads overrides. |
| src/libs/actions/IOU/index.ts | Extends split action params with navigation/defer overrides. |
| src/CONST/index.ts | Adds a new telemetry fast-path handler enum value (DISMISS_TO_REPORT). |
| src/components/Search/index.tsx | Refactors optimistic tracking into hooks and integrates optimistic transaction injection + stable sorted data. |
| src/components/Search/hooks/useStableOptimisticSortedData.ts | New hook to cache/re-inject the optimistic row and manage rollback cleanup. |
| src/components/Search/hooks/useOptimisticSearchTracking.ts | New hook to manage watch-key resolution, split-parent swap, and Search-data augmentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5094dd97b1
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
The redirection to spend is not happening from home tab Edit: Same thing is happening on staging for the account. So NAB for this PR. Screen.Recording.2026-05-15.at.8.00.28.PM.mov |
| shouldHandleNavigation?: boolean; | ||
| shouldDeferForSearch?: boolean; |
|
🚧 @mountiny 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/mountiny in version: 9.3.76-0 🚀
|
|
No help site changes required. This PR is a pure performance optimization (dismiss-first navigation and deferred writes for expense submission). It doesn't change any user-facing features, workflows, terminology, or UI elements — users still submit expenses the same way, it just feels faster. The help site articles covering expense submission ( |
|
@JakubKorytko QAB is not updated after selecting "Send invoice". Is it expected behavior? Bug7158141_1779208296435.RPReplay_Final1779202895.mp4bandicam.2026-05-19.21-03-56-252.mp4 |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.77-3 🚀
|
|
@izarutskaya yep, that's how it was before the PR already, not sure if bug or by design but not caused by the PR itself. |
|
@JakubKorytko Could you please check this issue #91126 ? |
|
Yeah, will take a look tomorrow but I see that for this QAB confirmation page was not skipped - need to check if before the PR was merged it behaved the same. Because for normal expenses it navigates to Spend from Home, for skip-confirmation QAB it navigates to Inbox. Not sure about non skip QABs. Good catch anyway, will probably just revert locally and see what happens then, thanks! |
|
Thank you! |
Explanation of Change
Improve perceived performance of expense submission from
QAB/FABacross all IOU types (PAY,SPLIT,TRACK,SUBMIT/REQUEST) by adding dismiss-first navigation and deferred writes.The RHP now animates closed while navigating to the destination underneath, and API writes are deferred until after the transition completes.
Also adds full telemetry coverage (
startTracking,setFastPath,setPendingSubmitFollowUpAction) to skip-confirmation paths (scan,distance,split+receipt) that previously had none, enablingSubmitToDestinationVisiblespan measurement.Fixed Issues
$ #90669
PROPOSAL: N/A
Tests
Prerequisite: For an action to appear in the QAB, you need to perform it once via FAB first (e.g. create a manual PAY expense via FAB so that PAY appears as the QAB action).
Expected behavior for all tests below:
For each of the test, verify you can see both
[Sentry][ManualSubmitToDestinationVisible] Starting spanand[Sentry][ManualSubmitToDestinationVisible] Ending spanin console logs.TRACK
PAY
SPLIT
SUBMIT/REQUEST
INVOICE (FAB - full flow with confirmation)
Note: the full-screen option under 'RHP' is only visible on the wide layout, as the RHP is full-screen on the narrow layout. On narrow, the flow is simply faster than on main
Offline tests
Same as tests.
QA Steps
Same as test.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Pay
Pay_iOS.mov
Split, Split+Scan
Split_iOS.mov
Split+scan_iOS.mov
Track, Track+scan
Track_iOS.mov
Request money
Request_money_iOS.mov
Invoices
Invoices_iOS.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Pay
Pay.mov
Split, Split+Scan
Split.mov
Split+Scan.mov
Track, Track+scan
Track.mov
Request money
Request_money.mov
Invoices
Invoices.mov