You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD] [$175] Company card nicknames don’t show in the Spend page Card filter #102683
Version Number: 9.4.99-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@greg-schroeder Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
As a workspace admin, go to Workspaces > [Workspace] > Company cards
Click a card and set a Card name (nickname)
Go to Spend and open the Card filter
Expected Result:
Each card row shows “last 4 · card nickname,” and you can search the filter by nickname. This was added in #52554.
Actual Result:
Rows show only the last 4 and the cardholder’s name. The nickname doesn’t appear and can’t be searched.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Please re-state the problem that we are trying to solve in this issue.
In the Spend page Card filter, company card rows show only the last 4 digits and the cardholder's name. The admin-set card nickname doesn't appear, and you can't search the list by nickname.
What is the root cause of that problem?
The filter reads the nickname from a different place than where the app saves it.
The filter row reads the nickname from card.nameValuePairs.cardTitle (CardFeedUtils.ts:83). It checks the custom-name NVP only for personal cards (CardFeedUtils.ts:87-90).
The workspace Card name page saves company card nicknames to the shared NVP settings.companyCardCustomNames and to nvp_expensify_ccCustomNames (CompanyCards.ts:771-782). Every workspace screen reads the nickname back through getCompanyCardCustomName (CardUtils.ts:1220-1229).
CardSelector never subscribes to the shared NVP (CardSelector.tsx:47). As a result, cardName is empty for company cards, and the subtitle shows only the last 4.
Search matches on item.cardName (CardSelector.tsx:83-87). Since cardName is empty, a nickname search finds nothing.
What changes do you think we should make in order to solve the problem?
In CardSelector, subscribe to ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER. Use a selector that merges each entry's settings.companyCardCustomNames into one cardID → name map. Pass that map to buildCardsData, then on to createCardFilterItem.
In createCardFilterItem, for company cards (not personal, not Expensify Card), set cardName to getCompanyCardCustomName(cardID, sharedNames, customCardNames). Fall back to nameValuePairs.cardTitle when no custom name exists. Leave the Expensify Card and personal card logic unchanged.
Add a unit test in tests/unit/Search/buildCardFilterDataTest.ts: a company card with a shared custom name should return that name as cardName.
Search works after this change with no other edits, because it already matches on cardName.
What alternative solutions did you explore? (Optional)
Look up the name only in the shared NVP entry keyed by card.fundID. That avoids merging all entries, but it assumes fundID always equals the domainOrWorkspaceAccountID used in the NVP key. I haven't confirmed that assumption.
Why a rename sometimes shows briefly:updateCompanyCardName also writes cardTitle optimistically into the workspace card list (CompanyCards.ts:754-770). The name can show until card data refreshes. It never shows for the admin's own cards, because the filter builds those from CARD_LIST.
Search box: The search box appears only when the list has 12 or more cards (STANDARD_LIST_ITEM_LIMIT).
Not verified: I didn't reproduce this in the app, because it needs a workspace with a connected company card feed. The root cause is confirmed from code only.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/102683) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Company card nicknames don’t show in the Spend page Card filter[/-][+][$175] Company card nicknames don’t show in the Spend page Card filter[/+]on Sep 30, 2026
Please re-state the problem that we are trying to solve in this issue.
In the Spend page Search filters, when opening the Card filter (CardSelector), company cards display only the cardholder's display name and last 4 digits. The admin-configured custom nickname does not display in the row subtitle, and searching for the card by its nickname returns no results.
What is the root cause of that problem?
There are two reasons why company card nicknames fail to display and search:
createCardFilterItem gates custom card name resolution behind isPersonal:
In src/libs/CardFeedUtils.ts (lines 83–90):
Even though CardSelector subscribes to ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES and passes customCardNames to buildCardsData, createCardFilterItem checks if (isPersonal && !isCSVImportCard).
For company cards, isPersonal is false. Thus, createCardFilterItem never inspects customCardNames for company cards and leaves cardName as card?.nameValuePairs?.cardTitle.
Company card nicknames are also stored in shared workspace NVPs:
When workspace admins rename company cards, names are stored in ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMES and shared domain member NVPs under ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER. Other screens (such as WorkspaceCompanyCardsTable) resolve company card names using CardUtils.getCompanyCardCustomName(cardID, sharedCardCustomNames, customCardNames).
Because CardSelector does not subscribe to ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER, and createCardFilterItem does not use getCompanyCardCustomName, cardName remains empty/undefined for company cards.
Search filtering fails on nicknames:
In CardSelector.tsx (lines 83–87):
Since item.cardName is empty for company cards, filtering by nickname fails to match.
What changes do you think we should make in order to solve the problem?
Add a selector for shared company card custom names in src/selectors/Card.ts:
/** Merges shared company card custom names across all workspace domain members */constallSharedCompanyCardCustomNamesSelector=(sharedNvp: OnyxCollection<CardFeeds>): Record<string,string>=>{constcombined: Record<string,string>={};for(constmemberofObject.values(sharedNvp??{})){if(!member?.settings?.companyCardCustomNames){continue;}Object.assign(combined,member.settings.companyCardCustomNames);}returncombined;};
Export allSharedCompanyCardCustomNamesSelector.
In src/components/Search/FilterComponents/CardSelector.tsx:
Subscribe to ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER using allSharedCompanyCardCustomNamesSelector:
Add Unit Test in tests/unit/Search/buildCardFilterDataTest.ts:
Verify that a company card with a custom nickname in customCardNames or sharedCardCustomNames produces item.cardName equal to the custom nickname.
Verify that filtering with searchFunction matches the nickname.
What alternative solutions did you explore? (Optional)
Only fallback to customCardNames?.[card?.cardID] without reading SHARED_NVP_PRIVATE_DOMAIN_MEMBER. However, company cards configured by other workspace admins store nicknames in the shared NVP, so subscribing via allSharedCompanyCardCustomNamesSelector ensures parity with WorkspaceCompanyCardsTable.
Activity
MelvinBot commentedon Sep 30, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In the Spend page Card filter, company card rows show only the last 4 digits and the cardholder's name. The admin-set card nickname doesn't appear, and you can't search the list by nickname.
What is the root cause of that problem?
The filter reads the nickname from a different place than where the app saves it.
card.nameValuePairs.cardTitle(CardFeedUtils.ts:83). It checks the custom-name NVP only for personal cards (CardFeedUtils.ts:87-90).settings.companyCardCustomNamesand tonvp_expensify_ccCustomNames(CompanyCards.ts:771-782). Every workspace screen reads the nickname back throughgetCompanyCardCustomName(CardUtils.ts:1220-1229).CardSelectornever subscribes to the shared NVP (CardSelector.tsx:47). As a result,cardNameis empty for company cards, and the subtitle shows only the last 4.item.cardName(CardSelector.tsx:83-87). SincecardNameis empty, a nickname search finds nothing.What changes do you think we should make in order to solve the problem?
CardSelector, subscribe toONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER. Use a selector that merges each entry'ssettings.companyCardCustomNamesinto onecardID → namemap. Pass that map tobuildCardsData, then on tocreateCardFilterItem.createCardFilterItem, for company cards (not personal, not Expensify Card), setcardNametogetCompanyCardCustomName(cardID, sharedNames, customCardNames). Fall back tonameValuePairs.cardTitlewhen no custom name exists. Leave the Expensify Card and personal card logic unchanged.tests/unit/Search/buildCardFilterDataTest.ts: a company card with a shared custom name should return that name ascardName.Search works after this change with no other edits, because it already matches on
cardName.What alternative solutions did you explore? (Optional)
Look up the name only in the shared NVP entry keyed by
card.fundID. That avoids merging all entries, but it assumesfundIDalways equals thedomainOrWorkspaceAccountIDused in the NVP key. I haven't confirmed that assumption.Investigation details
nvp_expensify_ccCustomNames.cardTitle ?? card.cardName, not the NVP.cardNametocardTitleonly.companyCardCustomNamesNVP and updated the workspace screens, but not the Search filter.updateCompanyCardNamealso writescardTitleoptimistically into the workspace card list (CompanyCards.ts:754-770). The name can show until card data refreshes. It never shows for the admin's own cards, because the filter builds those fromCARD_LIST.STANDARD_LIST_ITEM_LIMIT).Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/102683)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 30, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ChavdaSachin (
External)[-]Company card nicknames don’t show in the Spend page Card filter[/-][+][$175] Company card nicknames don’t show in the Spend page Card filter[/+]melvin-bot commentedon Sep 30, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022105371204565575660
camesenin commentedon Sep 30, 2026
bonnhatnguyen commentedon Sep 30, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
In the Spend page Search filters, when opening the Card filter (
CardSelector), company cards display only the cardholder's display name and last 4 digits. The admin-configured custom nickname does not display in the row subtitle, and searching for the card by its nickname returns no results.What is the root cause of that problem?
There are two reasons why company card nicknames fail to display and search:
createCardFilterItemgates custom card name resolution behindisPersonal:In
src/libs/CardFeedUtils.ts(lines 83–90):Even though
CardSelectorsubscribes toONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMESand passescustomCardNamestobuildCardsData,createCardFilterItemchecksif (isPersonal && !isCSVImportCard).For company cards,
isPersonalisfalse. Thus,createCardFilterItemnever inspectscustomCardNamesfor company cards and leavescardNameascard?.nameValuePairs?.cardTitle.Company card nicknames are also stored in shared workspace NVPs:
When workspace admins rename company cards, names are stored in
ONYXKEYS.NVP_EXPENSIFY_COMPANY_CARDS_CUSTOM_NAMESand shared domain member NVPs underONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER. Other screens (such asWorkspaceCompanyCardsTable) resolve company card names usingCardUtils.getCompanyCardCustomName(cardID, sharedCardCustomNames, customCardNames).Because
CardSelectordoes not subscribe toONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER, andcreateCardFilterItemdoes not usegetCompanyCardCustomName,cardNameremains empty/undefined for company cards.Search filtering fails on nicknames:
In
CardSelector.tsx(lines 83–87):Since
item.cardNameis empty for company cards, filtering by nickname fails to match.What changes do you think we should make in order to solve the problem?
src/selectors/Card.ts:Export
allSharedCompanyCardCustomNamesSelector.src/components/Search/FilterComponents/CardSelector.tsx:ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBERusingallSharedCompanyCardCustomNamesSelector:+ const [sharedCardCustomNames] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER, {selector: allSharedCompanyCardCustomNamesSelector});sharedCardCustomNamestobuildCardsData:const individualCardsSectionData = buildCardsData( workspaceCardFeeds ?? {}, userCardList ?? {}, personalDetails ?? {}, value, illustrations, companyCardFeedIcons, false, customCardNames, + sharedCardCustomNames, );src/libs/CardFeedUtils.ts:createCardFilterItemandbuildCardsDatato acceptsharedCardCustomNames?: Record<string, string>.createCardFilterItem, usegetCompanyCardCustomNamefor non-personal, non-Expensify company cards:tests/unit/Search/buildCardFilterDataTest.ts:customCardNamesorsharedCardCustomNamesproducesitem.cardNameequal to the custom nickname.searchFunctionmatches the nickname.What alternative solutions did you explore? (Optional)
Only fallback to
customCardNames?.[card?.cardID]without readingSHARED_NVP_PRIVATE_DOMAIN_MEMBER. However, company cards configured by other workspace admins store nicknames in the shared NVP, so subscribing viaallSharedCompanyCardCustomNamesSelectorensures parity withWorkspaceCompanyCardsTable.camesenin commentedon Oct 1, 2026
camesenin commentedon Oct 1, 2026
camesenin commentedon Oct 1, 2026
melvin-bot commentedon Oct 1, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
melvin-bot commentedon Oct 5, 2026
@ChavdaSachin Eep! 4 days overdue now. Issues have feelings too...
17 remaining items
melvin-bot commentedon Nov 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)mallenexpensify commentedon Nov 3, 2026
@brunovjk plz take over as C+
melvin-bot commentedon Nov 9, 2026
@brunovjk Eep! 4 days overdue now. Issues have feelings too...
brunovjk commentedon Nov 10, 2026
brunovjk commentedon Nov 11, 2026
Hey @tgolen, any update on the card nickname refactor? Thanks!
tgolen commentedon Nov 11, 2026
brunovjk commentedon Nov 16, 2026
It seems I don't have access.
expensify-chore-bot commentedon Nov 19, 2026
@brunovjk Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!