Show "time" label instead of "cash" for time expenses in Split#80003
Conversation
|
@DylanDylann 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: 55588beda7
ℹ️ 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".
|
|
||
| const options: SplitListItemType[] = splitExpensesArray.map((item, index): SplitListItemType => { | ||
| const previewHeaderText: TranslationPathOrText[] = [showCashOrCard]; | ||
| const previewHeaderText: TranslationPathOrText[] = [{translationPath: getExpenseTypeTranslationKey(getTransactionType(transaction))}]; |
There was a problem hiding this comment.
Avoid mislabeling card splits when cardName is missing
This now derives the split header label from getTransactionType(transaction) without a cardList. In TransactionUtils.getTransactionType, when cardName is falsy and no cardList is provided, the function falls back to CASH. That means any managed-card transaction where cardName hasn’t loaded yet (e.g., optimistic/partial Onyx data or offline) will render as “Cash,” whereas the previous isManagedCardTransaction logic would show “Card.” This is a user-facing regression for those states, so consider passing cardList or falling back to managedCard before labeling.
Useful? React with 👍 / 👎.
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-01-26.at.16.46.36.movAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
| const isTransactionMadeWithCard = isManagedCardTransaction(transaction); | ||
| const showCashOrCard: TranslationPathOrText = {translationPath: isTransactionMadeWithCard ? 'iou.card' : 'iou.cash'}; | ||
| const transactionTypeTranslationPath = {translationPath: getExpenseTypeTranslationKey(getTransactionType(transaction))}; |
There was a problem hiding this comment.
This is slightly out of scope, but I think we should apply this update across the codebase for consistency and to prevent similar bugs elsewhere.
There was a problem hiding this comment.
yeah, I think it's a good idea. I looked through the codebase for the leftover usage of 'iou.cash' in this context and I found only 2 places:
- libs/TransactionPreviewUtils.ts -> we already updated this file in one of the time tracking PRs, so 'Time' is handled correctly. but we can use getExpenseTypeTranslationKey here for consistency
- components/ReportActionItem/TransactionPreview/index.tsx -> this one is used just for the accessibilityLabel, but I think we can update it as well
There was a problem hiding this comment.
@mhawryluk Could you update it in this PR If it's minor?
There was a problem hiding this comment.
Great catch, let's add those + a QA step
There was a problem hiding this comment.
done, I had to modify getTransactionType a little bit and move getExpenseTypeTranslationKey
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.
|
|
✋ 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/grgia in version: 9.3.9-0 🚀
|
|
@mhawryluk This PR is failing because of a regression issue #80589 The issue is reproducible in: Android, iOS, Web Bug7058988_1769488811593.duplicated_button_not_displayed.mp4 |
@mitarachim duplicate feature for distance requests was just disabled: #80481 so we should skip this part of offline tests |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.9-2 🚀
|
Explanation of Change
Fixes showing transaction type in split creation RHP by using a function handling all transaction types, instead of just checking for cash and card. This will affect other types of expenses too ("per diem" and "distance") which will bring consistency.
Fixed Issues
$ #79574
PROPOSAL: N/A
Tests
Offline tests
Same as tests, but offline.
And also:
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