Skip to content

Show a Pending status for Expensify Cards awaiting issue or activation - #101399

Merged
luacmartins merged 8 commits into
Expensify:mainfrom
marufsharifi:fix/pending-status-for-cards-awaiting-activation
Sep 24, 2026
Merged

luacmartins merged 8 commits into
Expensify:mainfrom
marufsharifi:fix/pending-status-for-cards-awaiting-activation

Conversation

@marufsharifi

@marufsharifi marufsharifi commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

A newly issued Expensify Card sits in one of two setup states before it can be used: waiting to be issued, and waiting for the cardholder to activate it. In both, the wallet showed the card as Active - right next to the prompt asking the user to finish setting it up. The status said the card was ready while the row told them it wasn't.

The wallet only knew whether a card was suspended, and treated everything else as active.

Expensify Cards now report one of three statuses:

  • Pending while the card is waiting to be issued or activated
  • Inactive once the back end has suspended it
  • Active when it can be spent on

Suspended is checked first, so a card that has been turned off never reads as merely waiting. Frozen cards, company cards and personal cards are unchanged.

The status comes from the card's state, but only for a physical card. A virtual card is issued and spendable as soon as it's assigned, with no activation step, so it never reads Pending.

Fixed Issues

$ #99971
PROPOSAL:

Tests

  1. As an admin, issue a new physical Expensify Card to a member so it sits in STATE_NOT_ISSUED.
  2. As that member, open Settings > Wallet > Cards.
  3. Verify the card shows a Pending badge rather than Active.
  4. Ship the card so it moves to NOT_ACTIVATED, and verify it still shows Pending.
  5. Activate the card and verify it shows Active.
  6. Set the card's limit to $0 so it is suspended, and verify it shows Inactive.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
Screenshot_20260917_120541_Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screenshot From 2026-09-17 11-25-37

@melvin-bot

melvin-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@melvin-bot
melvin-bot Bot requested review from flaviadefaria and mkhutornyi and removed request for a team September 17, 2026 09:14
@melvin-bot

melvin-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

@mkhutornyi 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]

@github-actions

Copy link
Copy Markdown
Contributor

🚧 flaviadefaria has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@flaviadefaria

Copy link
Copy Markdown
Contributor

It looks like Pending and Inactive are getting the same badge color:

image

I think we should stick to the same color scheme as we used for bank accounts, personal, and company cards.

If this is the color we used for pending bank account badges we should keep it. Though, as I posted in the main issue, we should update the Inactive badge color.

@marufsharifi

Copy link
Copy Markdown
Contributor Author

It looks like Pending and Inactive are getting the same badge color:

I think we should stick to the same color scheme as we used for bank accounts, personal, and company cards.

If this is the color we used for pending bank account badges we should keep it. Though, as I posted in the main issue, we should update the Inactive badge color.

@flaviadefaria, Thanks for catching that. Pending was using the neutral badge, which is why it matched Inactive. It now uses the same tangerine badge as a pending bank account, so it lines up with the mockup:

Screenshot 2026-09-19 at 12 00 51 PM

On the Inactive color, that changed in #100125 for #99971. An inactive Expensify Card used to show the tangerine badge with "Please ask an admin to fix this connection", which made it look like a broken connection when there's nothing to fix.

I can switch it back so all the Inactive badges match, though it would then be the same tangerine as Pending. Let me know which you'd prefer.

Copy link
Copy Markdown
Contributor

Ok so just to confirm:

  • Tangerine - Inactive (Personal card and third-party cards with a broken connection + bank accounts issues + Pending Ecard).
  • Neutral badge - Inactive Ecard, anything else?
  • Green badge - active

Is this all correct?

@marufsharifi

Copy link
Copy Markdown
Contributor Author

Is this all correct?

@flaviadefaria, Almost, two things to add:

  • Tangerine - Inactive (personal and company cards with a broken connection), Pending Ecard, and on bank accounts: Pending, Incomplete and Locked.
  • Neutral - Inactive Ecard, Verifying bank account, and Frozen Ecard.
  • Green - Active, for both cards and bank accounts.

Here they are together:

Screenshot 2026-09-21 at 2 58 44 PM

Copy link
Copy Markdown
Contributor

