Repository navigation
[No-QA] refactor: Move the split-expenses save orchestrator to the view layer - #101972
Conversation
…de-to-keep-navigation-handling-in-the-UI-components
|
@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.
|
|
@MelvinBot review |
|
🤖 Reviewed — this is a clean move, no behavior change that I can find. Two small suggestions on the new guard test, nothing blocking. What I verified
Suggestions
I could not drive this in a browser for this run, so everything above is from static analysis of the diff and the CI results, not a live test of the four save paths. |
…de-to-keep-navigation-handling-in-the-UI-components # Conflicts: # src/libs/actions/IOU/SplitTransactionUpdate.ts # tests/actions/IOUTest/SplitTest.ts
…de-to-keep-navigation-handling-in-the-UI-components
…de-to-keep-navigation-handling-in-the-UI-components
…de-to-keep-navigation-handling-in-the-UI-components
linhvovan29546
left a comment
There was a problem hiding this comment.
Looks like there are some conflicts. Could you please resolve them? I’ll prioritize reviewing this PR today.
…de-to-keep-navigation-handling-in-the-UI-components # Conflicts: # src/libs/actions/IOU/SplitTransactionUpdate.ts # tests/actions/IOU/SplitReportTotalsTest.ts
…de-to-keep-navigation-handling-in-the-UI-components
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppNo-QA Android: mWeb ChromeNo-QAiOS: HybridAppNo-QAiOS: mWeb SafariNo-QAMacOS: Chrome / SafariNo-QA |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #84631 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 Gonals 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Gonals in version: 9.5.4-0 🚀
|
|
No help site update is needed: this PR only moves the split-expenses save function from the action layer to the view layer without changing its behavior, so nothing users see is different. |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.4-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Part of the series moving navigation out of
src/libs/actions/IOU/. This one coversupdateSplitTransactionsFromSplitExpensesFlow, the function that saves the split expenses flow.Almost all of that function is navigation. It picks one of four paths depending on where the save started from (a selfDM chat, the Search page, a reverse split that empties the expense report, or a normal split), then dismisses the modal, picks the report to land on, and removes screens the save invalidates. The save itself is one call inside each path.
It moved whole because the two are interleaved. In two paths the save runs after the dismiss, inside
requestAnimationFrame, so the user does not see a "Not Found" flash. Splitting it would need either a callback from the action or a navigation target returned from it, and this issue is removing both. So the function is now a plain function in the view layer atsrc/pages/iou/updateSplitTransactionsFromSplitExpensesFlow.ts, andupdateSplitTransactionsstays in the action file as the part that writes data.The body is unchanged, all 166 lines of it. Only the imports and the export style differ. The move took 13 imports with it, so
SplitTransactionUpdate.tsno longer importsNavigationat all.Two of the four paths were already covered by tests, so I added assertions for the selfDM and Search paths. I also extended the action layer navigation guard to check that files already migrated in this series make no route changing calls.
Fixed Issues
$ #84631
PROPOSAL: #84631 (comment)
Tests
Offline tests
Same as tests
QA Steps
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