refactor: Remove shouldHandleNavigation from sendMoney and submitPerDiemExpense#86619
Conversation
…tInInboxTab navigation helpers
|
@linhvovan29546 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] |
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.
|
@TaduJR Can we add at least one caller here to ensure the function works as expected? |
|
Sure thing, we could but that is going to be started on step 3 from the proposal currently the step 2 says this
But if you insist we can do that. BTW I was thinking to create an ESLint rule to not introduce this again WDYT?
|
Please add at least one caller to ensure the function works as expected. This is part of the plan and can be adjusted when we open the PR
We can add the ESLint rule, but let’s discuss it after the final PR |
…nInboxTab navigation helper
|
Added For WDYT about |
|
@TaduJR I think we can remove shouldHandleNavigation, right? |
|
Yes, we can remove shouldHandleNavigation from one function (e.g. submitPerDiemExpense) in this PR to prove navigateAfterExpenseCreate works end-to-end. |
Ok, please remove shouldHandleNavigation |
|
No product review needed |
…de-to-keep-navigation-handling-in-the-UI-components
… wire up navigateAfterExpenseCreate
…de-to-keep-navigation-handling-in-the-UI-components
|
@TaduJR Please take a look at this comment #84631 (comment). We should not return the payload from the function. |
Yea, I was testing the new utility function before proceeding. |
…de-to-keep-navigation-handling-in-the-UI-components
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ 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". |
…de-to-keep-navigation-handling-in-the-UI-components # Conflicts: # src/libs/IOUUtils.ts
…Transactions with useReportTransactions hook
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppN/A—the change should work on all platforms. Android: mWeb ChromeN/A—the change should work on all platforms. iOS: HybridAppScreen.Recording.2026-04-13.at.17.03.18.movScreen.Recording.2026-04-13.at.17.02.30.moviOS: mWeb SafariN/A—the change should work on all platforms. MacOS: Chrome / SafariScreen.Recording.2026-04-13.at.16.55.27.movScreen.Recording.2026-04-13.at.15.22.45.movScreen.Recording.2026-04-13.at.15.19.21.movScreen.Recording.2026-04-13.at.15.17.50.movScreen.Recording.2026-04-13.at.15.05.54.mov |
|
@TaduJR Conflict again! |
|
Bug: I don’t see the per diem after creating it. I can only reproduce this on this PR Screen.Recording.2026-04-13.at.15.20.04.mov |
|
Could you please merge main and resolve the conflicts so I can test again? |
…de-to-keep-navigation-handling-in-the-UI-components
…de-to-keep-navigation-handling-in-the-UI-components # Conflicts: # src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Merged with latest main.
Unable to reproduce on the latest merged main. Mac-Chrome.mp4 |
|
🚧 @Valforte 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/Valforte in version: 9.3.59-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This is a purely internal code refactoring that moves navigation handling from action files ( |
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.3.59-4 🚀
|
Explanation of Change
Creates two new navigation utilities in
src/libs/Navigation/helpers/as the second step of #84631, and wires them up with initial callers to prove they work.navigateAfterExpenseCreate: handles post-creation navigation - either dismisses modal and opens the report, or navigates to the Search page (Expenses/Invoices) when created from the FAB.dismissModalAndOpenReportInInboxTab: handles modal dismissal across multiple layout contexts (super-wide RHP, wide RHP, search page, default).Callers wired up:
sendMoneyElsewhere/sendMoneyWithWallet: navigation moved fromSendMoney.tstoIOURequestStepConfirmation.tsxandIOURequestStepAmount.tsx. Functions refactored from positional params toSendMoneyActionParamsobject. UI pre-computes the chat report ID viaresolveOptimisticChatReportIDand passesoptimisticChatReportIDto the action so both sides agree on the report identity.submitPerDiemExpense: removedshouldHandleNavigationparameter. Navigation moved fromPerDiem.tstoIOURequestStepConfirmation.tsxusingnavigateAfterExpenseCreate. Action acceptsoptimisticChatReportID. UI assembles all navigation data locally.Fixed Issues
$ #84631
PROPOSAL: #84631 (comment)
Tests
Prerequisites
Send Money - From a Chat
1. Mark as paid from a DM chat
2. Pay with wallet from a DM chat
Send Money - From Global Create
3. Mark as paid from the global + button
4. Pay with wallet from the global + button
Send Money - Quick Action (Skip Confirmation)
5. Send money via quick action
Submit Per Diem Expense
6. Submit per diem from the Inbox tab
7. Submit per diem from the Search tab
8. Submit per diem from within a workspace chat
9. Submit per diem from an existing expense report
10. Track per diem for yourself
Per Diem - New Chat
11. Submit per diem to a workspace you haven't used before
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
iOS: mWeb Safari
MacOS: Chrome / Safari
Mac-Chrome.mp4