Skip to content

feat(card): prompt for personal details before virtual card reveal#91634

Open
DylanDylann wants to merge 17 commits into
Expensify:mainfrom
DylanDylann:virtual-card-missing-details
Open

feat(card): prompt for personal details before virtual card reveal#91634
DylanDylann wants to merge 17 commits into
Expensify:mainfrom
DylanDylann:virtual-card-missing-details

Conversation

@DylanDylann
Copy link
Copy Markdown
Contributor

@DylanDylann DylanDylann commented May 25, 2026

Explanation of Change

Fixed Issues

$ #91461
PROPOSAL:

Tests

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

Assign to @joekaufmanexpensify for 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 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

EU/UK virtual card

Screen.Recording.2026-05-27.at.01.18.35.mov

US virtual card

Screen.Recording.2026-05-28.at.15.29.41.mov

Reuses the existing MissingPersonalDetails flow for the virtual-card
reveal entry point so users with incomplete details fill them in
(name/DOB/address/phone) before viewing the card. ECUK virtual cards
go through the SCA reveal scenario afterwards; US virtual cards go to
the magic-code reveal page. PIN collection is already excluded for
virtual cards by the existing selector. Adds a red dot on the wallet
row and a home-page time-sensitive task as additional entry points.

Implements Expensify#91461.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@DylanDylann DylanDylann requested review from a team as code owners May 25, 2026 16:38
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 25, 2026

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 ts-node ./scripts/generateTranslations.ts --help

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

@melvin-bot melvin-bot Bot requested review from JmillsExpensify and lakchote and removed request for a team May 25, 2026 16:38
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 25, 2026

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

@DylanDylann DylanDylann marked this pull request as draft May 25, 2026 16:40
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

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.

Files with missing lines Coverage Δ
...ultifactorAuthentication/config/scenarios/index.ts 100.00% <ø> (ø)
...ultifactorAuthentication/config/scenarios/names.ts 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
...rc/libs/MultifactorAuthentication/shared/VALUES.ts 100.00% <ø> (ø)
...imeSensitiveSection/hooks/useTimeSensitiveCards.ts 100.00% <100.00%> (ø)
src/pages/settings/InitialSettingsPage.tsx 85.61% <100.00%> (+0.10%) ⬆️
src/selectors/Card.ts 88.88% <ø> (-0.59%) ⬇️
src/libs/CardUtils.ts 82.18% <80.00%> (-0.02%) ⬇️
src/pages/home/TimeSensitiveSection/index.tsx 71.42% <66.66%> (-0.53%) ⬇️
.../pages/settings/Wallet/ExpensifyCardPage/index.tsx 72.77% <33.33%> (-0.63%) ⬇️
... and 9 more
... and 20 files with indirect coverage changes

Replaces the 4-API fan-out (updatePersonalDetailsForVirtualCard
calling UPDATE_LEGAL_NAME / UPDATE_DATE_OF_BIRTH / UPDATE_PHONE_NUMBER
/ UPDATE_HOME_ADDRESS) with a single new WRITE_COMMAND modeled on
SetPersonalDetailsAndShipExpensifyCards. Cleaner backend contract and
keeps the submission atomic from the FE perspective.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@DylanDylann
Copy link
Copy Markdown
Contributor Author

@chuckdries Would you like to take over this PR?

@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 26d5ace68bc..6c6f6240ae0 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -958,6 +958,11 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: 'Geldbörse',
             },
+            addVirtualCardPersonalDetails: {
+                title: 'Fügen Sie Ihre persönlichen Daten hinzu',
+                subtitle: 'Fügen Sie Ihre Daten hinzu, um Ihre Expensify Karte anzusehen und zu verwenden.',
+                cta: 'Details hinzufügen',
+            },
         },
         announcements: 'Ankündigungen',
         discoverSection: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 511d7baf7f4..52e08e15596 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -888,11 +888,7 @@ const translations: TranslationDeepObject<typeof en> = {
                 subtitle: 'Proporciona una dirección para recibir tu Tarjeta Expensify.',
                 cta: 'Añade dirección',
             },
-            addVirtualCardPersonalDetails: {
-                title: 'Añade tus datos personales',
-                subtitle: 'Añade tus datos para ver y empezar a usar tu Tarjeta Expensify.',
-                cta: 'Añadir datos',
-            },
+            addVirtualCardPersonalDetails: {title: 'Añade tus datos personales', subtitle: 'Añade tus datos para ver y empezar a usar tu Tarjeta Expensify.', cta: 'Añade detalles'},
             addPaymentCard: {
                 title: 'Añade una tarjeta de pago para seguir usando Expensify',
                 subtitle: 'Cuenta > Suscripción',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 079293757c4..23252d0d36b 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -961,6 +961,11 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: 'Portefeuille',
             },
