[Performance] Pre-render Search under RHP for instant post-submit navigation on mobile#87404
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45ad0dfae9
ℹ️ 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 |
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: 10c7e8925d
ℹ️ 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: 9cbc1caae8
ℹ️ 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: 9cbc1caae8
ℹ️ 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: 47a7bcce47
ℹ️ 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 (do not repeat yourself 🙏) |
There was a problem hiding this comment.
💡 Codex Review
App/src/libs/telemetry/submitFollowUpAction.ts
Lines 53 to 54 in 47a7bcc
When this same-flow branch runs, it still overwrites pendingSubmitFollowUpAction (and the span attribute) with the new value. In the fast pre-insert flow, onConfirm sets NAVIGATE_TO_SEARCH, then handleNavigateAfterExpenseCreate() can later call DISMISS_MODAL_ONLY after Search is already on top; this code reclassifies that submit as dismiss-only, which skews submit-to-destination telemetry for the very path this PR is measuring. The NAVIGATE_TO_SEARCH -> DISMISS_MODAL_ONLY refinement should preserve the original action rather than replacing it.
ℹ️ 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".
| // isFromGlobalCreate and iouType are stable for the lifetime of this screen instance | ||
| // since they derive from route params / Onyx and don't change while the confirmation screen is open. | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps -- Pre-insertion is a one-time side effect on mount. | ||
| }, []); |
There was a problem hiding this comment.
Re-run preinsert setup after transaction finishes loading
This pre-insert setup effect is one-shot ([]) but immediately bails when transaction is not yet available. IOURequestStepConfirmation can render before Onyx transaction data resolves, so in those cases the timer is never scheduled later and the new fast-path optimization silently never activates. The effect should depend on transaction/loading state (or explicitly trigger when loading completes) so late-loaded transactions still get pre-insert behavior.
Useful? React with 👍 / 👎.
Explanation of Change
On narrow layout (mobile), pre-renders the Search page behind the RHP while the user is on the expense confirmation screen, so post-submit navigation is instant.
How it works
REPLACE_FULLSCREEN_UNDER_RHP. The Search page mounts in the background while the user fills in details.createTransactionruns in the next frame - "dismiss first, compute later".REMOVE_FULLSCREEN_UNDER_RHPaction.Supporting changes
reserveDeferredWriteChannel- pre-creates the deferred write channel so Search always seeshasDeferredWrite=trueon mountSearchPageNarrow- gates phase transitions on focus (useFocusEffect) to avoid wasted work while hidden behind the RHPSearchStaticList- shows the pending expense placeholder on focus when a submit action is pendingRightModalNavigator- disables slide-out animation when a pre-insert is active so the dismiss reveals the destination instantlyPerformance gains (
ManualSubmitToDestinationVisible(navigate_to_search) span):mainavg (ms)Fixed Issues
$ #83634
PROPOSAL: N/A
Tests
Fast-path submit (pre-insert fires before user taps submit)
Slow-path submit (user taps submit before 300ms pre-insert fires)
Back-out cleanup (user leaves confirmation without submitting)
Offline tests
QA Steps
Same as tests
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.mov
Android: mWeb Chrome
iOS: Native
iOS.mov
iOS: mWeb Safari
MacOS: Chrome / Safari