refactor: Add post-expense-creation navigation helpers#86619
refactor: Add post-expense-creation navigation helpers#86619TaduJR wants to merge 2 commits intoExpensify:mainfrom
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. |
Explanation of Change
Creates two new navigation utilities in
src/libs/Navigation/helpers/as the second step of #84631. These will be called by UI components in subsequent PRs when navigation is moved out of the IOU action layer.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).Key difference from the existing action-layer functions:
hasMultipleTransactionsis an explicit parameter instead of reading from an Onyx-connected module variable, andshouldHandleNavigationis removed since UI callers will always navigate when they call these utilities.No callers are wired up in this PR - that happens in subsequent PRs.
Fixed Issues
$ #84631
PROPOSAL: #84631 (comment)
Tests
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