+            addVirtualCardPersonalDetails: {
+                title: 'Ajoutez vos informations personnelles',
+                subtitle: 'Ajoutez vos informations pour afficher et commencer à utiliser votre Carte Expensify.',
+                cta: 'Ajouter des détails',
+            },
         },
         announcements: 'Annonces',
         discoverSection: {
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 3feb94469cc..e5cb6ad3a59 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -959,6 +959,11 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: 'Portafoglio',
             },
+            addVirtualCardPersonalDetails: {
+                title: 'Aggiungi i tuoi dati personali',
+                subtitle: 'Aggiungi i tuoi dati per visualizzare e iniziare a usare la tua Carta Expensify.',
+                cta: 'Aggiungi dettagli',
+            },
         },
         announcements: 'Annunci',
         discoverSection: {
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 78c68061cdb..cde18967b15 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -942,6 +942,7 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: 'ウォレット',
             },
+            addVirtualCardPersonalDetails: {title: '個人情報を追加してください', subtitle: 'Expensify カードを表示して使い始めるには、詳細情報を入力してください。', cta: '詳細を追加'},
         },
         announcements: 'お知らせ',
         discoverSection: {
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 1a3fc48f906..eb89d8ba9ad 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -957,6 +957,11 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: 'Portemonnee',
             },
+            addVirtualCardPersonalDetails: {
+                title: 'Voeg je persoonlijke gegevens toe',
+                subtitle: 'Voeg je gegevens toe om je Expensify Kaart te bekijken en te gaan gebruiken.',
+                cta: 'Details toevoegen',
+            },
         },
         announcements: 'Aankondigingen',
         discoverSection: {
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 995aa727aeb..b265fd7409e 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -959,6 +959,7 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: 'Portfel',
             },
+            addVirtualCardPersonalDetails: {title: 'Dodaj swoje dane osobowe', subtitle: 'Dodaj swoje dane, aby wyświetlić i zacząć używać swojej Karty Expensify.', cta: 'Dodaj szczegóły'},
         },
         announcements: 'Ogłoszenia',
         discoverSection: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 6fa49367a32..0cfb8f18448 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -957,6 +957,11 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: 'Carteira',
             },
