Fix: Highlight split expenses after splitting an existing expense#92506
Conversation
Register each new split transaction ID via addPendingNewTransactionIDs before navigating away, so MoneyRequestReportActionsList can identify and highlight them on first load via the pendingNewTransactionIDs path. Covers all three navigation branches: - dismissModalWithReport (normal workspace split) - isSelfDMSplit (selfDM → workspace split) - isSearchPageTopmostFullScreenRoute (split from search page) Skipped for isReverseSplitOperation (no new transactions) and isLastTransactionInReport (report is being emptied, fallback nav). On the read side, subscribe MoneyRequestReportActionsList to REPORT_METADATA via pendingNewTransactionIDsSelector and pass all 5 arguments to useNewTransactions, enabling the metadata fallback path that highlights transactions already present on mount.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@gijoe0295 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a02590595b
ℹ️ 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".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-06-16.at.16.29.25.movAndroid: mWeb ChromeScreen.Recording.2026-06-16.at.16.31.14.moviOS: HybridAppScreen.Recording.2026-06-16.at.16.22.28.moviOS: mWeb SafariScreen.Recording.2026-06-16.at.16.23.14.movMacOS: Chrome / SafariScreen.Recording.2026-06-16.at.16.13.37.mov |
Can you consolidate these steps?
Also please resolve conflicts @aswin-s |
|
|
||
| const targetReportID = params.expenseReport?.reportID ?? String(CONST.DEFAULT_NUMBER_ID); | ||
|
|
||
| if (params.expenseReport?.reportID && !isReverseSplitOperation && !isLastTransactionInReport && !isSearchPageTopmostFullScreenRoute) { |
There was a problem hiding this comment.
Why do we need isSearchPageTopmostFullScreenRoute here? With it, expenses are not highlighted when splitting in Search page.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ 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". |
|
🚧 @mountiny 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/mountiny in version: 9.4.15-0 🚀
|
|
🤖 Help site review: no docs changes required. This PR is a transient UI behavior fix — it registers the new split transaction IDs ( The relevant help article, Split Expenses, documents how to split, edit, and revert expenses (the More > Split > Save flow). The brief highlight flash is a visual polish detail that the article does not describe and does not need to — the documented steps and outcomes are unchanged. No draft PR was created since no help site updates are needed. @aswin-s, if you believe a help site update is warranted (for example, to document this highlight behavior), let me know and I'll create the draft PR. |
|
Deploy Blocker #93967 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.15-3 🚀
|
Explanation of Change
When splitting an existing expense, the newly created split transactions were not temporarily highlighted in the expense report list.
There were two gaps:
Write side —
updateSplitTransactionsFromSplitExpensesFlowcalledNavigation.dismissModalWithReportwithout first registering the new split transaction IDs viaaddPendingNewTransactionIDs. The normal create path does this vianavigateAfterExpenseCreate, but the split-update path skipped it entirely.Read side —
MoneyRequestReportActionsListcalleduseNewTransactionswith only 2 arguments, so thependingNewTransactionIDsmetadata fallback (which highlights transactions already present on mount) was never exercised.Fix:
SplitTransactionUpdate.ts, before the navigation call, loop over the split expenses and calladdPendingNewTransactionIDsfor each transaction ID. Skipped for reverse-split and last-transaction-in-report cases. This now also covers splitting from the Search page, wherenavigateBackToLastSuperWideRHPScreenis used instead ofdismissModalWithReport.MoneyRequestReportActionsList.tsx, subscribe toREPORT_METADATAviapendingNewTransactionIDsSelectorand pass all 5 arguments touseNewTransactions, mirroring whatMoneyRequestReportPreviewalready does.Fixed Issues
$ #91679
PROPOSAL: #91679 (comment)
Tests
Offline tests
N/A — split expense saving requires network. The highlight logic is optimistic (fires before the API response), so offline state does not affect it.
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-native.mp4
Android: mWeb Chrome
android-web.mp4
iOS: Native
ios-native.mp4
iOS: mWeb Safari
ios-web.mp4
MacOS: Chrome / Safari
Web.mp4