@marufsharifi Thanks, this is really helpful! So it sounds like we use the tangerine color whenever we need the user to take action, which makes sense to me. Let’s keep it as is.

@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 2e048d88..2c72e406 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -2754,6 +2754,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `Bitte beheben Sie diese Verbindung in <a href="${companyCardsRoute}">Firmenkarten</a>`,
             askAdminToFixConnection: 'Bitte bitten Sie eine(n) Admin, diese Verbindung zu reparieren',
             reconnectBank: 'Ihre Bankverbindung muss erneut authentifiziert werden',
+            pending: 'Ausstehend',
         },
         bankAccountStatus: {
             active: 'Aktiv',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 978da716..d6b72920 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -2812,6 +2812,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `Παρακαλούμε διορθώστε αυτήν τη σύνδεση στις <a href="${companyCardsRoute}">εταιρικές κάρτες</a>`,
             askAdminToFixConnection: 'Παρακαλούμε ζητήστε από έναν διαχειριστή να διορθώσει αυτήν τη σύνδεση',
             reconnectBank: 'Η σύνδεσή σας με την τράπεζα χρειάζεται επαναπιστοποίηση',
+            pending: 'Σε εκκρεμότητα',
         },
         bankAccountStatus: {
             active: 'Ενεργό',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 44ed1ed6..d656551d 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -2674,6 +2674,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute) => `Por favor, corrige esta conexión en <a href="${companyCardsRoute}">tarjetas de la empresa</a>`,
             askAdminToFixConnection: 'Pídele a un administrador que solucione esta conexión',
             reconnectBank: 'Tu conexión bancaria necesita volver a autenticarse',
