From b1ae310ba95dbc479d9f44b294425c971237f533 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Fri, 6 Mar 2026 11:22:18 +0100 Subject: [PATCH 1/5] Fix badge style regressions from #82210 - Add ListItemFocusContext so InviteMemberListItem can propagate isFocused to rightElement children. MemberRightIcon consumes this context to apply badgeDefaultActive when the row is focused, preventing the badge from blending into the activeComponentBG highlight. - Map DONE action to reportStatusBadge.closed in BadgeActionCell so the Done action badge matches the Done status badge color (pink). --- .../SelectionList/ListItem/InviteMemberListItem.tsx | 3 ++- .../SelectionList/ListItemFocusContext.tsx | 13 +++++++++++++ .../InviteMemberListItem.tsx | 3 ++- .../Search/ActionCell/BadgeActionCell.tsx | 11 ++++++++++- src/pages/workspace/MemberRightIcon.tsx | 6 +++++- 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 src/components/SelectionList/ListItemFocusContext.tsx diff --git a/src/components/SelectionList/ListItem/InviteMemberListItem.tsx b/src/components/SelectionList/ListItem/InviteMemberListItem.tsx index 6a8e730c1d1e3..25f6b6d81dd15 100644 --- a/src/components/SelectionList/ListItem/InviteMemberListItem.tsx +++ b/src/components/SelectionList/ListItem/InviteMemberListItem.tsx @@ -5,6 +5,7 @@ import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import {useProductTrainingContext} from '@components/ProductTrainingContext'; import ReportActionAvatars from '@components/ReportActionAvatars'; import SelectCircle from '@components/SelectCircle'; +import {ListItemFocusContext} from '@components/SelectionList/ListItemFocusContext'; import Text from '@components/Text'; import TextWithTooltip from '@components/TextWithTooltip'; import EducationalTooltip from '@components/Tooltip/EducationalTooltip'; @@ -153,7 +154,7 @@ function InviteMemberListItem({ /> )} - {!!item.rightElement && item.rightElement} + {!!item.rightElement && {item.rightElement}} {!!shouldShowCheckBox && ( ({isFocused: false}); + +function useListItemFocus() { + return useContext(ListItemFocusContext); +} + +export {ListItemFocusContext, useListItemFocus}; diff --git a/src/components/SelectionListWithSections/InviteMemberListItem.tsx b/src/components/SelectionListWithSections/InviteMemberListItem.tsx index dd7ef2d56a88b..326f31fc524a9 100644 --- a/src/components/SelectionListWithSections/InviteMemberListItem.tsx +++ b/src/components/SelectionListWithSections/InviteMemberListItem.tsx @@ -5,6 +5,7 @@ import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import {useProductTrainingContext} from '@components/ProductTrainingContext'; import ReportActionAvatars from '@components/ReportActionAvatars'; import SelectCircle from '@components/SelectCircle'; +import {ListItemFocusContext} from '@components/SelectionList/ListItemFocusContext'; import Text from '@components/Text'; import TextWithTooltip from '@components/TextWithTooltip'; import EducationalTooltip from '@components/Tooltip/EducationalTooltip'; @@ -150,7 +151,7 @@ function InviteMemberListItem({ /> )} - {!!item.rightElement && item.rightElement} + {!!item.rightElement && {item.rightElement}} {!!shouldShowCheckBox && ( { + if (action === CONST.SEARCH.ACTION_TYPES.PAID) { + return theme.reportStatusBadge.paid; + } + if (action === CONST.SEARCH.ACTION_TYPES.DONE) { + return theme.reportStatusBadge.closed; + } + return theme.reportStatusBadge.approved; + }; + const badgeTheme = getBadgeTheme(); return ( ); } From ba0aa89bc60af423eb544afa8fdc18804313bada Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Fri, 6 Mar 2026 11:44:38 +0100 Subject: [PATCH 2/5] Add missing sentryLabel to PressableWithFeedback in InviteMemberListItem --- .../SelectionListWithSections/InviteMemberListItem.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/SelectionListWithSections/InviteMemberListItem.tsx b/src/components/SelectionListWithSections/InviteMemberListItem.tsx index 326f31fc524a9..40f9aed7d0ac5 100644 --- a/src/components/SelectionListWithSections/InviteMemberListItem.tsx +++ b/src/components/SelectionListWithSections/InviteMemberListItem.tsx @@ -159,6 +159,7 @@ function InviteMemberListItem({ role={CONST.ROLE.BUTTON} accessibilityLabel={item.text ?? ''} style={[styles.ml2, styles.optionSelectCircle]} + sentryLabel={CONST.SENTRY_LABEL.LIST_ITEM.INVITE_MEMBER_CHECKBOX} > Date: Fri, 6 Mar 2026 11:50:33 +0100 Subject: [PATCH 3/5] Simplify BadgeActionCell theme to ternary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only PAID and DONE reach this component, so replace the three-way branch with a simple ternary: PAID → paid, else → closed. --- .../Search/ActionCell/BadgeActionCell.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/components/SelectionListWithSections/Search/ActionCell/BadgeActionCell.tsx b/src/components/SelectionListWithSections/Search/ActionCell/BadgeActionCell.tsx index 41460d6d3f5c1..66b3acb0f07f3 100644 --- a/src/components/SelectionListWithSections/Search/ActionCell/BadgeActionCell.tsx +++ b/src/components/SelectionListWithSections/Search/ActionCell/BadgeActionCell.tsx @@ -23,16 +23,7 @@ function BadgeActionCell({action, isLargeScreenWidth, shouldDisablePointerEvents const StyleUtils = useStyleUtils(); const text = translate(actionTranslationsMap[action]); - const getBadgeTheme = () => { - if (action === CONST.SEARCH.ACTION_TYPES.PAID) { - return theme.reportStatusBadge.paid; - } - if (action === CONST.SEARCH.ACTION_TYPES.DONE) { - return theme.reportStatusBadge.closed; - } - return theme.reportStatusBadge.approved; - }; - const badgeTheme = getBadgeTheme(); + const badgeTheme = action === CONST.SEARCH.ACTION_TYPES.PAID ? theme.reportStatusBadge.paid : theme.reportStatusBadge.closed; return ( Date: Fri, 6 Mar 2026 12:15:57 +0100 Subject: [PATCH 4/5] Add ListItemFocusContext to UserListItem for badge visibility fix UserListItem also applies activeComponentBG on focused rows via BaseListItem, causing the same badge color collision. Wrap rightElement with ListItemFocusContext.Provider so MemberRightIcon picks up isFocused and switches to badgeDefaultActive automatically. --- src/components/SelectionList/ListItem/UserListItem.tsx | 3 ++- src/components/SelectionListWithSections/UserListItem.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/SelectionList/ListItem/UserListItem.tsx b/src/components/SelectionList/ListItem/UserListItem.tsx index c83b28706baa4..9859accdeef8b 100644 --- a/src/components/SelectionList/ListItem/UserListItem.tsx +++ b/src/components/SelectionList/ListItem/UserListItem.tsx @@ -5,6 +5,7 @@ import type {OnyxEntry} from 'react-native-onyx'; import Icon from '@components/Icon'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import ReportActionAvatars from '@components/ReportActionAvatars'; +import {ListItemFocusContext} from '@components/SelectionList/ListItemFocusContext'; import Text from '@components/Text'; import TextWithTooltip from '@components/TextWithTooltip'; import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; @@ -162,7 +163,7 @@ function UserListItem({ /> )} - {!!item.rightElement && item.rightElement} + {!!item.rightElement && {item.rightElement}} {!!item.shouldShowRightCaret && ( ({ /> )} - {!!item.rightElement && item.rightElement} + {!!item.rightElement && {item.rightElement}} {!!item.shouldShowRightIcon && ( Date: Fri, 6 Mar 2026 15:48:51 +0100 Subject: [PATCH 5/5] Address review: make isFocused optional and use shorthand - Make isFocused optional in ListItemFocusContextValue type - Use shorthand {isFocused} instead of {isFocused: !!isFocused} in all four ListItemFocusContext providers --- src/components/SelectionList/ListItem/InviteMemberListItem.tsx | 2 +- src/components/SelectionList/ListItem/UserListItem.tsx | 2 +- src/components/SelectionList/ListItemFocusContext.tsx | 2 +- .../SelectionListWithSections/InviteMemberListItem.tsx | 2 +- src/components/SelectionListWithSections/UserListItem.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/SelectionList/ListItem/InviteMemberListItem.tsx b/src/components/SelectionList/ListItem/InviteMemberListItem.tsx index 25f6b6d81dd15..8c3c111b6ffa5 100644 --- a/src/components/SelectionList/ListItem/InviteMemberListItem.tsx +++ b/src/components/SelectionList/ListItem/InviteMemberListItem.tsx @@ -154,7 +154,7 @@ function InviteMemberListItem({ /> )} - {!!item.rightElement && {item.rightElement}} + {!!item.rightElement && {item.rightElement}} {!!shouldShowCheckBox && ( ({ /> )} - {!!item.rightElement && {item.rightElement}} + {!!item.rightElement && {item.rightElement}} {!!item.shouldShowRightCaret && ( ({isFocused: false}); diff --git a/src/components/SelectionListWithSections/InviteMemberListItem.tsx b/src/components/SelectionListWithSections/InviteMemberListItem.tsx index 40f9aed7d0ac5..7a561997f5754 100644 --- a/src/components/SelectionListWithSections/InviteMemberListItem.tsx +++ b/src/components/SelectionListWithSections/InviteMemberListItem.tsx @@ -151,7 +151,7 @@ function InviteMemberListItem({ /> )} - {!!item.rightElement && {item.rightElement}} + {!!item.rightElement && {item.rightElement}} {!!shouldShowCheckBox && ( ({ /> )} - {!!item.rightElement && {item.rightElement}} + {!!item.rightElement && {item.rightElement}} {!!item.shouldShowRightIcon && (