[$175] Expensify Card - Show cardholder email below card name on admin card details
Feature request
Show card admins the cardholder’s email address on the New Expensify Expensify Card details page, directly below Card name (the card nickname).
Current behavior
Admins can see the card nickname and the cardholder’s name, but there is no dedicated email field. A cardholder with a display name cannot be identified by email from this page.
Expected behavior
Add a read-only Cardholder email field immediately below Card name, visible regardless of whether the cardholder has a display name. Preserve the existing nickname and name display.
Technical assessment
Frontend-only; no backend change is required for this feature.
- The details page already resolves the cardholder’s personal details via
usePersonalDetail(card?.accountID): DynamicWorkspaceExpensifyCardDetailsPage.tsx:144–158. - Existing admin card CSV export already obtains the cardholder email from the same personal-details
loginfield: Card.ts:1992–1995. - Insert the new field between the existing card-name and card-number fields: DynamicWorkspaceExpensifyCardDetailsPage.tsx:391–402.
Use the cardholder’s existing login, not the display name or the viewing admin’s email. Handle loading or unavailable personal details gracefully; verify direct navigation as well as navigation from the card list.
Acceptance criteria
- Admins see the cardholder’s email immediately below the nickname, both with and without a cardholder display name.
- The field is read-only and works for physical and virtual Expensify Cards.
- Long email addresses remain readable on narrow layouts.
- Missing/loading personal details do not display an incorrect identity or cause a crash.
- Include focused rendering coverage for the new field.
Slack thread: https://expensify.slack.com/archives/C03U7DCU4/p1794464270018709
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022121369801529655549
- Upwork Job ID: 2121369801529655549
- Last Price Increase: 2026-11-13
Issue Owner
Current Issue Owner: @grgia
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)
Job added to Upwork: https://www.upwork.com/jobs/~022121369801529655549
Proposal
What is the root cause of that problem?
DynamicWorkspaceExpensifyCardDetailsPage.tsx already resolves the cardholder with const [cardholder] = usePersonalDetail(card?.accountID), but only uses it for displayName (card image text) and cardholder?.timezone (limit hint). The field list under the card image is the OfflineWithFeedback + MenuItemField for Card name (value={card?.nameValuePairs?.cardTitle}) followed directly by the MenuItemField for the card number (maskCard(card?.lastFourPAN)), around lines 391-402 as the issue links. cardholder.login is never rendered, so nothing identifies the cardholder by email.
What changes do you think we should make in order to solve the problem?
- Between the card-name
OfflineWithFeedbackblock and the card-numberMenuItemField, add a read-only field, shown only whencardholder?.loginis non-empty:
{!!cardholder?.login && (
<MenuItemField
name={translate('workspace.card.issueNewCard.cardholderEmail')}
value={cardholder.login}
numberOfLinesValue={0}
isValueSelectable
/>
)}
- Add the
cardholderEmailkey ("Cardholder email") toen.ts, then to the other locale files and the translation type. - No
onPress, so the row is not interactive.numberOfLinesValue={0}lets a long address wrap on narrow layouts instead of truncating (MenuItemFieldRowdefaults to 1 line). The!!loginguard matters becauseMenuItemFieldRowrenders an emptyvalueas a name-only placeholder row, which would look like a broken field while personal details load or are missing. It also never falls back todisplayNameor the admin'scurrentUserLogin. - Test: add
tests/ui/WorkspaceExpensifyCardDetailsPageTest.tsx. Seed Onyx with a card plus a personal detail withlogin. Assert the email shows once with and once withoutdisplayName, forisVirtualtrue and false, and is absent (no placeholder row) when the personal detail is missing. Assert the email node comes after Card name and before the card number.
What alternative solutions did you explore? (Optional)
No other proposals are in the thread yet. I considered reading the email from the Card.ts CSV-export path, but the page already has the personal detail, so a new fetch would be redundant. I also considered always rendering the row with an empty value, but that draws a stray name-only placeholder.
Proposal
What is the root cause of that problem?
In src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:150, the component resolves the cardholder personal detail via:
const [cardholder] = usePersonalDetail(card?.accountID);
However, cardholder is currently only utilized for displayName (rendered on the visual card graphic via temporaryGetDisplayNameOrDefault) and cardholder?.timezone for the limit hint.
In the fields list under the card graphic (lines 391–402), the OfflineWithFeedback + MenuItemField for Card name (name={translate('workspace.card.issueNewCard.cardName')}) is followed immediately by the MenuItemField for the card number (maskCard(card?.lastFourPAN)). There is no MenuItemField rendering cardholder?.login, so the cardholder's email address is omitted from the page.
What changes do you think we should make in order to solve the problem?
-
Add
Cardholder emailMenuItemField inDynamicWorkspaceExpensifyCardDetailsPage.tsx: Between the Card nameOfflineWithFeedbackblock and the card numberMenuItemField(around line 399), add a read-onlyMenuItemFieldrendered conditionally whencardholder?.loginis present:{!!cardholder?.login && ( <MenuItemField sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD.DETAILS_CARDHOLDER_EMAIL} name={translate('workspace.card.issueNewCard.cardholderEmail')} value={cardholder.login} numberOfLinesValue={0} isValueSelectable /> )}numberOfLinesValue={0}ensures long email addresses wrap properly on narrow mobile layouts rather than truncating.isValueSelectable={true}allows admins to select and copy the email address.- Omitting
onPresskeeps the field read-only and non-interactive. - Guarding with
!!cardholder?.loginprevents rendering an empty placeholder row while personal details are loading or if absent.
-
Add translation key in
src/languages/en.tsandsrc/languages/es.ts: Underworkspace.card.issueNewCard(matchingcardName):cardholderEmail: 'Cardholder email',In Spanish (
es.ts):cardholderEmail: 'Correo electrónico del titular de la tarjeta', -
Add Sentry label in
src/CONST/SENTRY_LABEL.ts: InSENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD:DETAILS_CARDHOLDER_EMAIL: 'WorkspaceExpensifyCard-DetailsCardholderEmail', -
Automated Testing: Add unit test coverage in
tests/ui/WorkspaceExpensifyCardDetailsPageTest.tsxvalidating:- The cardholder email is rendered immediately below the Card name and above the card number.
- The email field renders correctly both when the cardholder has a display name and when they do not.
- The field handles both virtual and physical cards.
- When personal details are loading or missing, no placeholder row is rendered.
What alternative solutions did you explore? (Optional)
We explored rendering the email unconditionally with a fallback placeholder string; however, MenuItemFieldContent renders a missing value as a prominent name-only placeholder row, which would look broken during loading states. Guarding with !!cardholder?.login provides a much cleaner user experience.
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
Proposal
What is the root cause of that problem?
In src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:
const [cardholder] = usePersonalDetail(card?.accountID);
The component resolves the cardholder's personal details, but only uses cardholder for displaying displayName on the visual card preview and cardholder?.timezone for the limit hint.
In the fields list rendered below the card graphic (lines 391–402), the MenuItemField for Card name (value={card?.nameValuePairs?.cardTitle}) is followed immediately by the MenuItemField for the masked card number (maskCard(card?.lastFourPAN)). There is no field rendering cardholder?.login, so workspace admins cannot view or copy the cardholder's email address from the card details view.
What changes do you think we should make in order to solve the problem?
In src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:
- Between the Card name
OfflineWithFeedbackcontainer and the card numberMenuItemField(around line 399), add a read-onlyMenuItemFielddisplaying the cardholder's email:
{!!cardholder?.login && (
<MenuItemField
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD.DETAILS_CARDHOLDER_EMAIL}
name={translate('workspace.card.issueNewCard.cardholderEmail')}
value={cardholder.login}
numberOfLinesValue={0}
isValueSelectable
/>
)}
numberOfLinesValue={0}ensures long email addresses wrap properly without truncation across mobile screen sizes.isValueSelectableenables admins to select and copy the email text.- Guarding with
!!cardholder?.loginprevents displaying an empty placeholder row while personal details are loading or if absent. - Omitting
onPresskeeps the field cleanly read-only.
-
In
src/languages/en.tsandsrc/languages/es.ts, add the translation keycardholderEmail:en.tsunderworkspace.card.issueNewCard:cardholderEmail: 'Cardholder email'es.tsunderworkspace.card.issueNewCard:cardholderEmail: 'Correo electrónico del titular'
-
In
src/CONST/SENTRY_LABEL.ts, registerDETAILS_CARDHOLDER_EMAIL: 'WorkspaceExpensifyCard-DetailsCardholderEmail'underSENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD. -
Add UI unit test coverage in
tests/ui/WorkspaceExpensifyCardDetailsPageTest.tsxasserting that:- The cardholder email is rendered directly below the Card name and above the card number.
- The field renders properly both when the cardholder has a custom display name and when they do not.
- When personal details are loading or absent, no empty placeholder row is rendered.
What alternative solutions did you explore? (Optional)
Rendering the field unconditionally with a fallback string was considered, but rendering an empty row or placeholder during loading creates visual flash. Guarding with !!cardholder?.login cleanly preserves the layout until details are loaded.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the New Expensify Expensify Card details page, workspace card admins see the card nickname (Card name) and the cardholder's display name on the card graphic, but there is no dedicated Cardholder email field. When a cardholder has a custom display name set, admins cannot identify or copy the cardholder's email address from this page. We need a read-only Cardholder email field immediately below Card name (above the masked card number) that works across physical/virtual cards, narrow layouts, card-list navigation, and direct deep-link navigation.
What is the root cause of that problem?
- Missing
MenuItemFieldforcardholder?.logininDynamicWorkspaceExpensifyCardDetailsPage.tsx:src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:150-158already resolvesconst [cardholder] = usePersonalDetail(card?.accountID);(fromONYXKEYS.PERSONAL_DETAILS_LIST), matching how admin card CSV export resolves cardholder email insrc/libs/actions/Card.ts:1992-1995(personalDetailsList?.[String(accountID)]?.login ?? '').- However,
cardholderis only used to computedisplayNameonworkspaceCardImage(line 294) andcardholder?.timezone?.selected(line 433). Between the Card nameOfflineWithFeedbackblock (lines 391-398) and the masked card-numberMenuItemField(lines 399-402),cardholder?.loginis never rendered.
- Direct navigation cold-load gap for read-only/auditor viewers (
lines 175-190):- When navigating from the card list,
WorkspaceExpensifyCardPage.tsx:46-55callsopenPolicyExpensifyCardsPage(policyID, defaultFundID)unconditionally for anyone passingAccessOrNotFoundWrapper, hydrating bothWORKSPACE_CARDS_LISTand cardholders'PERSONAL_DETAILS_LIST. - On direct navigation to
DynamicWorkspaceExpensifyCardDetailsPage.tsx:175-190, theuseEffectgatesopenPolicyExpensifyCardsPagebehindif (!canWriteExpensifyCard) { return; }. For read-only workspace admins/auditors who have access to the page (canWriteExpensifyCard === false), direct navigation skipsopenPolicyExpensifyCardsPage, leavingworkspaceCardsand the cardholder'sPERSONAL_DETAILS_LISTentry unhydrated if not already cached.
- When navigating from the card list,
What changes do you think we should make in order to solve the problem?
-
Render the read-only
Cardholder emailMenuItemFieldinsrc/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:- Derive
const cardholderEmail = cardholder?.login?.trim();exclusively fromcardholder?.login(never falling back todisplayNameorcurrentUserLogin). - Immediately below the Card name
OfflineWithFeedbackblock (line 398) and above the card-numberMenuItemField(line 399), render:{!!cardholderEmail && ( <MenuItemField name={translate('workspace.card.issueNewCard.cardholderEmail')} value={cardholderEmail} numberOfLinesValue={0} isValueSelectable testID="cardholder-email-menu-item" /> )} - Why each prop matters in
MenuItemField.tsx:55-134:- Guarding with
!!cardholderEmailpreventsMenuItemFieldContent(lines 58-66) from rendering<MenuItemFieldNamePlaceholder>(a broken-looking single-line placeholder row) whilePERSONAL_DETAILS_LISTis loading or unavailable. - Omitting
onPresskeepsisInteractive = falseand omits<MenuItemChevron />, matching the adjacent read-only card-numberMenuItemFieldatlines 399-402(which likewise omitssentryLabel, asSENTRY_LABEL.WORKSPACE.EXPENSIFY_CARDis only attached to interactiveonPresscontrols). numberOfLinesValue={0}overrides the default1-line truncation inBaseMenuItemPrimaryTextso long email addresses wrap cleanly on narrow layouts.isValueSelectableenables native text selection on web (MenuItemRoot.tsx:92) and setsaccessibilityLabel="Cardholder email, <email>"(MenuItemField.tsx:118).
- Guarding with
- In the direct-navigation
useEffect(lines 175-190), remove theif (!canWriteExpensifyCard) { return; }early return on the read-onlyopenPolicyExpensifyCardsPage(policyID, defaultFundID)call (aligning withWorkspaceExpensifyCardPage.tsx:46-55) so direct deep links hydrateWORKSPACE_CARDS_LISTandPERSONAL_DETAILS_LISTconsistently with card-list navigation.
- Derive
-
Add
workspace.card.issueNewCard.cardholderEmailacrossen.tsand all 10 typed locale files:- Every locale module in
src/languages/satisfiesTranslationDeepObject<typeof en>(src/languages/types.ts:36-42, 74), so adding a key only toen.ts/es.tsfailstsc. AddcardholderEmailnext tocardNameunderworkspace.card.issueNewCardinen.ts('Cardholder email') and all 10 other locale files (de.ts,el.ts,es.ts,fr.ts,it.ts,ja.ts,nl.ts,pl.ts,pt-BR.ts,zh-hans.ts).
- Every locale module in
-
Add focused UI tests in
tests/ui/WorkspaceExpensifyCardDetailsPageTest.tsx:- Render
DynamicWorkspaceExpensifyCardDetailsPagevia bothSCREENS.WORKSPACE.DYNAMIC_EXPENSIFY_CARD_DETAILSandSCREENS.EXPENSIFY_CARD.DYNAMIC_EXPENSIFY_CARD_DETAILS(direct navigation and pre-seeded card-list state) and assert:- Cardholder email renders with
cardholder.loginboth whencardholder.displayNameis set and whendisplayNameis absent, while preserving Card name and the card graphic'sdisplayName. - Works identically for virtual (
isVirtual: true) and physical (isVirtual: false) cards, appearing immediately after Card name and before Virtual/Physical card number. - Long email addresses pass
numberOfLines={0}without truncation. - When
PERSONAL_DETAILS_LISTis loading or missing forcard.accountID, no placeholder row,displayName, orcurrentUserLoginis rendered, and onceOnyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, ...)resolves, the field appears without crashing.
- Cardholder email renders with
- Render
What alternative solutions did you explore? (Optional)
- Adding a trailing
<MenuItem.Copy value={cardholderEmail} />action (as inWorkspaceMemberDetailsPage.tsx:527-532): Considered, but keeping a plain read-onlyMenuItemFieldwithisValueSelectablematches the adjacent read-only card-numberMenuItemFieldonDynamicWorkspaceExpensifyCardDetailsPageand avoids introducing an unrequested action icon.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the New Expensify Expensify Card details page (DynamicWorkspaceExpensifyCardDetailsPage), workspace admins can see the card nickname (Card name) and the cardholder's display name on the card preview image, but there is no dedicated field showing the cardholder's email address (login). When a cardholder has a custom display name, admins cannot identify their email from this page.
What is the root cause of that problem?
In src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:150, the page already resolves the cardholder's personal details via const [cardholder] = usePersonalDetail(card?.accountID); (the same PERSONAL_DETAILS_LIST login field used by admin card CSV export in src/libs/actions/Card.ts:1992-1995). However, cardholder is only used to compute displayName on the card preview graphic and cardholder?.timezone?.selected for the limit hint. Between the Card name MenuItemField (lines 391–398) and the card number MenuItemField (lines 399–402), cardholder?.login is never rendered.
Additionally, on direct deep-link navigation to the card details page by a read-only viewer (canWriteExpensifyCard === false), the useEffect at lines 175–190 skips openPolicyExpensifyCardsPage(policyID, defaultFundID) because of if (!canWriteExpensifyCard) { return; }, whereas WorkspaceExpensifyCardPage.tsx calls openPolicyExpensifyCardsPage without that guard to hydrate WORKSPACE_CARDS_LIST and cardholder PERSONAL_DETAILS_LIST.
What changes do you think we should make in order to solve the problem?
- Render the read-only
Cardholder emailMenuItemFieldimmediately belowCard nameinsrc/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:- Format
cardholder?.loginwithformatPhoneNumber(cardholder.login)(matching how login/email fields are formatted across workspace member pages) and guard rendering on!!cardholder?.loginso loading or missing personal details never show an empty placeholder row or fall back todisplayName/currentUserLogin:{!!cardholder?.login && ( <MenuItemField sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD.DETAILS_CARDHOLDER_EMAIL} name={translate('workspace.expensifyCard.cardholderEmail')} value={formatPhoneNumber(cardholder.login)} numberOfLinesValue={0} isValueSelectable /> )} - Omitting
onPresskeeps the field read-only,numberOfLinesValue={0}prevents long email addresses from truncating on narrow screens, andisValueSelectablelets admins copy the email address.
- Format
- Ensure direct deep-link navigation hydrates cardholder personal details (
src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:175-190):- Remove the
if (!canWriteExpensifyCard) { return; }early return in theopenPolicyExpensifyCardsPage(policyID, defaultFundID)effect (matchingWorkspaceExpensifyCardPage.tsx:46-55) so direct navigation always hydrates the card and cardholder personal details.
- Remove the
- Add translations and Sentry label (
src/languages/en.ts,src/languages/es.ts,src/CONST/SENTRY_LABEL.ts):- Add
cardholderEmail: 'Cardholder email'(and translations) underworkspace.expensifyCard. - Add
DETAILS_CARDHOLDER_EMAIL: 'WorkspaceExpensifyCard-DetailsCardholderEmail'underSENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD.
- Add
- Add UI tests (
tests/ui/WorkspaceExpensifyCardDetailsPageTest.tsx):- Verify that
cardholder.loginrenders immediately below Card name and above the card number for both physical and virtual cards, with and without a custom display name, and is omitted cleanly while personal details are loading or absent.
- Verify that
What alternative solutions did you explore? (Optional)
- Rendering
MenuItemFieldunconditionally whencardholder?.loginis empty: Rejected becauseMenuItemFieldrenders a label-only row whenvalueis empty, causing a blank row while personal details are still loading.
📣 @RS-ITACHI! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~014898525b9c53fc32
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the New Expensify Expensify Card details page (DynamicWorkspaceExpensifyCardDetailsPage), workspace card admins see the card nickname (Card name) and cardholder's display name, but there is no dedicated read-only field displaying the cardholder's email address. A cardholder cannot be directly identified by email from this page.
What is the root cause of that problem?
In src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:391-402, the layout renders the card title (card?.nameValuePairs?.cardTitle) followed immediately by the masked card number (maskCard(card?.lastFourPAN)).
Although line 150 resolves the cardholder's personal details (const [cardholder] = usePersonalDetail(card?.accountID)), cardholder?.login is never rendered on the screen.
What changes do you think we should make in order to solve the problem?
-
Add translation key in
src/languages/en.tsandsrc/languages/es.ts: Inworkspace.card.issueNewCard:en.ts:cardholderEmail: 'Cardholder email'es.ts:cardholderEmail: 'Correo electrónico del titular'
-
Render read-only Cardholder email
MenuItemFieldinDynamicWorkspaceExpensifyCardDetailsPage.tsx: Directly below the Card nameOfflineWithFeedbackwrapper (after line 398) and above the card number field, add:<MenuItemField name={translate('workspace.card.issueNewCard.cardholderEmail')} value={cardholder?.login ?? ''} interactive={false} shouldShowRightIcon={false} numberOfLinesTitle={1} />- Uses
cardholder?.login(consistent with admin CSV export inCard.ts:1992-1995). - Read-only (
interactive={false},shouldShowRightIcon={false}). - Gracefully handles loading/missing states (
?? ''). - Preserves responsive wrapping on narrow mobile screens.
- Uses
-
Automated tests:
- In
tests/unit/DynamicWorkspaceExpensifyCardDetailsPageTest.tsx:- Test that the Cardholder email field renders with the correct value (
cardholder.login) below Card name. - Test that when
cardholderisundefined(loading or absent), the field gracefully displays an empty string without throwing errors. - Test that the field is present for both physical and virtual Expensify cards.
- Test that the Cardholder email field renders with the correct value (
- In
What alternative solutions did you explore? (Optional)
- Displaying email inside the Card name subtitle: Rejected because the issue specification explicitly requests a dedicated read-only field immediately below Card name.
- Reading login from
policy.employeeList: Rejected becauseusePersonalDetail(card?.accountID)is already subscribed and cached in memory at line 150.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@eh2077 any thoughts on the proposals so far?
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the New Expensify Expensify Card details page (DynamicWorkspaceExpensifyCardDetailsPage), workspace admins can see the card nickname (Card name) and the cardholder's display name on the card preview image, but there is no dedicated field showing the cardholder's email address (login). When a cardholder has a custom display name, admins cannot identify their email from this page.
What is the root cause of that problem?
In src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:150, the page already resolves the cardholder's personal details via const [cardholder] = usePersonalDetail(card?.accountID); (the same PERSONAL_DETAILS_LIST login field used by admin card CSV export in src/libs/actions/Card.ts:1992-1995). However, cardholder is only used to compute displayName on the card preview graphic and cardholder?.timezone?.selected for the limit hint. Between the Card name MenuItemField (lines 391–398) and the card number MenuItemField (lines 399–402), cardholder?.login is never rendered.
Additionally, on direct deep-link navigation to the card details page by a read-only viewer (canWriteExpensifyCard === false), the useEffect at lines 175–190 skips openPolicyExpensifyCardsPage(policyID, defaultFundID) because of if (!canWriteExpensifyCard) { return; }, whereas WorkspaceExpensifyCardPage.tsx calls openPolicyExpensifyCardsPage without that guard to hydrate WORKSPACE_CARDS_LIST and cardholder PERSONAL_DETAILS_LIST.
What changes do you think we should make in order to solve the problem?
- Render the read-only
Cardholder emailMenuItemFieldimmediately belowCard nameinsrc/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:- Format
cardholder?.loginwithformatPhoneNumber(cardholder.login)(matching how login/email fields are formatted across workspace member pages) and guard rendering on!!cardholder?.loginso loading or missing personal details never show an empty placeholder row or fall back todisplayName/currentUserLogin:{!!cardholder?.login && ( <MenuItemField sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD.DETAILS_CARDHOLDER_EMAIL} name={translate('workspace.expensifyCard.cardholderEmail')} value={formatPhoneNumber(cardholder.login)} numberOfLinesValue={0} isValueSelectable /> )} - Omitting
onPresskeeps the field read-only,numberOfLinesValue={0}prevents long email addresses from truncating on narrow screens, andisValueSelectablelets admins copy the email address.
- Format
- Ensure direct deep-link navigation hydrates cardholder personal details (
src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:175-190):- Remove the
if (!canWriteExpensifyCard) { return; }early return in theopenPolicyExpensifyCardsPage(policyID, defaultFundID)effect (matchingWorkspaceExpensifyCardPage.tsx:46-55) so direct navigation always hydrates the card and cardholder personal details.
- Remove the
- Add translations and Sentry label (
src/languages/en.ts,src/languages/es.ts,src/CONST/SENTRY_LABEL.ts):- Add
cardholderEmail: 'Cardholder email'(and translations) underworkspace.expensifyCard. - Add
DETAILS_CARDHOLDER_EMAIL: 'WorkspaceExpensifyCard-DetailsCardholderEmail'underSENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD.
- Add
- Add UI tests (
tests/ui/WorkspaceExpensifyCardDetailsPageTest.tsx):- Verify that
cardholder.loginrenders immediately below Card name and above the card number for both physical and virtual cards, with and without a custom display name, and is omitted cleanly while personal details are loading or absent.
- Verify that
What alternative solutions did you explore? (Optional)
- Rendering
MenuItemFieldunconditionally whencardholder?.loginis empty: Rejected becauseMenuItemFieldrenders a label-only row whenvalueis empty, causing a blank row while personal details are still loading.
On the New Expensify Expensify Card details page ( In However, In the form section directly below the action buttons (lines 396–406), the Card name Render the read-only Cardholder email row in Why this design: Add translations in Proposal
Proposal
Please re-state the problem that we are trying to solve in this issue.
DynamicWorkspaceExpensifyCardDetailsPage), workspace admins can see the card nickname (Card name) and the cardholder's display name rendered on the card graphic, but there is no dedicated field displaying the cardholder's email address (login). When a cardholder has a custom display name, admins cannot identify their email address from this page.What is the root cause of that problem?
src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:154, the page already subscribes to and resolves the cardholder's personal details via:const [cardholder] = usePersonalDetail(card?.accountID);
cardholder is currently only utilized to compute displayName for the card image graphic (lines 158–162) and cardholder?.timezone?.selected for limit hints (line 438).MenuItemField is immediately followed by the card number MenuItemField (maskCard(card?.lastFourPAN)). The cardholder's email/login (cardholder?.login, identical to what is exported by getOwnerEmailForCard in src/libs/actions/Card.ts:1992-1995) is never rendered.What changes do you think we should make in order to solve the problem?
src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx:
Immediately after the Card name OfflineWithFeedback block and before the card number MenuItemField, add:{!!cardholder?.login && (
<MenuItemField
name={translate('workspace.card.issueNewCard.cardholderEmail')}
value={formatPhoneNumber(cardholder.login)}
numberOfLinesValue={0}
>
<MenuItem.Copy value={cardholder.login} />
</MenuItemField>
)}
onPress ensures no chevron is rendered and the row remains strictly non-interactive/read-only.numberOfLinesValue={0} allows long email addresses to wrap without ellipsis or truncation on small screens, fulfilling the acceptance criterion.formatPhoneNumber(cardholder.login) (already in scope via useLocalize()) cleanly preserves email addresses as-is while properly formatting phone numbers for SMS-based users.<MenuItem.Copy value={cardholder.login} /> as children gives desktop hover and mobile long-press copy functionality, matching the exact pattern established in WorkspaceMemberDetailsPage.tsx:396-401.{!!cardholder?.login && ...} ensures that when navigating directly via deep link while PERSONAL_DETAILS_LIST is being fetched via openCardDetailsPage, no empty placeholder row or fallback identity is rendered, and no error is thrown.src/languages/en.ts and src/languages/es.ts:
Add cardholderEmail under workspace.card.issueNewCard (matching where the neighboring cardName translation is located):
src/languages/en.ts:
cardholderEmail: 'Cardholder email',
src/languages/es.ts:
cardholderEmail: 'Correo del titular de la tarjeta',
What alternative solutions did you explore? (Optional)
<MenuItemField value={cardholder?.login} /> without the !!cardholder?.login guard: Rejected because MenuItemField renders MenuItemFieldNamePlaceholder when value is undefined, which displays an awkward label-only placeholder row while personal details are loading over the network.policy.employeeList: Rejected because usePersonalDetail(card?.accountID) is already subscribed and cached in Onyx on this page.Test Plan
/workspaces/:policyID/cards/expensify-card/:cardID:
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0105126232377c4c5c
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the New Expensify Card details page (DynamicWorkspaceExpensifyCardDetailsPage), workspace admins can see the card name (nickname) and the cardholder's display name, but there is no dedicated read-only field displaying the cardholder's email address. When a cardholder has a custom display name set, their email address is not visible anywhere on this page.
What is the root cause of that problem?
In src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx (lines 391–402), the page renders the cardTitle (Card name) and the masked PAN (Card number), but omits a dedicated MenuItemField for the cardholder's login/email between them:
<OfflineWithFeedback pendingAction={card?.nameValuePairs?.pendingFields?.cardTitle}>
<MenuItemField
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.EXPENSIFY_CARD.DETAILS_CARD_NAME}
name={translate('workspace.card.issueNewCard.cardName')}
onPress={canWriteExpensifyCard ? () => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.EXPENSIFY_CARD_NAME.path)) : undefined}
value={card?.nameValuePairs?.cardTitle}
/>
</OfflineWithFeedback>
<MenuItemField
name={translate(isVirtual ? 'cardPage.virtualCardNumber' : 'cardPage.physicalCardNumber')}
value={maskCard(card?.lastFourPAN)}
/>
The page already subscribes to the cardholder's personal details via const [cardholder] = usePersonalDetail(card?.accountID); (line 148), so the data (cardholder?.login) is already present and cached in Onyx, but it was not wired into the UI.
What changes do you think we should make in order to solve the problem?
- In
src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx, insert a read-onlyMenuItemFieldfor the Cardholder email immediately following thecardTitleOfflineWithFeedbackblock and before the card number:
{!!cardholder?.login && (
<MenuItemField
name={translate('workspace.card.issueNewCard.cardholderEmail')}
value={formatPhoneNumber(cardholder.login)}
interactive={false}
numberOfLinesTitle={0}
/>
)}
Note: Using formatPhoneNumber(cardholder.login) gracefully formats phone number logins if the cardholder registered via SMS, while leaving standard email addresses unchanged. Guarding with {!!cardholder?.login && ...} prevents rendering an empty placeholder while personal details are being fetched on direct deep links.
- Add the translation key
cardholderEmailin:
src/languages/en.tsunderworkspace.card.issueNewCard:cardholderEmail: 'Cardholder email',src/languages/es.tsunderworkspace.card.issueNewCard:cardholderEmail: 'Correo del titular de la tarjeta',
What alternative solutions did you explore? (Optional)
- Rendering without
!!cardholder?.loginguard: Rejected becauseMenuItemFieldrenders a blank placeholder label whenvalueis undefined, causing UI layout shift while Onyx loads the profile data. - Reading from
policy.employeeList: Rejected becauseusePersonalDetail(card?.accountID)is already cached and actively listened to on this page.
Test Plan
- Log into New Expensify as an admin on a workspace with Expensify Cards.
- Navigate to Workspace Settings > Expensify Card.
- Click on any card (verify both virtual and physical cards).
- Verify that Cardholder email is rendered directly below Card name and above the card number.
- Verify the field is read-only (no chevron, not clickable).
- Verify with a user who has a custom display name: the card graphic shows their display name, while the field cleanly shows their email address.
- Verify long email addresses wrap properly on narrow/mobile viewports.
- Refresh the browser on the card details URL (
/workspaces/:policyID/cards/expensify-card/:cardID) to verify direct deep-link loading without flickering.
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01f014c585a22b772d
⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01f014c585a22b772d
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@MelvinBot Can you post a proposal for this issue?
Proposal
What is the root cause of that problem?
The details page already subscribes to the selected cardholder’s personal details, but never renders their login. The Card name row is followed immediately by the card-number row.
Code evidence
- Cardholder subscription:144–158.
- Existing field order:391–402.
- Admin CSV export:1992–1995 likewise uses the cardholder’s
loginfor their email.
What changes do you think we should make in order to solve the problem?
-
Insert a Cardholder email
MenuItemFieldimmediately after the Card name feedback wrapper and before the card-number field.- Use only
cardholder.login, never the display name or viewing admin’s email. - Omit
onPressso the field has no navigation or chevron. - Set
numberOfLinesValue={0}to allow wrapping andisValueSelectablefor copying on web. - Hide the row while the login is unavailable; the existing subscription will render it when details arrive.
- Preserve the existing nickname and cardholder-name display.
- Use only
-
Add a dedicated Cardholder email translation key and corresponding translations in all typed locales.
-
Add focused rendering coverage for:
- Physical and virtual cards, with and without a display name.
- Correct email identity and placement between nickname and card number.
- Missing/loading details, followed by an Onyx update that supplies the email.
- Read-only behavior and unlimited value lines.
-
Verify on web that long emails remain readable at narrow widths, and that navigation from the card list and direct URL loading both populate the correct identity.
Implementation scope and validation notes
MenuItemField:108–130 supports value selection and only renders a chevron when onPress exists. A noninteractive row needs no new Sentry label.
Translation typing:36–42 requires corresponding keys across locale objects; updating English and Spanish alone is insufficient.
Keep the existing permission and fetching logic unchanged. The page already requests card details independently of the write-permission guard:168–190. Cold-navigation response contents and narrow-layout rendering have not been runtime-verified; there is no established evidence that this feature requires removing that guard.
What alternative solutions did you explore? (Optional)
- Reusing Cardholder as the label does not meet the requested Cardholder email wording.
- Adding another fetch is unnecessary for rendering already-subscribed data.
- Changing permission guards would broaden the scope without a demonstrated hydration defect.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/106905) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.