From 5fbeba950b4924e4379dee3dd026ada5c693f750 Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Wed, 24 Dec 2025 12:16:20 +0800 Subject: [PATCH 1/4] Fix: Phone number user shows @expensify.sms on Reports --- .../Search/ExpenseReportListItemRow.tsx | 4 ++-- .../Search/UserInfoAndActionButtonRow.tsx | 4 ++-- .../WorkspaceCompanyCardsTableItem.tsx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/SelectionListWithSections/Search/ExpenseReportListItemRow.tsx b/src/components/SelectionListWithSections/Search/ExpenseReportListItemRow.tsx index 161362cd38da3..5435fe69448ae 100644 --- a/src/components/SelectionListWithSections/Search/ExpenseReportListItemRow.tsx +++ b/src/components/SelectionListWithSections/Search/ExpenseReportListItemRow.tsx @@ -130,7 +130,7 @@ function ExpenseReportListItemRow({ )} @@ -141,7 +141,7 @@ function ExpenseReportListItemRow({ )} diff --git a/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx b/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx index 4d514f30a1fb1..bf73f2feacb43 100644 --- a/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx +++ b/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx @@ -34,8 +34,8 @@ function UserInfoAndActionButtonRow({ const [isActionLoading] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${transactionItem.reportID}`, {canBeMissing: true, selector: isActionLoadingSelector}); const hasFromSender = !!item?.from && !!item?.from?.accountID && !!item?.from?.displayName; const hasToRecipient = !!item?.to && !!item?.to?.accountID && !!item?.to?.displayName; - const participantFromDisplayName = item?.from?.displayName ?? item?.from?.login ?? translate('common.hidden'); - const participantToDisplayName = item?.to?.displayName ?? item?.to?.login ?? translate('common.hidden'); + const participantFromDisplayName = item.formattedFrom ?? ''; + const participantToDisplayName = item.formattedTo ?? ''; const shouldShowToRecipient = hasFromSender && hasToRecipient && !!item?.to?.accountID && !!isCorrectSearchUserName(participantToDisplayName); return ( { From 5b62ab0aeed0594822fd8ddd43815170a610775a Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Wed, 24 Dec 2025 13:03:17 +0800 Subject: [PATCH 2/4] lint fix --- .../Search/UserInfoAndActionButtonRow.tsx | 5 ++--- .../WorkspaceCompanyCardsTableItem.tsx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx b/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx index bf73f2feacb43..c22656e5bbc7d 100644 --- a/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx +++ b/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx @@ -29,13 +29,12 @@ function UserInfoAndActionButtonRow({ }) { const styles = useThemeStyles(); const {isLargeScreenWidth} = useResponsiveLayout(); - const {translate} = useLocalize(); const transactionItem = item as unknown as TransactionListItemType; const [isActionLoading] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${transactionItem.reportID}`, {canBeMissing: true, selector: isActionLoadingSelector}); const hasFromSender = !!item?.from && !!item?.from?.accountID && !!item?.from?.displayName; const hasToRecipient = !!item?.to && !!item?.to?.accountID && !!item?.to?.displayName; - const participantFromDisplayName = item.formattedFrom ?? ''; - const participantToDisplayName = item.formattedTo ?? ''; + const participantFromDisplayName = item.formattedFrom ?? item?.from?.displayName ?? ''; + const participantToDisplayName = item.formattedTo ?? item?.to?.displayName ?? ''; const shouldShowToRecipient = hasFromSender && hasToRecipient && !!item?.to?.accountID && !!isCorrectSearchUserName(participantToDisplayName); return ( { From f00b999b35e7f3adc1b50b354affa09997bce14d Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Wed, 24 Dec 2025 13:15:18 +0800 Subject: [PATCH 3/4] lint fix --- .../Search/UserInfoAndActionButtonRow.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx b/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx index c22656e5bbc7d..dc993d368b8a4 100644 --- a/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx +++ b/src/components/SelectionListWithSections/Search/UserInfoAndActionButtonRow.tsx @@ -2,7 +2,6 @@ import React from 'react'; import {View} from 'react-native'; import type {StyleProp, ViewStyle} from 'react-native'; import type {TransactionListItemType, TransactionReportGroupListItemType} from '@components/SelectionListWithSections/types'; -import useLocalize from '@hooks/useLocalize'; import useOnyx from '@hooks/useOnyx'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; From dc4b5aef7732c9660df4a1af74c28dd4beea583c Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Fri, 26 Dec 2025 20:04:44 +0800 Subject: [PATCH 4/4] minor fix --- .../WorkspaceCompanyCardsTableItem.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableItem.tsx b/src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableItem.tsx index 2d46e1ecbcef2..c4bc65afb138d 100644 --- a/src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableItem.tsx +++ b/src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableItem.tsx @@ -1,3 +1,4 @@ +import {Str} from 'expensify-common'; import React from 'react'; import {View} from 'react-native'; import Avatar from '@components/Avatar'; @@ -88,7 +89,7 @@ function WorkspaceCompanyCardTableItem({ }: WorkspaceCompanyCardTableItemProps) { const styles = useThemeStyles(); const theme = useTheme(); - const {translate, formatPhoneNumber} = useLocalize(); + const {translate} = useLocalize(); const Expensicons = useMemoizedLazyExpensifyIcons(['ArrowRight']); const {failedCompanyCardAssignment} = item; @@ -108,10 +109,10 @@ function WorkspaceCompanyCardTableItem({ } const lastCardNumbers = isPlaidCardFeed ? lastFourNumbersFromCardName(cardName) : splitMaskedCardNumber(cardName)?.lastDigits; - const cardholderLoginText = !shouldUseNarrowTableLayout && isAssigned ? formatPhoneNumber(cardholder?.login ?? '') : undefined; + const cardholderLoginText = !shouldUseNarrowTableLayout && isAssigned ? Str.removeSMSDomain(cardholder?.login ?? '') : undefined; const narrowWidthCardName = isAssigned ? `${customCardName ?? ''}${lastCardNumbers ? ` - ${lastCardNumbers}` : ''}` : cardName; - const leftColumnTitle = isAssigned ? formatPhoneNumber(cardholder?.displayName ?? '') : translate('workspace.moreFeatures.companyCards.unassignedCards'); + const leftColumnTitle = isAssigned ? Str.removeSMSDomain(cardholder?.displayName ?? '') : translate('workspace.moreFeatures.companyCards.unassignedCards'); const leftColumnSubtitle = shouldUseNarrowTableLayout ? narrowWidthCardName : cardholderLoginText; const resetFailedCompanyCardAssignment = () => {