Fix Reimbursable toggle hidden for personal card transactions#84596
Fix Reimbursable toggle hidden for personal card transactions#84596
Conversation
…imbursable toggle visibility The Reimbursable toggle was hidden for personal card transactions because isFromCreditCardImport returns true for both managed and personal cards. Switching to isManagedCardTransaction ensures the toggle is only hidden for managed/company card transactions while remaining visible for personal card imports. Co-authored-by: Alberto Gonzalez-Cela <Gonals@users.noreply.github.com>
Co-authored-by: Alberto Gonzalez-Cela <Gonals@users.noreply.github.com>
|
Fixed the failing Prettier check: the |
|
@MelvinBot I found some regressions. Can you review this and implement it if you cannot flag any other issues. Root CauseIn isFromCreditCardImport as isCardTransactionTransactionUtils, const isManagedCardTransaction = isCardTransactionTransactionUtils(transaction); const shouldShowReimbursable =
(isPolicyExpenseChat || (isExpenseUnreported && !!policy)) &&
(policy?.disabledFields?.reimbursable !== true || isCurrentTransactionReimbursableDifferentFromPolicyDefault) &&
!isManagedCardTransaction &&
!isInvoice;
The real The expense creation flow in const shouldShowReimbursable =
(isPolicyExpenseChat || isTrackExpense) && !!policy && policy?.disabledFields?.reimbursable !== true && !isManagedCardTransaction(transaction) && !isTypeInvoice;So there's an inconsistency: the creation flow correctly shows the toggle for personal cards, but the detail/edit view hides it. FixIn
The other usages of the renamed variable ( import {
...
isFromCreditCardImport as isCardTransactionTransactionUtils,
isCategoryBeingAnalyzed,
+ isManagedCardTransaction as isManagedCardTransactionTransactionUtils,
...
} from '@libs/TransactionUtils';
- const isManagedCardTransaction = isCardTransactionTransactionUtils(transaction);
+ const isFromCardImport = isCardTransactionTransactionUtils(transaction);
const cardProgramName = getCompanyCardDescription(...);
- const shouldShowCard = isManagedCardTransaction && cardProgramName;
+ const shouldShowCard = isFromCardImport && cardProgramName;
const shouldShowReimbursable =
(isPolicyExpenseChat || (isExpenseUnreported && !!policy)) &&
(policy?.disabledFields?.reimbursable !== true || ...) &&
- !isManagedCardTransaction &&
+ !isManagedCardTransactionTransactionUtils(transaction) &&
!isInvoice;
// shouldShowConvertedAmount and posted date block: unchanged, use isFromCardImportWhat changes behaviorally: Only What doesn't change: Card name display, converted amount visibility, and posted date/original amount descriptions all continue using |
The previous approach replaced isFromCreditCardImport with isManagedCardTransaction for ALL usages, which unintentionally changed the behavior of shouldShowCard, shouldShowConvertedAmount, and the posted date/original amount display. This commit takes a more surgical approach: - Renames local variable to isFromCardImport (uses broad isFromCreditCardImport) - Only shouldShowReimbursable uses the narrow isManagedCardTransaction check - Card name, converted amount, and posted date continue using isFromCardImport Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
|
Melven only works if I post on the main issue, as I am not the main author 🥲 |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2026-03-13.at.04.37.45.mov |
|
@abzokhattab 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.
|
It seems like it did make some changes, right? |
|
yes but i had to post on the issue not the PR as you are the author here... i think its still expected |
|
🚧 @Gonals has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 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.3.40-0 🚀
|
|
@Gonals @heyjennahay , Applause QA does not have personal card transactions, could this be verified internally?
|
|
🚀 Deployed to staging by https://github.com/Gonals in version: 9.3.40-0 🚀
|
|
Works well for me on staging. Checked off for QA! |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|




Explanation of Change
In
MoneyRequestView, theshouldShowReimbursablecondition was usingisFromCreditCardImportto determine whether to hide the Reimbursable toggle. That helper returnstruefor both managed/company cards and personal cards imported via bank connection. This caused the Reimbursable toggle to be incorrectly hidden for personal card transactions.This PR switches to using
isManagedCardTransactioninstead, which only returnstruefor centrally managed cards (Expensify or Company Cards). This ensures the Reimbursable toggle remains visible for personal card imports while still being hidden for managed card transactions.Fixed Issues
$ #81997
PROPOSAL: #81997 (comment)
Tests
Offline tests
N/A — this change only affects UI visibility logic and does not involve network requests.
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
N/A — no UI layout changes, only visibility logic fix
Android: mWeb Chrome
N/A — no UI layout changes, only visibility logic fix
iOS: Native
N/A — no UI layout changes, only visibility logic fix
iOS: mWeb Safari
N/A — no UI layout changes, only visibility logic fix
MacOS: Chrome / Safari
N/A — no UI layout changes, only visibility logic fix