From 68a65f3018581f24092d959813d1d55bbe7af90b Mon Sep 17 00:00:00 2001 From: "Pujan Shah (via MelvinBot)" Date: Thu, 19 Nov 2026 12:15:55 +0000 Subject: [PATCH 1/5] Compose MenuItem supporting details in callers Co-authored-by: Pujan Shah --- config/oxlint/oxlint.seatbelt.tsv | 5 +- .../ReportActionItem/MoneyRequestView.tsx | 78 +++++++++++++------ src/components/ValuePicker/index.tsx | 62 +++++++++++---- src/pages/DynamicFlagCommentPage.tsx | 32 ++++++-- src/pages/settings/Profile/ProfilePage.tsx | 48 +++++++++--- tests/ui/FormMenuItemInputsTest.tsx | 51 ++++++++++++ tests/ui/MoneyRequestViewReceiptTest.tsx | 2 +- tests/ui/MoneyRequestViewTest.tsx | 19 +++-- tests/ui/ProfilePageTest.tsx | 52 ++++++------- 9 files changed, 249 insertions(+), 100 deletions(-) diff --git a/config/oxlint/oxlint.seatbelt.tsv b/config/oxlint/oxlint.seatbelt.tsv index daf6ce3bf89d..48b07ca4c647 100644 --- a/config/oxlint/oxlint.seatbelt.tsv +++ b/config/oxlint/oxlint.seatbelt.tsv @@ -292,7 +292,7 @@ "../../src/components/ReimbursementAccountLoadingIndicator.tsx" "no-restricted-imports" 1 "../../src/components/ReportActionItem/MoneyRequestReceiptView.tsx" "@typescript-eslint/no-unsafe-type-assertion" 2 "../../src/components/ReportActionItem/MoneyRequestReceiptView.tsx" "react-hooks/set-state-in-effect" 1 -"../../src/components/ReportActionItem/MoneyRequestView.tsx" "@typescript-eslint/no-deprecated/MenuItemWithTopDescription" 5 +"../../src/components/ReportActionItem/MoneyRequestView.tsx" "@typescript-eslint/no-deprecated/MenuItemWithTopDescription" 4 "../../src/components/ReportActionItem/ReportActionItemImage.tsx" "@typescript-eslint/no-unnecessary-type-assertion" 2 "../../src/components/ReportActionItem/TaskPreview.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/components/ReportActionItem/TaskView.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 @@ -460,7 +460,6 @@ "../../src/components/UserInitialsAvatar.tsx" "@typescript-eslint/no-deprecated/fontSize" 1 "../../src/components/ValidateCodeActionModal/ValidateCodeActionContent.tsx" "rulesdir/no-onyx-loading-status" 1 "../../src/components/ValidateCodeInput.tsx" "react-hooks/set-state-in-effect" 3 -"../../src/components/ValuePicker/index.tsx" "@typescript-eslint/no-deprecated/MenuItemWithTopDescription" 1 "../../src/components/ValuePicker/ValueSelectorModal.tsx" "no-restricted-imports" 1 "../../src/components/VideoPlayer/BaseVideoPlayer.tsx" "@typescript-eslint/no-unnecessary-type-assertion" 4 "../../src/components/VideoPlayer/BaseVideoPlayer.tsx" "@typescript-eslint/no-unsafe-type-assertion" 7 @@ -1052,7 +1051,6 @@ "../../src/pages/domain/Members/MoveUserBetweenGroupsPage.tsx" "no-restricted-imports" 1 "../../src/pages/domain/Members/MoveUsersBetweenGroupsPage.tsx" "no-restricted-imports" 1 "../../src/pages/DynamicEditReportFieldPage.tsx" "no-restricted-imports" 1 -"../../src/pages/DynamicFlagCommentPage.tsx" "@typescript-eslint/no-deprecated/MenuItem" 1 "../../src/pages/DynamicFlagCommentPage.tsx" "no-restricted-imports" 1 "../../src/pages/DynamicNewReportWorkspaceSelectionPage.tsx" "no-restricted-imports" 1 "../../src/pages/DynamicReferralDetailsPage.tsx" "@typescript-eslint/no-deprecated/MenuItem" 1 @@ -1373,7 +1371,6 @@ "../../src/pages/settings/Profile/PersonalDetails/PrivatePersonalDetailsPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 7 "../../src/pages/settings/Profile/PersonalDetails/PrivatePersonalDetailsPage.tsx" "no-restricted-imports" 1 "../../src/pages/settings/Profile/PersonalDetails/PrivatePersonalDetailsPage.tsx" "react-hooks/purity" 2 -"../../src/pages/settings/Profile/ProfilePage.tsx" "@typescript-eslint/no-deprecated/MenuItemWithTopDescription" 1 "../../src/pages/settings/Profile/ProfilePage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/pages/settings/Profile/ProfilePage.tsx" "no-restricted-imports" 1 "../../src/pages/settings/Profile/PronounsPage.tsx" "no-restricted-imports" 1 diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 33ade70e6765..588ea0c87c03 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -706,7 +706,7 @@ function MoneyRequestView({ event?.stopPropagation(); openExternalLink(`${CONST.GOOGLE_SEARCH_URL}${encodeURIComponent(originalMerchantForGoogleSearch)}`); }} - style={[styles.flexRow, styles.alignItemsCenter, styles.mt1, styles.alignSelfStart]} + style={[styles.flexRow, styles.alignItemsCenter, styles.alignSelfStart]} > {translate('common.googleThisMerchant', { @@ -1412,31 +1412,59 @@ function MoneyRequestView({ distanceRequestFields ) : ( - { - Navigation.navigate( - createDynamicRoute( - DYNAMIC_ROUTES.MONEY_REQUEST_STEP_MERCHANT.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction.transactionID, transactionThreadReport?.reportID), - ), - ); - }} - wrapperStyle={[styles.taskDescriptionMenuItem]} - furtherDetailsComponent={shouldShowGoogleMerchantSearchLink ? renderGoogleMerchantSearchLink() : undefined} - brickRoadIndicator={getErrorForField('merchant') ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined} - errorText={getErrorForField('merchant')} - errorTextStyle={styles.userSelectNone} - numberOfLinesTitle={0} - copyValue={merchantCopyValue} - copyable={!canEditMerchant && !!merchantCopyValue} - isTitleSelectable={!!merchantCopyValue} - /> + shouldAllowTextSelection={!!merchantCopyValue} + shouldBeAccessible={canEditMerchant || !shouldShowGoogleMerchantSearchLink} + style={styles.taskDescriptionMenuItem} + onPress={ + canEditMerchant + ? callIfAuthenticated(() => { + Navigation.navigate( + createDynamicRoute( + DYNAMIC_ROUTES.MONEY_REQUEST_STEP_MERCHANT.getRoute( + CONST.IOU.ACTION.EDIT, + iouType, + transaction.transactionID, + transactionThreadReport?.reportID, + ), + ), + ); + }, session) + : undefined + } + > + + + {updatedMerchantTitle ? ( + <> + {translate('common.merchant')} + + {updatedMerchantTitle} + + + ) : ( + {translate('common.merchant')} + )} + {shouldShowGoogleMerchantSearchLink && renderGoogleMerchantSearchLink()} + + + {!!getErrorForField('merchant') && } + {canEditMerchant && } + {!canEditMerchant && !!merchantCopyValue && } + + + {!!getErrorForField('merchant') && ( + + )} + )} diff --git a/src/components/ValuePicker/index.tsx b/src/components/ValuePicker/index.tsx index 4481081c3e83..c240b7fb1dbb 100644 --- a/src/components/ValuePicker/index.tsx +++ b/src/components/ValuePicker/index.tsx @@ -1,9 +1,17 @@ -import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; +import MenuItem from '@components/MenuItem'; +import Text from '@components/Text'; + +import useOnyx from '@hooks/useOnyx'; +import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; +import {callIfAuthenticated} from '@userActions/Session'; + import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; +import {authTokenTypeSelector} from '@selectors/Session'; import React, {useState} from 'react'; import {View} from 'react-native'; @@ -14,7 +22,7 @@ import ValueSelectorModal from './ValueSelectorModal'; function ValuePicker({ value, - label, + label = '', modalHeaderTitle, shouldReadErrorWithLabel, items, @@ -33,6 +41,8 @@ function ValuePicker({ disabled = false, }: ValuePickerProps) { const [isPickerVisible, setIsPickerVisible] = useState(false); + const [session] = useOnyx(ONYXKEYS.SESSION, {selector: authTokenTypeSelector}); + const styles = useThemeStyles(); const showPickerModal = () => { setIsPickerVisible(true); @@ -51,25 +61,51 @@ function ValuePicker({ }; const selectedItem = items?.find((item) => item.value === value); + const title = selectedItem?.label || placeholder || ''; return ( {shouldShowModal ? ( <> - + > + + + {title ? ( + <> + {label} + {title} + + ) : ( + {label} + )} + {!!furtherDetails && ( + + {furtherDetails} + + )} + + + {!!errorText && } + + + + {!!errorText && ( + + )} + ( - flagComment(item.severity), session)} style={[styles.pt2, styles.pb4, styles.ph5, styles.flexRow]} - furtherDetails={item.furtherDetails} - furtherDetailsIcon={item.furtherDetailsIcon} - /> + > + + + {item.name} + {item.description} + + + + {item.furtherDetails} + + + + + + + + )); return ( diff --git a/src/pages/settings/Profile/ProfilePage.tsx b/src/pages/settings/Profile/ProfilePage.tsx index 092ad83ee3ea..3a28d7881350 100755 --- a/src/pages/settings/Profile/ProfilePage.tsx +++ b/src/pages/settings/Profile/ProfilePage.tsx @@ -10,11 +10,11 @@ import MenuItem from '@components/MenuItem'; import MenuItemField from '@components/MenuItem/presets/MenuItemField'; import MenuItemSectionRoot from '@components/MenuItem/presets/MenuItemSectionRoot'; import MenuItemGroup from '@components/MenuItemGroup'; -import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; +import Text from '@components/Text'; import VacationDelegateMenuItem from '@components/VacationDelegateMenuItem'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; @@ -27,10 +27,12 @@ import useOnyx from '@hooks/useOnyx'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useSafeAreaPaddings from '@hooks/useSafeAreaPaddings'; import useScrollEnabled from '@hooks/useScrollEnabled'; +import useSingleExecution from '@hooks/useSingleExecution'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useVacationDelegatePersonalDetails from '@hooks/useVacationDelegatePersonalDetails'; +import useWaitForNavigation from '@hooks/useWaitForNavigation'; import {clearDraftValues} from '@libs/actions/FormActions'; import getVacationDelegateDisplayName from '@libs/getVacationDelegateDisplayName'; @@ -46,6 +48,7 @@ import {formatVacationDelegateClearDateTime, getActiveVacationDelegate, getVacat import useTimeSensitiveHomeAddress from '@pages/home/TimeSensitiveSection/hooks/useTimeSensitiveHomeAddress'; import {clearAgentAvatarUpdateError} from '@userActions/Agent'; +import {callIfAuthenticated} from '@userActions/Session'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; @@ -122,6 +125,8 @@ function ProfilePage() { const vacationDelegateBrickRoadIndicator = isEmptyObject(getVacationDelegateErrors(vacationDelegate)) ? undefined : CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR; const {isActingAsDelegate} = useDelegateNoAccessState(); const {showDelegateNoAccessModal} = useDelegateNoAccessActions(); + const {singleExecution} = useSingleExecution(); + const waitForNavigate = useWaitForNavigation(); const publicOptions: Array<{ description: string; title: string; @@ -215,7 +220,7 @@ function ProfilePage() { showDelegateNoAccessModal(); return; } - Navigation.navigate(ROUTES.SETTINGS_PRIVATE_PERSONAL_DETAILS.getRoute(fieldToFocus)); + singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.SETTINGS_PRIVATE_PERSONAL_DETAILS.getRoute(fieldToFocus))))(); }; const privateOptions: Array<{ @@ -385,18 +390,37 @@ function ProfilePage() { ) : ( {privateOptions.map((detail) => ( - + > + + + {detail.title ? ( + <> + {detail.description} + {detail.title} + + ) : ( + {detail.description} + )} + {!!detail.furtherDetails && ( + + {detail.furtherDetails} + + )} + + + {!!detail.brickRoadIndicator && } + + + + ))} )} diff --git a/tests/ui/FormMenuItemInputsTest.tsx b/tests/ui/FormMenuItemInputsTest.tsx index 33fed4066727..813c6a7cb199 100644 --- a/tests/ui/FormMenuItemInputsTest.tsx +++ b/tests/ui/FormMenuItemInputsTest.tsx @@ -4,6 +4,7 @@ import {fireEvent, render, screen} from '@testing-library/react-native'; import {LocaleContextProvider} from '@components/LocaleContextProvider'; import MenuItem from '@components/MenuItem'; import TimeModalPicker from '@components/TimeModalPicker'; +import ValuePicker from '@components/ValuePicker'; import Navigation from '@libs/Navigation/Navigation'; @@ -32,6 +33,7 @@ const cases = [ ['Type', TypeSelector, CONST.SENTRY_LABEL.WORKSPACE.REPORT_FIELDS.CREATE_TYPE], ['Initial value', InitialListValueSelector, CONST.SENTRY_LABEL.WORKSPACE.REPORT_FIELDS.CREATE_INITIAL_VALUE], ['Time', TimeModalPicker, CONST.SENTRY_LABEL.TIME_MODAL_PICKER.OPEN], + ['Value', ValuePicker, CONST.SENTRY_LABEL.VALUE_PICKER.OPEN], ] as const; describe('Composable form picker rows', () => { @@ -44,6 +46,55 @@ describe('Composable form picker rows', () => { await waitForBatchedUpdates(); }); + it('keeps details out of the field label and announces validation without losing the selected value', () => { + // Given a selected value with explanatory details and an announced validation error. + render( + + + , + ); + + // When the composed field is read by its accessible name. + const row = screen.getByRole('button', {name: /^Field, One/}); + + // Then the details remain visible without replacing the value or error in the row name. + expect(row).toBeOnTheScreen(); + expect(row.props.accessibilityLabel).toContain('Required field'); + expect(row.props.accessibilityLabel).toContain('common.yourReviewIsRequired'); + expect(row.props.accessibilityLabel).not.toContain('More information'); + expect(screen.getByText('More information')).toBeOnTheScreen(); + }); + + it('does not let supporting details turn an empty disabled value into a populated field', () => { + // Given an empty disabled selector with supporting details. + const onOpen = jest.fn(); + render( + , + ); + + // When the disabled row is pressed. + fireEvent.press(screen.getByRole('button', {name: 'Field'}), {nativeEvent: {}}); + + // Then it remains a placeholder and does not open its modal. + expect(screen.UNSAFE_getByType(MenuItem.FieldNamePlaceholder)).toBeDefined(); + expect(screen.UNSAFE_queryByType(MenuItem.FieldValue)).toBeNull(); + expect(onOpen).not.toHaveBeenCalled(); + }); + it.each(cases)('%s keeps its form ref on the focusable root and its existing Sentry label', (_name, Component, sentryLabel) => { // Given a form field ref that error handling needs to focus. const ref = createRef>(); diff --git a/tests/ui/MoneyRequestViewReceiptTest.tsx b/tests/ui/MoneyRequestViewReceiptTest.tsx index 6f27576349b9..993578a708e6 100644 --- a/tests/ui/MoneyRequestViewReceiptTest.tsx +++ b/tests/ui/MoneyRequestViewReceiptTest.tsx @@ -246,7 +246,7 @@ describe('MoneyRequestView receipt visibility with a wide RHP open', () => { await waitFor(() => { // Anchor on an always-rendered field so the absence below reflects the hidden receipt, not an unrendered view. - expect(screen.getByTestId('menu-item-common.merchant')).toBeOnTheScreen(); + expect(screen.getByRole('button', {name: 'common.merchant, Coffee Shop'})).toBeOnTheScreen(); expect(screen.queryByTestId('money-request-receipt-view')).not.toBeOnTheScreen(); }); }); diff --git a/tests/ui/MoneyRequestViewTest.tsx b/tests/ui/MoneyRequestViewTest.tsx index dbaa36b24250..8aa5a9940304 100644 --- a/tests/ui/MoneyRequestViewTest.tsx +++ b/tests/ui/MoneyRequestViewTest.tsx @@ -264,7 +264,7 @@ describe('MoneyRequestView edit fields', () => { // Then the detail view shows the MCC without dropping the existing expense editor. expect(screen.getByLabelText('common.mcc, 0012')).toBeOnTheScreen(); - expect(screen.getByTestId('menu-item-common.merchant')).toHaveTextContent('editable'); + expect(screen.getByRole('button', {name: fieldLabel('common.merchant')})).toBeOnTheScreen(); }); it('shows additional fields in the saved column order and updates them when the preference changes', async () => { @@ -286,7 +286,7 @@ describe('MoneyRequestView edit fields', () => { expect(additionalFields).toHaveLength(2); expect(additionalFields.at(0)).toBe(screen.getByLabelText('common.exchangeRate, 1.2345 EUR/USD')); expect(additionalFields.at(1)).toBe(screen.getByLabelText('common.mcc, 0012')); - expect(screen.getByTestId('menu-item-common.merchant')).toHaveTextContent('editable'); + expect(screen.getByRole('button', {name: fieldLabel('common.merchant')})).toBeOnTheScreen(); expect(screen.getByTestId(/^menu-item-iou\.amount/)).toHaveTextContent('editable'); // When the user turns off Exchange rate in the report's column settings. @@ -357,8 +357,7 @@ describe('MoneyRequestView edit fields', () => { }); await waitFor(() => { - expect(screen.getByTestId('menu-item-common.merchant')).toBeOnTheScreen(); - expect(screen.getByTestId('menu-item-common.merchant')).toHaveTextContent('editable'); + expect(screen.getByRole('button', {name: fieldLabel('common.merchant')})).toBeOnTheScreen(); }); }); @@ -416,7 +415,6 @@ describe('MoneyRequestView edit fields', () => { renderedRows.find(({description}) => description === longTagName), renderedRows.find(({description}) => description?.startsWith('iou.amount')), renderedRows.find(({description}) => description === 'common.description'), - renderedRows.find(({description}) => description === 'common.merchant'), renderedRows.find(({description}) => description === 'common.report'), ]; @@ -474,7 +472,7 @@ describe('MoneyRequestView edit fields', () => { await waitForBatchedUpdatesWithAct(); await waitFor(() => { - expect(screen.getByTestId('menu-item-common.merchant')).toBeOnTheScreen(); + expect(screen.getByLabelText(fieldLabel('common.merchant'))).toBeOnTheScreen(); }); expect(screen.queryByLabelText(fieldLabel('common.category'))).not.toBeOnTheScreen(); expect(screen.queryByTestId('menu-item-Location')).not.toBeOnTheScreen(); @@ -660,8 +658,8 @@ describe('MoneyRequestView edit fields', () => { }); await waitFor(() => { - expect(screen.getByTestId('menu-item-common.merchant')).toBeOnTheScreen(); - expect(screen.getByTestId('menu-item-common.merchant')).toHaveTextContent('readonly'); + expect(screen.getByLabelText(fieldLabel('common.merchant'))).toBeOnTheScreen(); + expect(screen.queryByRole('button', {name: fieldLabel('common.merchant')})).toBeNull(); }); }); @@ -699,7 +697,7 @@ describe('MoneyRequestView edit fields', () => { await waitFor(() => { expect(screen.getByTestId(/^menu-item-iou\.amount/)).toHaveTextContent('editable'); - expect(screen.getByTestId('menu-item-common.merchant')).toHaveTextContent('editable'); + expect(screen.getByRole('button', {name: fieldLabel('common.merchant')})).toBeOnTheScreen(); expect(screen.getByRole('button', {name: fieldLabel('common.date')})).toBeOnTheScreen(); }); }); @@ -740,7 +738,8 @@ describe('MoneyRequestView edit fields', () => { await waitFor(() => { expect(screen.getByTestId(/^menu-item-iou\.amount/)).toHaveTextContent('readonly'); - expect(screen.getByTestId('menu-item-common.merchant')).toHaveTextContent('readonly'); + expect(screen.getByLabelText(fieldLabel('common.merchant'))).toBeOnTheScreen(); + expect(screen.queryByRole('button', {name: fieldLabel('common.merchant')})).toBeNull(); expect(screen.getByLabelText(fieldLabel('common.date'))).toBeOnTheScreen(); expect(screen.queryByRole('button', {name: fieldLabel('common.date')})).not.toBeOnTheScreen(); }); diff --git a/tests/ui/ProfilePageTest.tsx b/tests/ui/ProfilePageTest.tsx index 24afb174ca38..b880e996fc7f 100644 --- a/tests/ui/ProfilePageTest.tsx +++ b/tests/ui/ProfilePageTest.tsx @@ -38,6 +38,9 @@ import {isObject} from '../utils/typeGuards'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct'; +// Web intentionally allows repeated navigation; exercise the native guard that these rows must preserve. +jest.mock('@hooks/useSingleExecution', () => jest.requireActual('@hooks/useSingleExecution/index.native')); + jest.mock('@libs/Navigation/Navigation', () => ({ navigate: jest.fn(), revealRouteBeforeDismissingModal: jest.fn(), @@ -79,35 +82,13 @@ jest.mock('@react-navigation/native', () => { }; }); -// The public options rows use the composable MenuItem API, where the indicator is a child leaf rather than -// a prop, so expose its status as text the same way the MenuItemWithTopDescription double below does +// Expose the indicator status so tests can distinguish phone errors from address reminders. jest.mock('@components/MenuItem/leaves/trailing/icons/MenuItemBrickRoadIndicator', () => { const ReactMock = jest.requireActual('react'); const {Text} = jest.requireActual<{Text: typeof ReactNativeText}>('react-native'); return ({status}: {status: ValueOf}) => ReactMock.createElement(Text, null, `${status}-brickRoadIndicator`); }); -// Replace MenuItemWithTopDescription with a simple test double that exposes props in the tree -jest.mock('@components/MenuItemWithTopDescription', () => { - const ReactMock = jest.requireActual('react'); - const {Text} = jest.requireActual<{Text: typeof ReactNativeText}>('react-native'); - return ({ - pressableTestID, - brickRoadIndicator, - furtherDetails, - }: { - pressableTestID: string; - brickRoadIndicator?: ValueOf; - furtherDetails?: string; - }) => - ReactMock.createElement( - ReactMock.Fragment, - null, - ReactMock.createElement(Text, {testID: pressableTestID}, `${brickRoadIndicator ?? 'none'}-brickRoadIndicator`), - furtherDetails ? ReactMock.createElement(Text, {testID: `${pressableTestID}-further-details`}, furtherDetails) : null, - ); -}); - describe('ProfilePage contact method indicator', () => { beforeAll(() => { Onyx.init({ @@ -291,6 +272,21 @@ describe('ProfilePage - agent account', () => { expect(screen.getByText('Private')).toBeDefined(); }); + it('opens private details only once while navigation is pending', async () => { + // Given a signed-in user whose private rows can be edited. + await setupUser('user@expensify.com'); + renderPageWithNavigation(SCREENS.SETTINGS.PROFILE.ROOT); + await waitForBatchedUpdatesWithAct(); + jest.mocked(Navigation.navigate).mockClear(); + + // When two private rows are pressed before the first navigation finishes. + fireEvent.press(screen.getByTestId('legal-name-menu-item'), {nativeEvent: {}}); + fireEvent.press(screen.getByTestId('address-menu-item'), {nativeEvent: {}}); + + // Then a second private-details screen is not pushed on top of the first. + expect(Navigation.navigate).toHaveBeenCalledTimes(1); + }); + it('names the workspace that calculates commuter exclusions from the home address', async () => { await setupUser('user@expensify.com'); await act(async () => { @@ -305,8 +301,8 @@ describe('ProfilePage - agent account', () => { renderPageWithNavigation(SCREENS.SETTINGS.PROFILE.ROOT); await waitForBatchedUpdatesWithAct(); - expect(screen.getByTestId('address-menu-item')).toHaveTextContent('info-brickRoadIndicator'); - expect(screen.getByTestId('address-menu-item-further-details')).toHaveTextContent('Boulder Development uses this address for commuter exclusions.'); + expect(screen.getByTestId('address-menu-item')).toHaveTextContent(/info-brickRoadIndicator/); + expect(screen.getByTestId('address-menu-item')).toHaveTextContent(/Boulder Development uses this address for commuter exclusions\./); }); it('does not mention commuter exclusions when no workspace calculates them from the home address', async () => { @@ -323,7 +319,7 @@ describe('ProfilePage - agent account', () => { await waitForBatchedUpdatesWithAct(); expect(screen.getByTestId('address-menu-item')).toBeDefined(); - expect(screen.queryByTestId('address-menu-item-further-details')).toBeNull(); + expect(screen.queryByText('Boulder Development uses this address for commuter exclusions.')).toBeNull(); }); it('shows the commuter exclusion indicator when distance rates are disabled but the setting remains active', async () => { @@ -340,8 +336,8 @@ describe('ProfilePage - agent account', () => { renderPageWithNavigation(SCREENS.SETTINGS.PROFILE.ROOT); await waitForBatchedUpdatesWithAct(); - expect(screen.getByTestId('address-menu-item')).toHaveTextContent('info-brickRoadIndicator'); - expect(screen.getByTestId('address-menu-item-further-details')).toHaveTextContent('Boulder Development uses this address for commuter exclusions.'); + expect(screen.getByTestId('address-menu-item')).toHaveTextContent(/info-brickRoadIndicator/); + expect(screen.getByTestId('address-menu-item')).toHaveTextContent(/Boulder Development uses this address for commuter exclusions\./); }); it('shows contact methods, pronouns, timezone and private section for non-agent account', async () => { From 81bb3e1e3f2039a0c3ac5a7513ae61c09d8923e5 Mon Sep 17 00:00:00 2001 From: "Pujan Shah (via MelvinBot)" Date: Thu, 19 Nov 2026 12:17:53 +0000 Subject: [PATCH 2/5] Type the native navigation guard test module Co-authored-by: Pujan Shah --- tests/ui/ProfilePageTest.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ui/ProfilePageTest.tsx b/tests/ui/ProfilePageTest.tsx index b880e996fc7f..5defac13925b 100644 --- a/tests/ui/ProfilePageTest.tsx +++ b/tests/ui/ProfilePageTest.tsx @@ -7,6 +7,7 @@ import {LocaleContextProvider} from '@components/LocaleContextProvider'; import OnyxListItemProvider from '@components/OnyxListItemProvider'; import {CurrentReportIDContextProvider} from '@hooks/useCurrentReportID'; +import type * as SingleExecution from '@hooks/useSingleExecution'; import * as AgentActions from '@libs/actions/Agent'; import Navigation, {navigationRef} from '@libs/Navigation/Navigation'; @@ -39,7 +40,7 @@ import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct'; // Web intentionally allows repeated navigation; exercise the native guard that these rows must preserve. -jest.mock('@hooks/useSingleExecution', () => jest.requireActual('@hooks/useSingleExecution/index.native')); +jest.mock('@hooks/useSingleExecution', () => jest.requireActual('@hooks/useSingleExecution/index.native')); jest.mock('@libs/Navigation/Navigation', () => ({ navigate: jest.fn(), From 5ac4e3ef1b117a48bc1712474bfcfa5900ecb642 Mon Sep 17 00:00:00 2001 From: "Pujan Shah (via MelvinBot)" Date: Thu, 19 Nov 2026 12:58:57 +0000 Subject: [PATCH 3/5] Preserve Profile compiler caching for private row actions Co-authored-by: Pujan Shah --- src/pages/settings/Profile/ProfilePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Profile/ProfilePage.tsx b/src/pages/settings/Profile/ProfilePage.tsx index 3a28d7881350..cf951e602af0 100755 --- a/src/pages/settings/Profile/ProfilePage.tsx +++ b/src/pages/settings/Profile/ProfilePage.tsx @@ -392,7 +392,7 @@ function ProfilePage() { {privateOptions.map((detail) => ( callIfAuthenticated(detail.action, session)()} testID={detail.testID} sentryLabel={detail.sentryLabel} > From 25147c38fe7d54972a3277bd3d8d081c848712cc Mon Sep 17 00:00:00 2001 From: "Pujan Shah (via MelvinBot)" Date: Thu, 19 Nov 2026 13:48:41 +0000 Subject: [PATCH 4/5] Use left padding for flag severity detail text Co-authored-by: Pujan Shah --- src/pages/DynamicFlagCommentPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/DynamicFlagCommentPage.tsx b/src/pages/DynamicFlagCommentPage.tsx index ec939bbb06d4..c78eb714b9e5 100644 --- a/src/pages/DynamicFlagCommentPage.tsx +++ b/src/pages/DynamicFlagCommentPage.tsx @@ -162,7 +162,7 @@ function DynamicFlagCommentPage({parentReportAction, report, parentReport, repor size={CONST.ICON_SIZE.MEDIUM} /> {item.furtherDetails} From c80f949a8215c6a9477ebf847007bb3040d667d2 Mon Sep 17 00:00:00 2001 From: "Pujan Shah (via MelvinBot)" Date: Thu, 19 Nov 2026 14:15:33 +0000 Subject: [PATCH 5/5] Remove unused TextPicker furtherDetails prop Co-authored-by: Pujan Shah --- src/components/TextPicker/index.tsx | 2 -- src/components/TextPicker/types.ts | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/components/TextPicker/index.tsx b/src/components/TextPicker/index.tsx index 683050f18025..05927cce594f 100644 --- a/src/components/TextPicker/index.tsx +++ b/src/components/TextPicker/index.tsx @@ -19,7 +19,6 @@ function TextPicker({ errorText = '', onInputChange, onValueCommitted, - furtherDetails, rightLabel, disabled = false, interactive = true, @@ -67,7 +66,6 @@ function TextPicker({ title={value ?? placeholder ?? ''} description={description} onPress={showPickerModal} - furtherDetails={furtherDetails} rightLabel={rightLabel} brickRoadIndicator={errorText ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined} errorText={errorText} diff --git a/src/components/TextPicker/types.ts b/src/components/TextPicker/types.ts index 258da1e58a7a..740021821f68 100644 --- a/src/components/TextPicker/types.ts +++ b/src/components/TextPicker/types.ts @@ -56,9 +56,6 @@ type TextPickerProps = { */ onValueCommitted?: (value: string) => void; - /** Text to display under the main menu item */ - furtherDetails?: string; - shouldShowTooltips?: boolean; /** The ID used to uniquely identify the input in a Form */