+            addVirtualCardPersonalDetails: {
+                title: 'Adicione seus dados pessoais',
+                subtitle: 'Adicione seus dados para visualizar e começar a usar seu Cartão Expensify.',
+                cta: 'Adicionar detalhes',
+            },
         },
         announcements: 'Comunicados',
         discoverSection: {
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 22ed75b0da0..00e60bf1f06 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -925,6 +925,7 @@ const translations: TranslationDeepObject<typeof en> = {
                 workspaceSubtitle: ({policyName}: {policyName: string}) => policyName,
                 personalSubtitle: '钱包',
             },
+            addVirtualCardPersonalDetails: {title: '添加您的个人信息', subtitle: '添加您的详细信息以查看并开始使用 Expensify 卡。', cta: '添加详细信息'},
         },
         announcements: '公告',
         discoverSection: {

Note

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

View workflow run

@DylanDylann DylanDylann marked this pull request as ready for review May 26, 2026 14:40
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de5abedd4e

ℹ️ 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".

Comment thread src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx Outdated
@DylanDylann DylanDylann marked this pull request as draft May 26, 2026 17:34
@DylanDylann DylanDylann marked this pull request as ready for review May 26, 2026 18:17
Comment thread src/pages/settings/Wallet/PaymentMethodList.tsx Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57adf876f9

ℹ️ 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".

Comment thread src/libs/actions/PersonalDetails.ts Outdated
@DylanDylann
Copy link
Copy Markdown
Contributor Author

@codex review

@DylanDylann
Copy link
Copy Markdown
Contributor Author

@MelvinBot PLease review this PR

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08d7567c97

ℹ️ 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".

Comment thread src/pages/settings/Wallet/ExpensifyCardPage/index.tsx
@MelvinBot
Copy link
Copy Markdown
Contributor

🤖 PR Review

All CI checks pass. The overall approach is sound — new SCA scenario for UK/EU virtual cards, home page notification, wallet GBR, and the two code paths (biometrics/passkeys vs magic code) make sense. A few issues:

1. hasVirtualExpensifyCardMissingPersonalDetails doesn't filter by card state (CardUtils.ts)

The home page hook (useTimeSensitiveCards) correctly gates on CONST.EXPENSIFY_CARD.ACTIVE_STATES.includes(card.state), but the new hasVirtualExpensifyCardMissingPersonalDetails used for the settings page GBR indicator doesn't check card state at all. This could show a misleading info indicator for deactivated/closed virtual cards. Consider adding an active-state check to stay consistent.

2. Unhandled promise rejection in magic code path (MissingPersonalDetailsMagicCodePage.tsx)

setPersonalDetailsAndRevealExpensifyCard(values, countryCode, Number(cardID), validateCode).then((details) => {
    if (!details) { return; }
    ...
});

There's no .catch() — if makeRequestWithSideEffects throws (network error, etc.), the rejection is unhandled. The SCA path (setPersonalDetailsAndRevealExpensifyCardWithSCA) wraps its call in try/catch, but this path doesn't.

3. Minor style (CardUtils.ts) — missing blank line between hasVirtualExpensifyCardMissingPersonalDetails's closing brace and const isCurrencySupportedForECards.

Otherwise the implementation looks clean — the refactor from isExpensifyCardUkEuSupportedSelector to direct isUkEuExpensifyCard(targetCard) is a nice simplification, the startFrom guard removal is correct since the boolean derivation handles undefined, and the two distinct reveal paths (SCA vs validate code) are well-separated.

@DylanDylann
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1af90dcf4b

ℹ️ 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".

Comment thread src/libs/actions/PersonalDetails.ts Outdated
Comment thread src/libs/API/types.ts
@DylanDylann
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ad5703884

ℹ️ 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".

iconHeight: variables.cardIconHeight,
isInactive: isCardInactive(card),
isCardFrozen: isCardFrozen(card),
shouldShowMissingPersonalDetailsAction: isExpensifyCard(card) && !!card?.nameValuePairs?.isVirtual && hasMissingPersonalDetails,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hide the personal-details CTA for delegates

When the app is being used via delegated access, ExpensifyCardPage deliberately hides the virtual-card reveal button (isSignedInAsDelegate gates the right component), but this new wallet-row CTA is shown solely from card type plus missing details. In that delegated context, the user can start the missing-personal-details flow from the wallet list and potentially reach the reveal path that the card detail page suppresses, so this should include the same delegated-access guard before setting the action.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as below - it's possible we want to let delegates fill out the details but bail before we reveal the PAN. Not sure

Copy link
Copy Markdown
Contributor Author

@DylanDylann DylanDylann May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delegated access can't bypass this flow, a magic code from the original account is still required to enroll the two biometric methods needed to reveal card details. As a result, they cannot complete the address update or reveal without the magic code from the original account

Same discussion here: #91634 (comment)

Comment on lines +42 to +44
if (isVirtualCard) {
if (personalDetailsMissing) {
virtualCardsNeedingPersonalDetails.push(card);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Suppress the home reveal prompt for delegates

This adds virtual cards with missing personal details to the time-sensitive home section without checking delegated access. Since the card detail page hides reveal actions when account.delegatedAccess.delegate is set, a delegate can still be prompted from Home to enter the same add-details/reveal flow; gate this list with the same delegate condition so the sensitive card-details path is not advertised there.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this seems like a requirements question. If delegates are allowed to set personal details, we should probably prompt them here, even if the reveal isn't ultimately allowed? WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, this flow triggers the reveal card action, along with prompting for the personal details. If users are delegated access, they can't bypass this flow because a magic code from the original account is still required to enroll the two biometric methods needed to reveal card details. As a result, they cannot complete the address update and reveal card without the magic code from the original account. I can think of two options for delegated access users:

  1. Navigate them directly to the personal detail prompt flow without revealing the card (preferred)
  2. Hide the add detail button from them

I'd like to hear your thoughts on which approach works better.

cc @joekaufmanexpensify @rafecolton

Copy link
Copy Markdown
Contributor

@chuckdries chuckdries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things are looking decent. A few questions, and can you please fill out some test steps for documentation purposes?

setRevealedVirtualCardDetails(cardID, details);
clearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM);
Navigation.closeRHPFlow();
Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAIN_CARD.getRoute(cardID));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we close the RHP explicitly before navigating here?

Copy link
Copy Markdown
Contributor Author

@DylanDylann DylanDylann May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing RHPs is necessary to refresh the navigation stack after revealing card details

const [areAllCardsShipped] = useOnyx(ONYXKEYS.CARD_LIST, {selector: areAllExpensifyCardsShipped});
const targetCardSelector = useCallback((cardList: OnyxEntry<CardList>) => (cardID ? cardList?.[cardID] : undefined), [cardID]);
const [targetCard] = useOnyx(ONYXKEYS.CARD_LIST, {selector: targetCardSelector});
const isVirtualCard = !!targetCard?.nameValuePairs?.isVirtual;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file, is there any chance of something bad happening if targetCard is temporarily undefined because it's still hydrating from onyx i.e. on reload?

Copy link
Copy Markdown
Contributor Author

@DylanDylann DylanDylann May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested accessing this page by deep link right after clearing the cache, but I didn't encounter any problem. Card data is only used after the confirm button is triggered. Even though the data is hydrating when users arrive, I believe that after they fill in the magic code and click the confirm button, the data will be available

Comment on lines +42 to +44
if (isVirtualCard) {
if (personalDetailsMissing) {
virtualCardsNeedingPersonalDetails.push(card);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this seems like a requirements question. If delegates are allowed to set personal details, we should probably prompt them here, even if the reveal isn't ultimately allowed? WDYT?

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.

4 participants