Add Split to the select menu when 1 expense is selected, editable and not the child of an existing Split expense#73855
Conversation
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.
|
trjExpensify
left a comment
There was a problem hiding this comment.
Core PR for a #whatsnext project, all good. 👍
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-12-09.at.6.03.54.PM.movAndroid: mWeb ChromeScreen.Recording.2025-12-09.at.6.03.15.PM.moviOS: HybridAppScreen.Recording.2025-12-09.at.6.04.25.PM.moviOS: mWeb SafariScreen.Recording.2025-12-09.at.6.04.56.PM.movMacOS: Chrome / SafariScreen.Recording.2025-12-09.at.5.49.26.PM.mov |
src/components/Search/index.tsx
Outdated
| function prepareTransactionsList(item: TransactionListItemType, selectedTransactions: SelectedTransactions, outstandingReportsByPolicyID?: OutstandingReportsByPolicyIDDerivedValue) { | ||
| function prepareTransactionsList( | ||
| item: TransactionListItemType, | ||
| transaction: OnyxEntry<Transaction>, |
There was a problem hiding this comment.
Hmm, maybe naming can be better, like itemTransaction
| const {isExpenseSplit} = getOriginalTransactionWithSplitInfo(selectedTransactionsList.at(0)); | ||
| const canSplitTransaction = selectedTransactionsList.length === 1 && report && !isExpenseSplit && isSplitAction(report, selectedTransactionsList, policy); |
There was a problem hiding this comment.
In the Search component, transaction item prop canSplit is equal to isSplitAction. Why not use isSplitAction too? Or what's the nuance here?
There was a problem hiding this comment.
These screens don't work the same way
Including search context, which uses differently
Plus, all the buttons on useSelectedTransactionsActions (hold,unhold, merge) don't use context data as SearchPage
|
Bug: Mobile -
Screen.Recording.2025-11-13.at.12.20.55.AM.mov |
|
@eh2077 2025-11-13.10.57.11.mov |
|
The ws chat has 4 reports
I reproduced the issue with the second report |
|
@ZhenjaHorbach I can reproduce on browser too. I think it's possibly related to lazy loading of transaction data. Screen.Recording.2025-11-14.at.8.57.04.PM.mov |
|
@eh2077 can you review latest changes please? |
|
yeah, I'm working on this and will update shortly. @ZhenjaHorbach please help with conflicts, thank you! |
|
I spotted another bug that isn't related to this PR Bug: Delete split expense from Reports > Expenses doesn't auto reverse split to normal expense Screen.Recording.2025-12-09.at.5.56.06.PM.mov |
There was a problem hiding this comment.
Looks good! Checklist #73855 (comment) completed, so 👍 from me once conflicts are resolved.
|
@eh2077 |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #73669 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @Julesssss 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, Desktop, 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/Julesssss in version: 9.2.75-0 🚀
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.2.75-0 🚀
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.2.77-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.2.77-1 🚀
|
| const reportName = getReportName(report, policy); | ||
| const isDescriptionRequired = isCategoryDescriptionRequired(policyCategories, splitExpenseDraftTransactionDetails?.category, policy?.areRulesEnabled); | ||
| const isCategoryRequired = !!currentPolicy?.requiresCategory; | ||
| const reportName = computeReportName(currentReport); |
There was a problem hiding this comment.
@ZhenjaHorbach Can you please use derived value instead of using computeReportName to compute report name from scratch?
Explanation of Change
[Splits in NewDot] Add Split to the select menu when 1 expense is selected, editable and not the child of an existing Split expense
Fixed Issues
$ #73669
PROPOSAL:
Tests
Submitters and assigned approvers can split expenses that they can edit.
Admins can split expenses on Draft and Processing reports.
Non-editable expenses include pending Expensify Card expenses and Expensiworks expenses for all users.
Users should not see the Split option in the 1 selected menu for portions of expenses that have already been split.
Users should not see the Split option in the 2 or more selected menu
Verify that no errors appear in the JS console
Offline tests
QA Steps
Submitters and assigned approvers can split expenses that they can edit.
Admins can split expenses on Draft and Processing reports.
Non-editable expenses include pending Expensify Card expenses and Expensiworks expenses for all users.
Users should not see the Split option in the 1 selected menu for portions of expenses that have already been split.
Users should not see the Split option in the 2 or more selected menu
Verify that no errors appear in the JS console
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
2025-11-07.14.11.46.mov
Android: mWeb Chrome
2025-11-07.14.13.33.mov
iOS: Native
2025-11-07.14.09.08.mov
iOS: mWeb Safari
2025-11-07.14.09.08.mov
MacOS: Chrome / Safari
2025-11-07.13.44.45.mov
MacOS: Desktop
2025-11-07.13.44.45.mov