From 9641aa58310867ea02f20a066cc7cb5a3c0f7bfe Mon Sep 17 00:00:00 2001 From: Fedi Rajhi Date: Sat, 29 Aug 2026 20:37:25 +0100 Subject: [PATCH 1/3] fix(settings): surface home address GBR on profile menu item --- src/libs/UserUtils.ts | 3 ++- src/pages/settings/useInitialSettingsPageMenuData.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/UserUtils.ts b/src/libs/UserUtils.ts index e7a000a8d099..5ac3972de83f 100644 --- a/src/libs/UserUtils.ts +++ b/src/libs/UserUtils.ts @@ -190,12 +190,13 @@ function getProfilePageBrickRoadIndicator( privatePersonalDetails: OnyxEntry, vacationDelegate: OnyxEntry, email: string | undefined, + shouldShowAddHomeAddress = false, ): LoginListIndicator { const hasPhoneNumberError = !!privatePersonalDetails?.errorFields?.phoneNumber; if (hasLoginListError(loginList) || hasPhoneNumberError || !isEmptyObject(vacationDelegate?.errors)) { return CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR; } - if (hasLoginListInfo(loginList, email)) { + if (hasLoginListInfo(loginList, email) || shouldShowAddHomeAddress) { return CONST.BRICK_ROAD_INDICATOR_STATUS.INFO; } diff --git a/src/pages/settings/useInitialSettingsPageMenuData.ts b/src/pages/settings/useInitialSettingsPageMenuData.ts index e388fcdbb22d..0bd0d55f3347 100644 --- a/src/pages/settings/useInitialSettingsPageMenuData.ts +++ b/src/pages/settings/useInitialSettingsPageMenuData.ts @@ -26,6 +26,7 @@ import {getFreeTrialText, hasSubscriptionRedDotError} from '@libs/SubscriptionUt import {shouldHideOldAppRedirect} from '@libs/TryNewDotUtils'; import {expensifyLoginsSelector, getProfilePageBrickRoadIndicator, hasDeviceManagementError} from '@libs/UserUtils'; +import useTimeSensitiveHomeAddress from '@pages/home/TimeSensitiveSection/hooks/useTimeSensitiveHomeAddress'; import {BACKGROUND_LOCATION_TRACKING_TASK_NAME} from '@pages/iou/request/step/IOURequestStepDistanceGPS/const'; import {stopGpsTripNotification} from '@pages/iou/request/step/IOURequestStepDistanceGPS/GPSNotifications'; @@ -85,6 +86,7 @@ function useInitialSettingsPageMenuData(currentUserPersonalDetails: CurrentUserP const {translate} = useLocalize(); const hasActivatedWallet = ([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM] as string[]).includes(userWallet?.tierName ?? ''); const hasLockedBankAccount = bankAccountList ? Object.values(bankAccountList).some((bankAccount) => bankAccount.accountData?.state === CONST.BANK_ACCOUNT.STATE.LOCKED) : false; + const {shouldShowAddHomeAddress} = useTimeSensitiveHomeAddress(); const [firstDayFreeTrial] = useOnyx(ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL); const [isTrackingGPS = false] = useOnyx(ONYXKEYS.GPS_DRAFT_DETAILS, { selector: isTrackingSelector, @@ -233,7 +235,7 @@ function useInitialSettingsPageMenuData(currentUserPersonalDetails: CurrentUserP surveyCompletedWithinLastMonth = daysSinceLastSurvey < surveyThresholdInDays; } - const profileBrickRoadIndicator = getProfilePageBrickRoadIndicator(loginList, privatePersonalDetails, vacationDelegate, session?.email); + const profileBrickRoadIndicator = getProfilePageBrickRoadIndicator(loginList, privatePersonalDetails, vacationDelegate, session?.email, shouldShowAddHomeAddress); const securityBrickRoadIndicator = hasDeviceManagementErrorValue ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined; const accountItems = navigationAccountMenuItemsData.items.map((item): MenuData => { if (item.screenName === SCREENS.SETTINGS.PROFILE.ROOT) { From da54519a9e2fc6bb5be544cac0e7aa60037353ef Mon Sep 17 00:00:00 2001 From: Fedi Rajhi Date: Sat, 29 Aug 2026 20:37:46 +0100 Subject: [PATCH 2/3] test(settings): cover profile GBR for missing home address --- tests/ui/InitialSettingsPageTest.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/ui/InitialSettingsPageTest.tsx b/tests/ui/InitialSettingsPageTest.tsx index a3ccbc93e8c3..30dd05544ea9 100644 --- a/tests/ui/InitialSettingsPageTest.tsx +++ b/tests/ui/InitialSettingsPageTest.tsx @@ -250,6 +250,26 @@ describe('InitialSettingsPage - agent account', () => { }); }); + it('shows info GBR on Profile when commuter exclusions require a missing home address', async () => { + await setupUser('user@expensify.com'); + + await act(async () => { + await Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}1`, { + id: '1', + name: 'Boulder Development', + commuterExclusions: {method: 'homeAndOffice'}, + }); + }); + await waitForBatchedUpdatesWithAct(); + + renderPage(); + await waitForBatchedUpdatesWithAct(); + + await waitFor(() => { + expect(screen.getByTestId('decoration-Profile-rbr').children).toEqual([CONST.BRICK_ROAD_INDICATOR_STATUS.INFO]); + }); + }); + it('shows Subscription for agent account', async () => { mockUseSubscriptionPlan.mockReturnValue(CONST.POLICY.TYPE.TEAM); await setupUser('testbot_123@expensify.ai', true); From 98856207e53a076e01f8a59701f29ea8da9ab7f4 Mon Sep 17 00:00:00 2001 From: Fedi Rajhi Date: Sat, 29 Aug 2026 20:54:27 +0100 Subject: [PATCH 3/3] fix(settings): show home address GBR on account tab avatar --- src/CONST/index.ts | 1 + src/hooks/useAccountIndicatorChecks.ts | 4 ++++ tests/unit/useAccountTabIndicatorStatusTest.ts | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 4f18dcfee527..af3097a0365a 100644 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -8260,6 +8260,7 @@ const CONST = { HAS_LOGIN_LIST_ERROR: 'hasLoginListError', HAS_WALLET_TERMS_ERRORS: 'hasWalletTermsErrors', HAS_LOGIN_LIST_INFO: 'hasLoginListInfo', + HAS_HOME_ADDRESS_INFO: 'hasHomeAddressInfo', HAS_SUBSCRIPTION_INFO: 'hasSubscriptionInfo', HAS_PHONE_NUMBER_ERROR: 'hasPhoneNumberError', HAS_PENDING_CARD_INFO: 'hasPendingCardInfo', diff --git a/src/hooks/useAccountIndicatorChecks.ts b/src/hooks/useAccountIndicatorChecks.ts index 0044a6d28833..1c613f5f4244 100644 --- a/src/hooks/useAccountIndicatorChecks.ts +++ b/src/hooks/useAccountIndicatorChecks.ts @@ -4,6 +4,8 @@ import {hasPendingExpensifyCardAction} from '@libs/CardUtils'; import {hasSubscriptionGreenDotInfo, hasSubscriptionRedDotError} from '@libs/SubscriptionUtils'; import {expensifyLoginsSelector, hasDeviceManagementError, hasLoginListError, hasLoginListInfo} from '@libs/UserUtils'; +import useTimeSensitiveHomeAddress from '@pages/home/TimeSensitiveSection/hooks/useTimeSensitiveHomeAddress'; + import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type IndicatorStatus from '@src/types/utils/IndicatorStatus'; @@ -42,6 +44,7 @@ function useAccountIndicatorChecks(): AccountIndicatorChecksResult { companyCards: {shouldShowRBR: hasCompanyCardFeedErrors}, } = useCardFeedErrors(); const {isPolicyAdmin} = usePoliciesWithCardFeedErrors(); + const {shouldShowAddHomeAddress} = useTimeSensitiveHomeAddress(); const accountChecks: Partial> = { [CONST.INDICATOR_STATUS.HAS_USER_WALLET_ERRORS]: Object.keys(userWallet?.errors ?? {}).length > 0, @@ -69,6 +72,7 @@ function useAccountIndicatorChecks(): AccountIndicatorChecksResult { const infoChecks: Partial> = { [CONST.INDICATOR_STATUS.HAS_LOGIN_LIST_INFO]: !!loginList && hasLoginListInfo(loginList, session?.email), + [CONST.INDICATOR_STATUS.HAS_HOME_ADDRESS_INFO]: shouldShowAddHomeAddress, [CONST.INDICATOR_STATUS.HAS_PENDING_CARD_INFO]: hasPendingExpensifyCardAction(allCards, privatePersonalDetails), [CONST.INDICATOR_STATUS.HAS_SUBSCRIPTION_INFO]: hasSubscriptionGreenDotInfo( stripeCustomerId, diff --git a/tests/unit/useAccountTabIndicatorStatusTest.ts b/tests/unit/useAccountTabIndicatorStatusTest.ts index b86f042aa6aa..c06c5a354adf 100644 --- a/tests/unit/useAccountTabIndicatorStatusTest.ts +++ b/tests/unit/useAccountTabIndicatorStatusTest.ts @@ -73,6 +73,11 @@ const TEST_CASES = { indicatorColor: defaultTheme.success, status: CONST.INDICATOR_STATUS.HAS_LOGIN_LIST_INFO, }, + hasHomeAddressInfo: { + name: 'has missing home address info', + indicatorColor: defaultTheme.success, + status: CONST.INDICATOR_STATUS.HAS_HOME_ADDRESS_INFO, + }, hasEmployeeCardFeedErrors: accountCardFeedTestCases.employee, hasPolicyAdminCardFeedErrors: accountCardFeedTestCases.admin, hasLockedBankAccount: { @@ -156,6 +161,14 @@ const getMockForTestCase = ({name, status}: IndicatorTestCase) => : undefined, }, [ONYXKEYS.PRIVATE_PERSONAL_DETAILS]: { + addresses: + status === CONST.INDICATOR_STATUS.HAS_HOME_ADDRESS_INFO + ? [] + : [ + { + street: '123 Test St', + }, + ], errorFields: status === CONST.INDICATOR_STATUS.HAS_PHONE_NUMBER_ERROR ? { @@ -172,6 +185,7 @@ const getMockForTestCase = ({name, status}: IndicatorTestCase) => owner: name === accountCardFeedTestCases.admin.name ? 'johndoe12@expensify.com' : 'otheruser@expensify.com', role: name === accountCardFeedTestCases.admin.name ? 'admin' : 'user', policyAccountID: cardFeed.policyAccountID, + commuterExclusions: status === CONST.INDICATOR_STATUS.HAS_HOME_ADDRESS_INFO ? {method: CONST.POLICY.COMMUTER_EXCLUSION_METHOD.HOME_AND_OFFICE} : undefined, }, [ONYXKEYS.CARD_LIST]: { card123: {