+            pending: 'Pendiente',
         },
         bankAccountStatus: {
             active: 'Activo',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 0d793dae..b51164ce 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -2758,6 +2758,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `Veuillez corriger cette connexion dans <a href="${companyCardsRoute}">cartes d’entreprise</a>`,
             askAdminToFixConnection: 'Veuillez demander à un administrateur de corriger cette connexion',
             reconnectBank: 'Votre connexion bancaire doit être réauthentifiée',
+            pending: 'En attente',
         },
         bankAccountStatus: {
             active: 'Actif',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 4f26513f..757309ac 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -2744,6 +2744,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `Correggi questa connessione in <a href="${companyCardsRoute}">carte aziendali</a>`,
             askAdminToFixConnection: 'Chiedi a un amministratore di correggere questa connessione',
             reconnectBank: 'La connessione con la tua banca deve essere nuovamente autenticata',
+            pending: 'In sospeso',
         },
         bankAccountStatus: {
             active: 'Attiva',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 42828ac5..a0317e13 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -2722,6 +2722,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `この接続を<a href="${companyCardsRoute}">会社カード</a>で修正してください`,
             askAdminToFixConnection: '管理者にこの接続の修正を依頼してください',
             reconnectBank: '銀行連携の再認証が必要です',
+            pending: '保留中',
         },
         bankAccountStatus: {
             active: 'アクティブ',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 05e69b44..3c7b4014 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -2747,6 +2747,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `Repareer deze verbinding in <a href="${companyCardsRoute}">bedrijfskaarten</a>`,
             askAdminToFixConnection: 'Vraag een/beheerder om deze verbinding te herstellen',
             reconnectBank: 'Je bankverbinding moet opnieuw worden geverifieerd',
+            pending: 'In behandeling',
         },
         bankAccountStatus: {
             active: 'Actief',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 5c910217..1324b277 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -2779,6 +2779,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `Napraw to połączenie w <a href="${companyCardsRoute}">firmowe karty</a>`,
             askAdminToFixConnection: 'Poproś administratora o naprawienie tego połączenia',
             reconnectBank: 'Twoje połączenie z bankiem wymaga ponownego uwierzytelnienia',
+            pending: 'Oczekujące',
         },
         bankAccountStatus: {
             active: 'Aktywne',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 3287f909..86dff6b3 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -2739,6 +2739,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `Corrija esta conexão em <a href="${companyCardsRoute}">cartões corporativos</a>`,
             askAdminToFixConnection: 'Peça para um administrador corrigir essa conexão',
             reconnectBank: 'Sua conexão bancária precisa ser autenticada novamente',
+            pending: 'Pendente',
         },
         bankAccountStatus: {
             active: 'Ativo',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 8386da74..605cf19c 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -2649,6 +2649,7 @@ const translations: TranslationDeepObject<typeof en> = {
             fixConnectionIn: (companyCardsRoute: string) => `请在<a href="${companyCardsRoute}">公司卡</a>中修复此连接`,
             askAdminToFixConnection: '请联系管理员修复此连接',
             reconnectBank: '您的银行连接需要重新验证',
+            pending: '待处理',
         },
         bankAccountStatus: {
             active: '活跃',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/CardUtils.ts 87.05% <100.00%> (+0.08%) ⬆️
src/pages/settings/Wallet/PaymentMethodList.tsx 41.70% <ø> (ø)
... and 22 files with indirect coverage changes

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@mkhutornyi ready for review when you get a chance, thanks!

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@mkhutornyi, Gentle bump. thanks.

@mkhutornyi

mkhutornyi commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
Screen.Recording.2026-09-23.at.6.05.54.PM.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-09-23.at.6.03.35.PM.mov

@MelvinBot

Copy link
Copy Markdown
Contributor

Reviewed the diff. The approach is sound and state coverage is complete — the wallet only lists states 2, 3, 4, 7, so 7 → Inactive, 2/4 → Pending, 3 → Active leaves no state falling through to Active by accident, and Frozen still wins over the connection status as the description claims. Two things worth changing:

1. Virtual cards now disagree with the workspace card table. getTranslationKeyForCardStatus deliberately returns undefined for a virtual card in STATE_NOT_ISSUED/NOT_ACTIVATED because "Pending order" and "Shipped" are physical-only states. The new branch keys off state alone, so the same virtual card reads Pending in the wallet and blank in the workspace table. It also gets no CTA to match the tangerine tone you and flaviadefaria settled on, because isExpensifyCardPendingAction excludes virtual cards — no INFO dot, no prompt, just a tangerine badge asking for action that doesn't exist. The PR description states the virtual behavior is intended; if so, it's worth saying why the wallet diverges, otherwise mirror the existing helper and pass !card.nameValuePairs?.isVirtual into the pending check.

2. The suspended-before-pending ordering is unreachable, and its test asserts an impossible card. card.state holds one value: isCardInactive needs STATE_SUSPENDED (7), isCardPendingIssue/isCardPendingActivate need 2/4, so both flags can never be true together. The ordering is fine as defensive code, but "keeps an inactive Expensify Card inactive even while it is pending" only passes because it builds a param object no real card can produce. It gives false confidence about precedence — I'd drop it, or build the params from real Card fixtures so the test can't assert a state the back end can't emit.

Minor points
  • PaymentMethodList.tsx:326 evaluates isCardPendingIssue(card) || isCardPendingActivate(card) for every row, including personal and company cards where the new branch ignores it. That same pair is already OR'd in isExpensifyCardPendingAction and isCardPendingReplace, so a single isCardPendingIssueOrActivation helper would cover all three call sites.
  • leaves a non-pending Expensify Card active largely duplicates the existing keeps an active Expensify Card active when its feed reports an error case.
  • pending is inserted after inactive in en.ts but appended after reconnectBank in every other locale. Cosmetic, but it makes the blocks harder to diff.
  • The Fixed Issues link points at [Due for payment 2026-09-22] Inactive Expensify Cards Should Not Display RBR Errors, which is already due for payment, and PROPOSAL: is empty. Worth confirming with mallenexpensify that this follow-up is covered by that issue rather than needing its own.
  • All CI checks are green; the only failure is Check independent approval, which is the reviewer gate, not your code.

I reviewed this statically only — I couldn't drive the web build in a browser on this run, so I did not visually confirm the tangerine Pending badge or run the unit tests locally. Your screenshots and the green test jobs cover that.


view run

@MelvinBot

Copy link
Copy Markdown
Contributor

Code-quality pass (separate from the correctness review I posted earlier). The diff is clean overall — comments explain why rather than what, no magic values, no AI jargon, and replacing the nested ternary with explicit early returns is a genuine readability win. Two things I'd change:

1. The pending-state pair is now duplicated three times. isCardPendingIssue(card) || isCardPendingActivate(card) appears at PaymentMethodList.tsx:326, inside isCardPendingReplace, and inside isExpensifyCardPendingAction. This PR is the one that gives that pair a name in the UI, so it's the right moment to add an isCardPendingIssueOrActivation(card) helper next to the other two and use it in all three call sites. One definition also means the virtual-card question from my earlier review gets answered in one place instead of three.

2. CardConnectionStatusDisplayParams is now eight booleans, six of them derived from the same card. In CardUtils.ts:134-145, isCardBroken, isCardInactive, isCardPending, isExpensifyCard, isPersonalCard and doesCardNeedReauthentication are all computed from card at the single call site and handed back in. Every new status adds another boolean, and a second caller could derive them differently and get a status the wallet never produces. Passing card and deriving inside would cut the signature to card, shouldShowConnectionStatus, shouldShowRBR, isAdminForCardPolicy and policyID, make the precedence self-contained, and drop the isCardPending: isCardPendingStatus aliasing that only exists to avoid shadowing the imported helpers. I wouldn't block on it, but this is the third boolean added to that function recently — worth doing before a fourth.

Minor
  • walletPage.cardStatus.pending is byte-identical to walletPage.bankAccountStatus.pending in every locale I checked (en, es, it, pl) and sits nine lines away in the same walletPage block. It mirrors how active and inactive are already duplicated across those two blocks, so keeping the domain grouping is defensible — just noting that 11 locale edits bought a string that already existed.
  • pending is inserted after inactive in en.ts but appended after reconnectBank in the other ten locales. Same key, different position in every file, which makes the blocks harder to diff.
  • leaves a non-pending Expensify Card active largely overlaps the existing keeps an active Expensify Card active when its feed reports an error case.
  • Comment style is fine throughout — plain sentences, no em dashes or trailing inline comments, and the new comments explain the reasoning rather than restating the code.
  • Still open from my earlier review: the virtual-card divergence from getTranslationKeyForCardStatus, and the unreachable suspended-before-pending branch whose test asserts a card state the back end can't emit. The second one is a code-quality item too — it's dead code with a test that makes it look load-bearing.

Static analysis only — browser verification wasn't available on this run, so I didn't exercise the wallet UI or run the tests locally. All CI checks are green apart from the reviewer-approval gate.


view run

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@mkhutornyi addressed, could you take another look? Thanks

@melvin-bot
melvin-bot Bot requested a review from luacmartins September 24, 2026 09:04
@MelvinBot

MelvinBot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Regression review — 2 things worth changing before merge, 2 minor.

The logic refactors are clean and behavior-identical. The risk in this PR is the tone picked for the new badge, not the state detection.


1. The red Pending badge contradicts the green dot on the same row 🔴

statusTone: 'danger' at src/libs/CardUtils.ts:1465 renders as an error (red) badge — ConnectionStatusBadge maps danger → error.

But the very same row already sets brickRoadIndicator = INFO for exactly these cards (PaymentMethodList.tsx:307-308), and INFO renders green (ListItemRBRIndicator.tsx:29). So a card awaiting activation shows a green success dot next to a red error badge.

The PR body justifies the tone as matching a pending bank account — but that one pairs tone: 'danger' with brickRoadIndicator: ERROR (BankAccountUtils.ts:106-110), so the pairing doesn't carry over. Net effect: a card that just needs activating reads more alarming than a card the back end suspended, which stays a neutral grey Inactive.

Suggested: use 'default' for pending, or flip the indicator to ERROR to match bank accounts. Either way this needs a Design review, since the PR checklist ticks that box but the label isn't applied.

2. Pending contradicts the copy admins already see 🟡

getTranslationKeyForCardStatus already labels these two states distinctly in the workspace Expensify Cards table:

  • STATE_NOT_ISSUED → Pending order
  • NOT_ACTIVATED → Shipped

The wallet now collapses both into Pending, so for the same card an admin sees Shipped while the cardholder sees Pending. Reusing the existing strings would avoid a third vocabulary for one card state.

3. isExpensifyCardPending doesn't check the card is an Expensify Card 🟢

CardUtils.ts:1746-1748 returns true for any card in state 2 or 4, including company cards. Its sibling isExpensifyCardPendingAction gates on card.bank === CONST.EXPENSIFY_CARD.BANK (line 1819). Harmless today — the only call site is inside the isExpensifyCard branch — but it's exported, and a name promising a guard it doesn't have is an easy future regression. Add the bank check.

4. The "suspended outranks pending" test asserts an impossible state 🟢

card.state is a single value, so isCardInactive (state 7) and isExpensifyCardPending (state 2 or 4) can never both be true for real data. The ordering is correct, but that test passes flags that can't co-occur, so it gives false confidence.


Checked and found clean
  • Frozen cards — unaffected. isCardFrozen wins over connectionStatus in descriptionAddon, and isCardInactive already excludes frozen.
  • The three isCardPendingIssueOrActivation refactors — isCardPendingReplace and isExpensifyCardPendingAction are behavior-identical; only operand order changed.
  • Virtual-card exclusion — matches how getTranslationKeyForCardStatus already treats virtual cards in those states (returns undefined), so the reasoning in the PR body checks out against existing code.
  • Rows still render — states 2 and 4 are in ACTIVE_STATES ([2, 3, 4, 7]), so pending cards reach the list and the new branch is reachable.
  • Non-Expensify cards — the new isCardPending param is only read inside the isExpensifyCard branch, so company and personal card rows are untouched.
  • Translations — all 10 non-en locales updated; generateTranslations correctly skips for fork PRs.
  • CI — everything green except Check independent approval, which is unrelated to the code.
Web smoke check

Ran a smoke test on the PR branch. Settings > Wallet loads with no crash and no error UI, but the test account has no cards or bank accounts, so the badge path itself could not be exercised — a fixture with a physical card in STATE_NOT_ISSUED is needed to verify the badge visually.

Step Status
Settings > Wallet loads with no crash or JS errorsWallet heading, Bank accounts, Cards and Expensify Wallet (Beta) sections all rendered; no crash boundary or error banner.
Settings > Wallet loads with no crash on the PR branch
✅
Payment method rows render with no missing or blank badgesAccount has no bank accounts or cards, so both sections showed their normal empty states. No malformed UI.
✅
Report the status badge text on each rowNo rows exist on this account, so no badges could be observed. Not a defect — a test-data gap.
⚠️

Next Steps: Reply with @MelvinBot <your feedback> to dig into any of these.


view run · view recording

@marufsharifi

Copy link
Copy Markdown
Contributor Author
  1. The red Pending badge contradicts the green dot on the same row 🔴

The tone isn't severity here — tangerine means the user needs to act. Flaviadefaria confirmed that earlier in this PR:

this is really helpful! So it sounds like we use the tangerine color whenever we need the user to take action, which makes sense to me. Let's keep it as is.

  1. Pending contradicts the copy admins already see 🟡

They're answering different questions. The workspace table tracks where the card is in fulfilment, so "Pending order" and "Shipped" belong there. The wallet badge sits beside Active and Inactive and tells the cardholder one thing: whether they can spend on it yet.

@mkhutornyi

Copy link
Copy Markdown
Contributor

yup nothing to fix there

@luacmartins
luacmartins merged commit e83e22f into Expensify:main Sep 24, 2026
35 of 36 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.94-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

MelvinBot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Yes, help site changes are needed. I opened a draft PR: Docs updates for E/A#101399 Document the Pending Expensify Card status in Wallet. It is labeled HelpDot and assigned to you.

The Troubleshoot article listed only Active and Inactive for Expensify Cards in Wallet. This PR adds Pending, which the PR above introduced.

What changed

I checked the Account tab, the Wallet page, and the Cards section names in the live web UI. The Active, Pending, and Inactive labels come from walletPage.cardStatus in src/languages/en.ts. The test account had no Expensify Card, so I couldn't see a Pending badge in the live UI.

@marufsharifi, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run · view recording

@izarutskaya

Copy link
Copy Markdown

@marufsharifi We are stuck at step 4. For some reason we can not ship the card due to error. Tried with E account and gmail accounts. How we can avoid this? Thanks you

Screenshot 2026-09-28 101255 ship

@Julesssss

Copy link
Copy Markdown
Contributor

@marufsharifi We are stuck at step 4. For some reason we can not ship the card due to error. Tried with E account and gmail accounts. How we can avoid this? Thanks you

@luacmartins can you help with this to unblock app deploy please

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

QA passed

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.94-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants