Fix receipt replace back navigation on native#84783
Conversation
…navigateBack The native navigateBack() was not passing the backTo parameter to Navigation.goBack(), unlike the web version. This caused incorrect navigation when replacing a receipt — pressing back after capturing a photo returned to the camera screen instead of the previous screen. Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot Please merge main then mark it as ready for review |
…aceNavBack Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
Done! I've merged |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
@MelvinBot Please merge main |
…aceNavBack Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
Done! I've merged |
|
@jasperhuangg Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@MelvinBot should we only apply the change when |
|
No, gating the change on
So the current unconditional change is the right approach — adding an |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-16.at.23.06.07.movAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-03-16.at.19.19.23.moviOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 @jasperhuangg 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/jasperhuangg in version: 9.3.39-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.39-3 🚀
|
Explanation of Change
The native
navigateBack()function inIOURequestStepScan/index.native.tsxwas not passing thebackToparameter toNavigation.goBack(), unlike the web version which correctly does. This caused incorrect back navigation when replacing a receipt — after capturing a replacement photo, pressing back returned to the camera screen instead of the previous screen.This change updates
navigateBack()in the native file to passbackTotoNavigation.goBack()and wraps it inuseCallback, matching the web implementation exactly.Fixed Issues
$ #82491
PROPOSAL: #82491 (comment)
Tests
Offline tests
N/A — This change only affects navigation routing after a receipt photo is captured. No network requests are involved in the
navigateBackfunction.QA Steps
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
N/A — This change only affects the native platform file (
index.native.tsx).iOS: Native
iOS: mWeb Safari
N/A — This change only affects the native platform file (
index.native.tsx).MacOS: Chrome / Safari
N/A — This change only affects the native platform file (
index.native.tsx).