Repository navigation
Share extension: pre-mount destination report and create expense before reveal transition - #97242
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
JakubKorytko
left a comment
There was a problem hiding this comment.
the pre-mount idea is right, and the refactor is clean 🎉
Main thing: this re-does what the manual flow already has (getSubmitExpensePreMountDestinationRoute + handleReportPreInsert + usePreMountDestination) and drops the stability guard, which I think breaks the pre-mount. Details on the preMountDestinationRoute line.
On telemetry: ManualSubmitToDestinationVisible can't regress here - thank you for that haha. Share never calls startTracking, so the span is never started and every touchpoint is behind isTracking(). But that also means the whole flow is unmeasured, so the win this PR claims isn't verifiable, added a more precise comment in code.
Three behaviour changes also look inherited rather than decided: Search tab, wide layout, and report-already-in-RHP.
…ountDestinationRoute
JakubKorytko
left a comment
There was a problem hiding this comment.
the pre-insert gates and optimisticChatReportID close most of the last round, so what's left is mainly the pending-navigation branch (still the one that can park the modal in a loading state with nothing to resolve it) plus a few leftovers from round one. Otherwise, LGTM!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19d8139deb
ℹ️ 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".
…reate-expense # Conflicts: # src/pages/Share/SubmitDetailsPage.tsx
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-08-05.at.11.47.30.AM.movScreen.Recording.2026-08-07.at.11.12.06.AM.moviOS: mWeb SafariMacOS: Chrome / Safari |
|
BUG: clicking the VideoScreen.Recording.2026-08-05.at.11.48.30.AM.mov |
|
This issue is reproducible on main and was not introduced by these changes. It is also out of scope for this PR. |
|
🚧 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.52-0 🚀
|
|
🤖 No help site changes required. I reviewed the changes in this PR against Expensify's help site content under WhyWhat the PR changes: This is an internal navigation/animation-timing fix for the share extension flow. It reworks how Changed files are all implementation/tests — no user-facing feature, label, setting, or workflow was added or renamed:
End-user behavior is unchanged: share a receipt → the expense is created → you land on the destination chat. The only difference is a smoother transition (no visible flash). No affected docs: a search of Since no changes are required, I did not create a draft help site PR. |
|
Hi @jmgraa. One of our four testers can still reproduce the original issue. Expensify doesn’t open when sharing an image from the Gallery or Files. VID-20260811-WA0002.mp4 |
|
Hi! Thanks for testing. I'm a bit disoriented by the video. My PR fixes a visual flash after submitting a receipt, whereas the video shows the share extension failing to open on launch. Could you share the exact steps to reproduce this and check if it's also happening on main? |
|
Hi @jmgraa. Our testers have different results.
ScreenRecording_08-12-2026.14-52-54_1.MP4ScreenRecording_08-12-2026.14-51-46_1.MP4
VID-20260811-WA0002.1.mp4 |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.52-11 🚀
Bundle Size Analysis (Sentry): |
|
As discussed with @IuliiaHerets, the bug mentioned above was just a one-off on a single device and couldn't be reproduced. There are no other cases or steps to trigger it |
Explanation of Change
Before this change, submitting a shared receipt could briefly show the Inbox behind the share modal before the destination chat appeared on top - a visible flash during dismiss.
SubmitDetailsPagenow handles two navigation strategies based on layout and report state:Narrow layout: Pre-mounts the destination report behind the modal (when it already exists in Onyx) so the correct chat is ready when the modal closes.
Wide layout (tablets/desktop): Reveals the destination report on top of the modal first, then dismisses the modal after the animation completes.
Both strategies keep the confirm button in loading state until navigation is safe. When the destination report doesn't exist yet (new recipient), the page waits for the optimistic report to land in Onyx before navigating - with fallback timers (500ms if ID changes, 5s absolute timeout) to prevent indefinite hangs.
The expense is created immediately on submit (not after the reveal animation), and cleanup skips a second navigation (shouldNavigate: false) since reveal/pre-mount already handles routing. Stale tracking spans are cancelled before creation to avoid lifecycle conflicts, improving telemetry accuracy.
Fixed Issues
$ #97667
PROPOSAL:
Tests
Share extension with existing recipient
Share extension with new recipient
Share extension with destination already topmost
Repeat tests 1-3 both on narrow and wide layout
Offline tests
Same as tests
QA Steps
Same as tests
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
iOS: Native
ios.mov