Fix: Missing Split indicator next to Amount when card expense is split#67916
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-08-14.at.01.43.13.mp4Android: mWeb ChromeScreen.Recording.2025-08-14.at.01.41.16.mp4iOS: HybridAppScreen.Recording.2025-08-14.at.01.40.58.mp4iOS: mWeb SafariScreen.Recording.2025-08-14.at.01.44.06.mp4MacOS: Chrome / SafariScreen.Recording.2025-08-14.at.01.35.17.mp4MacOS: DesktopScreen.Recording.2025-08-14.at.01.36.59.mp4 |
| if (formattedOriginalAmount) { | ||
| amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.original')} ${formattedOriginalAmount}`; | ||
| } | ||
| if (getOriginalTransactionWithSplitInfo(transaction).isExpenseSplit) { |
There was a problem hiding this comment.
@ryntgh I'm sorry, but we should avoid using getOriginalTransactionWithSplitInfo since it uses allTransactions which is retrieved via Onyx.connect and we're deprecating uses of Onyx.connect, so this PR will make deprecating it harder. Can we instead subscribe to the originalTransactionID via useOnyx and retrieving the data we need that way?
There was a problem hiding this comment.
Sure! I’ve added a new helper function that replicates the functionality of getOriginalTransactionWithSplitInfo to retrieve the isExpenseSplit value
Please let me know your thoughts on this approach
|
✋ 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/luacmartins in version: 9.1.96-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.1.96-2 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.1.96-2 🚀
|
| return transactions?.length === 1 && hasPendingUI(transactions?.at(0), getTransactionViolations(transactions?.at(0), allTransactionViolations)); | ||
| } | ||
|
|
||
| function isExpenseSplit(transaction: OnyxEntry<Transaction>, originalTransaction: OnyxEntry<Transaction>): boolean { |
There was a problem hiding this comment.
Coming from #73732, we missed cases here where there is only one split remaining, in which case it shouldn't be visually displayed as if it were a split expense.
Explanation of Change
Fixed Issues
$ #66900
PROPOSAL: #66900 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Precondition:
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))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-mWeb.mp4
iOS: Native
iOS-Native.mp4
iOS: mWeb Safari
iOS-mWeb.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4
MacOS: Desktop
MacOS-Desktop.mp4