Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
1034373
migrate options list utils to use temporary getForReportAction
kubabutkiewicz Nov 19, 2025
6bd0010
remove log
kubabutkiewicz Nov 19, 2025
1a8c72d
remove unnecessary changes
kubabutkiewicz Nov 19, 2025
ea6d985
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Nov 19, 2025
1665f04
lint
kubabutkiewicz Nov 19, 2025
edfdd04
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 1, 2025
5cc821c
fix lint
kubabutkiewicz Dec 1, 2025
0de37fd
fix tests
kubabutkiewicz Dec 1, 2025
1683eb0
lint
kubabutkiewicz Dec 1, 2025
00e4c7a
.
kubabutkiewicz Dec 1, 2025
6c2e424
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 1, 2025
9a5f150
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 1, 2025
e7be081
lint
kubabutkiewicz Dec 1, 2025
2a73cb7
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 4, 2025
2156807
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 8, 2025
2d8dbac
lint fixes
kubabutkiewicz Dec 8, 2025
4c5baa1
fix lint
kubabutkiewicz Dec 8, 2025
fb834d6
.
kubabutkiewicz Dec 9, 2025
5d0ca35
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 9, 2025
86445a8
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 15, 2025
0adeef9
resolve comments
kubabutkiewicz Dec 15, 2025
4cd3033
fixes
kubabutkiewicz Dec 17, 2025
13ba05b
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 18, 2025
bc3803e
resolve conflicts
kubabutkiewicz Dec 18, 2025
e8b16de
fix typecheck
kubabutkiewicz Dec 19, 2025
b6f988c
Merge branches 'part-3-onyx-connect-deprecate-for-modified-expense-me…
kubabutkiewicz Dec 22, 2025
e1a9f97
fix tests
kubabutkiewicz Dec 22, 2025
cd706bc
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Dec 29, 2025
a7ed0f6
fix lint
kubabutkiewicz Dec 29, 2025
3a16af9
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 7, 2026
f444620
fix lint
kubabutkiewicz Jan 7, 2026
11c0558
fix lint
kubabutkiewicz Jan 7, 2026
7d96a37
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 8, 2026
bda5b04
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 14, 2026
a11872a
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 15, 2026
8b13d20
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 15, 2026
ba16aad
fix ts
kubabutkiewicz Jan 15, 2026
611271b
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 19, 2026
5e9a695
fix reassure tests
kubabutkiewicz Jan 19, 2026
0f70126
fix reassure test
kubabutkiewicz Jan 19, 2026
bfc882c
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 21, 2026
9ceca26
format
kubabutkiewicz Jan 21, 2026
263717c
fix lint
kubabutkiewicz Jan 21, 2026
92e2e22
format
kubabutkiewicz Jan 21, 2026
c8b4902
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 22, 2026
e9ed988
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 26, 2026
58e869c
fix lint
kubabutkiewicz Jan 26, 2026
16ada43
prettier
kubabutkiewicz Jan 26, 2026
6cc8777
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 27, 2026
6eefe52
lint prettier
kubabutkiewicz Jan 27, 2026
fce64d2
prettier
kubabutkiewicz Jan 27, 2026
189c159
remove translate changes
kubabutkiewicz Jan 28, 2026
96769b0
lint issues and prettier
kubabutkiewicz Jan 28, 2026
c34821a
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 28, 2026
4efb228
fix
kubabutkiewicz Jan 29, 2026
6fbe0b8
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Jan 29, 2026
bd87dbc
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Feb 2, 2026
1b1c87d
disable lint issue as there are already too many changes
kubabutkiewicz Feb 2, 2026
9c1a6c6
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Feb 3, 2026
94a9129
typecheck and spellcheck
kubabutkiewicz Feb 3, 2026
54b480d
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Feb 4, 2026
75ddbd6
resolve comments
kubabutkiewicz Feb 4, 2026
b9daacf
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Feb 5, 2026
aadb30c
typecheck
kubabutkiewicz Feb 5, 2026
8bb74e6
lint errors
kubabutkiewicz Feb 5, 2026
d1fafae
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Feb 6, 2026
ebe3e12
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Feb 9, 2026
1d9d64f
typecheck fix
kubabutkiewicz Feb 9, 2026
3523b76
Merge branch 'main' of github.com:callstack-internal/Expensify-App in…
kubabutkiewicz Feb 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/components/LHNOptionsList/LHNOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type {OnyxEntry} from 'react-native-onyx';
import type {BlockingViewProps} from '@components/BlockingViews/BlockingView';
import BlockingView from '@components/BlockingViews/BlockingView';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import {ScrollOffsetContext} from '@components/ScrollOffsetContextProvider';
import TextBlock from '@components/TextBlock';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
Expand Down Expand Up @@ -57,7 +56,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
const flashListRef = useRef<FlashListRef<Report>>(null);
const route = useRoute();
const isScreenFocused = useIsFocused();
const expensifyIcons = useMemoizedLazyExpensifyIcons(['MagnifyingGlass']);
const expensifyIcons = useMemoizedLazyExpensifyIcons(['MagnifyingGlass', 'Plus']);

const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT, {canBeMissing: false});
const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: reportsSelector, canBeMissing: true});
Expand All @@ -73,6 +72,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {canBeMissing: true});
const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {canBeMissing: true});
const [isFullscreenVisible] = useOnyx(ONYXKEYS.FULLSCREEN_VISIBILITY, {canBeMissing: true});
const [policyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {canBeMissing: false});
const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const {policyForMovingExpensesID} = usePolicyForMovingExpenses();

Expand Down Expand Up @@ -140,7 +140,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
text={translate('common.emptyLHN.subtitleText2')}
/>
<Icon
src={Expensicons.Plus}
src={expensifyIcons.Plus}
width={variables.emptyLHNIconWidth}
height={variables.emptyLHNIconHeight}
fill={theme.icon}
Expand All @@ -160,12 +160,13 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
styles.justifyContentCenter,
styles.flexWrap,
styles.textAlignCenter,
styles.textNormal,
styles.mh1,
theme.icon,
theme.textSupporting,
styles.textNormal,
theme.icon,
translate,
expensifyIcons.MagnifyingGlass,
expensifyIcons.Plus,
],
);

Expand All @@ -183,6 +184,8 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
const itemParentReportActions = reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${item?.parentReportID}`];
const itemParentReportAction = item?.parentReportActionID ? itemParentReportActions?.[item?.parentReportActionID] : undefined;
const itemReportAttributes = reportAttributes?.[reportID];
const itemPolicyID = item?.policyID === CONST.POLICY.OWNER_EMAIL_FAKE && policyForMovingExpensesID ? policyForMovingExpensesID : item?.policyID;
const itemPolicyTags = policyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${itemPolicyID}`];

let invoiceReceiverPolicyID = '-1';
if (item?.invoiceReceiver && 'policyID' in item.invoiceReceiver) {
Expand Down Expand Up @@ -238,11 +241,10 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
movedToReport,
policy: itemPolicy,
isReportArchived: !!itemReportNameValuePairs?.private_isArchived,
policyForMovingExpensesID,
reportMetadata: itemReportMetadata,
policyTags: itemPolicyTags,
reportAttributesDerived: reportAttributes,
});

const shouldShowRBRorGBRTooltip = firstReportIDWithGBRorRBR === reportID;

let lastAction: ReportAction | undefined;
Expand Down Expand Up @@ -312,11 +314,12 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
reportMetadataCollection,
isOffline,
reportAttributes,
policyForMovingExpensesID,
policyTags,
policy,
transactions,
draftComments,
personalDetails,
policyForMovingExpensesID,
firstReportIDWithGBRorRBR,
optionMode,
shouldDisableFocusOptions,
Expand Down
4 changes: 4 additions & 0 deletions src/components/LHNOptionsList/OptionRowLHNData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ function OptionRowLHNData({

const [movedFromReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.FROM)}`, {canBeMissing: true});
const [movedToReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.TO)}`, {canBeMissing: true});

const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${fullReport?.policyID}`, {canBeMissing: true});
// Check the report errors equality to avoid re-rendering when there are no changes
const prevReportErrors = usePrevious(reportAttributes?.reportErrors);
const areReportErrorsEqual = useMemo(() => deepEqual(prevReportErrors, reportAttributes?.reportErrors), [prevReportErrors, reportAttributes?.reportErrors]);
Expand All @@ -78,6 +80,7 @@ function OptionRowLHNData({
lastActionReport,
movedFromReport,
movedToReport,
policyTags,
currentUserAccountID,
reportAttributesDerived,
});
Expand Down Expand Up @@ -115,6 +118,7 @@ function OptionRowLHNData({
isReportArchived,
movedFromReport,
movedToReport,
policyTags,
currentUserAccountID,
reportAttributesDerived,
]);
Expand Down
25 changes: 17 additions & 8 deletions src/components/OptionListContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import usePrivateIsArchivedMap from '@hooks/usePrivateIsArchivedMap';
import {createOptionFromReport, createOptionList, processReport, shallowOptionsListCompare} from '@libs/OptionsListUtils';
import type {OptionList, SearchOption} from '@libs/OptionsListUtils';
import {isSelfDM} from '@libs/ReportUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PersonalDetails, Report} from '@src/types/onyx';
import {usePersonalDetails} from './OnyxListItemProvider';
Expand Down Expand Up @@ -59,15 +60,16 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const currentUserAccountID = currentUserPersonalDetails.accountID;
const hasInitialData = useMemo(() => Object.keys(personalDetails ?? {}).length > 0, [personalDetails]);
const [policyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {canBeMissing: false});
const privateIsArchivedMap = usePrivateIsArchivedMap();

const loadOptions = useCallback(() => {
const optionLists = createOptionList(personalDetails, currentUserAccountID, privateIsArchivedMap, reports, reportAttributes?.reports);
const optionLists = createOptionList(personalDetails, policyTags, currentUserAccountID, privateIsArchivedMap, reports, reportAttributes?.reports);
setOptions({
reports: optionLists.reports,
personalDetails: optionLists.personalDetails,
});
}, [personalDetails, currentUserAccountID, privateIsArchivedMap, reports, reportAttributes?.reports]);
}, [personalDetails, currentUserAccountID, privateIsArchivedMap, reports, reportAttributes?.reports, policyTags]);

/**
* This effect is responsible for generating the options list when their data is not yet initialized
Expand Down Expand Up @@ -123,7 +125,8 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
for (const reportKey of changedReportKeys) {
const report = changedReportsEntries[reportKey];
const reportID = reportKey.replace(ONYXKEYS.COLLECTION.REPORT, '');
const {reportOption} = processReport(report, personalDetails, currentUserAccountID, reportAttributes?.reports);
const reportPolicyTags = report?.policyID ? policyTags?.[report?.policyID] : CONST.POLICY.DEFAULT_TAG_LIST;
const {reportOption} = processReport(report, personalDetails, reportPolicyTags, currentUserAccountID, reportAttributes?.reports);

if (reportOption) {
updatedReportsMap.set(reportID, reportOption);
Expand All @@ -137,7 +140,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
reports: Array.from(updatedReportsMap.values()),
};
});
}, [changedReportsEntries, personalDetails, currentUserAccountID, reportAttributes?.reports]);
}, [changedReportsEntries, personalDetails, currentUserAccountID, reportAttributes?.reports, policyTags]);

useEffect(() => {
if (!changedReportActions || !areOptionsInitialized.current) {
Expand All @@ -157,7 +160,9 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
}

const reportID = key.replace(ONYXKEYS.COLLECTION.REPORT_ACTIONS, '');
const {reportOption} = processReport(updatedReportsMap.get(reportID)?.item, personalDetails, currentUserAccountID, reportAttributes?.reports);
const report = updatedReportsMap.get(reportID)?.item;
const reportPolicyTags = report?.policyID ? policyTags?.[report?.policyID] : CONST.POLICY.DEFAULT_TAG_LIST;
const {reportOption} = processReport(updatedReportsMap.get(reportID)?.item, personalDetails, reportPolicyTags, currentUserAccountID, reportAttributes?.reports);

if (reportOption) {
updatedReportsMap.set(reportID, reportOption);
Expand All @@ -169,7 +174,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
reports: Array.from(updatedReportsMap.values()),
};
});
}, [changedReportActions, personalDetails, currentUserAccountID, reportAttributes?.reports]);
}, [changedReportActions, personalDetails, currentUserAccountID, reportAttributes?.reports, policyTags]);

/**
* This effect is used to update the options list when personal details change.
Expand All @@ -189,6 +194,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
if (!prevPersonalDetails) {
const {personalDetails: newPersonalDetailsOptions, reports: newReports} = createOptionList(
personalDetails,
policyTags,
currentUserAccountID,
privateIsArchivedMap,
reports,
Expand Down Expand Up @@ -226,7 +232,10 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
continue;
}

const newReportOption = createOptionFromReport(report, personalDetails, currentUserAccountID, reportAttributes?.reports, {showPersonalDetails: true});
const reportPolicyTags = report.policyID ? policyTags?.[report.policyID] : CONST.POLICY.DEFAULT_TAG_LIST;
const newReportOption = createOptionFromReport(report, personalDetails, reportPolicyTags, currentUserAccountID, reportAttributes?.reports, {
showPersonalDetails: true,
});
const replaceIndex = options.reports.findIndex((option) => option.reportID === report.reportID);
newReportOptions.push({
newReportOption,
Expand All @@ -236,7 +245,7 @@ function OptionsListContextProvider({children}: OptionsListProviderProps) {
}

// since personal details are not a collection, we need to recreate the whole list from scratch
const newPersonalDetailsOptions = createOptionList(personalDetails, currentUserAccountID, privateIsArchivedMap, reports, reportAttributes?.reports).personalDetails;
const newPersonalDetailsOptions = createOptionList(personalDetails, policyTags, currentUserAccountID, privateIsArchivedMap, reports, reportAttributes?.reports).personalDetails;

setOptions((prevOptions) => {
const newOptions = {...prevOptions};
Expand Down
16 changes: 15 additions & 1 deletion src/components/Search/FilterDropdowns/UserSelectPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function UserSelectPopup({value, closeOverlay, onChange, isSearchable}: UserSele
const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false, canBeMissing: true});
const [draftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
const [nvpDismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {canBeMissing: true});
const [policyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {canBeMissing: true});
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: true});
const initialSelectedOptions = useMemo(() => {
return value.reduce<OptionData[]>((acc, id) => {
Expand Down Expand Up @@ -106,6 +107,7 @@ function UserSelectPopup({value, closeOverlay, onChange, isSearchable}: UserSele
allPolicies,
draftComments,
nvpDismissedProductTraining,
policyTags,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rename this param to allPolicyTags everywhere it is the whole collection to keep these easy to perceive even if we they are type safe.

loginList,
currentUserAccountID,
currentUserEmail,
Expand All @@ -116,7 +118,19 @@ function UserSelectPopup({value, closeOverlay, onChange, isSearchable}: UserSele
},
countryCode,
);
}, [options.reports, options.personalDetails, allPolicies, draftComments, nvpDismissedProductTraining, loginList, countryCode, personalDetails, currentUserAccountID, currentUserEmail]);
}, [
options.reports,
options.personalDetails,
allPolicies,
draftComments,
nvpDismissedProductTraining,
policyTags,
loginList,
currentUserAccountID,
currentUserEmail,
personalDetails,
countryCode,
]);

const filteredOptions = useMemo(() => {
return filterAndOrderOptions(optionsList, cleanSearchTerm, countryCode, loginList, currentUserEmail, currentUserAccountID, personalDetails, {
Expand Down
8 changes: 7 additions & 1 deletion src/components/Search/SearchAutocompleteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function SearchAutocompleteList({
const [nvpDismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {canBeMissing: true});
const [recentSearches] = useOnyx(ONYXKEYS.RECENT_SEARCHES, {canBeMissing: true});
const [countryCode] = useOnyx(ONYXKEYS.COUNTRY_CODE, {canBeMissing: false});
const [policyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {canBeMissing: true});
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST, {canBeMissing: true});
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const currentUserEmail = currentUserPersonalDetails.email ?? '';
Expand All @@ -220,6 +221,7 @@ function SearchAutocompleteList({
includeCurrentUser: true,
countryCode,
shouldShowGBR: false,
policyTags,
shouldUnreadBeBold: true,
loginList,
currentUserAccountID,
Expand All @@ -237,6 +239,7 @@ function SearchAutocompleteList({
loginList,
currentUserAccountID,
currentUserEmail,
policyTags,
personalDetails,
]);

Expand Down Expand Up @@ -454,6 +457,7 @@ function SearchAutocompleteList({
countryCode,
loginList,
shouldShowGBR: true,
policyTags,
currentUserAccountID,
currentUserEmail,
personalDetails,
Expand Down Expand Up @@ -488,6 +492,7 @@ function SearchAutocompleteList({
countryCode,
loginList,
shouldShowGBR: true,
policyTags,
currentUserAccountID,
currentUserEmail,
personalDetails,
Expand Down Expand Up @@ -660,11 +665,13 @@ function SearchAutocompleteList({
currencyAutocompleteList,
recentCurrencyAutocompleteList,
taxAutocompleteList,
translate,
options,
draftComments,
nvpDismissedProductTraining,
betas,
countryCode,
policyTags,
loginList,
currentUserAccountID,
currentUserEmail,
Expand All @@ -673,7 +680,6 @@ function SearchAutocompleteList({
statusAutocompleteList,
feedAutoCompleteList,
cardAutocompleteList,
translate,
workspaceList,
hasAutocompleteList,
isAutocompleteList,
Expand Down
22 changes: 20 additions & 2 deletions src/components/Search/SearchFiltersChatsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,29 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
const [draftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
const archivedReportsIdSet = useArchivedReportsIdSet();
const [nvpDismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {canBeMissing: true});
const [policyTags] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS, {canBeMissing: false});

const selectedOptions: OptionData[] = selectedReportIDs.map((id) => {
const selectedReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${id}`];
const report = getSelectedOptionData(
createOptionFromReport({...reports?.[`${ONYXKEYS.COLLECTION.REPORT}${id}`], reportID: id}, personalDetails, currentUserAccountID, reportAttributesDerived),
createOptionFromReport(
{...reports?.[`${ONYXKEYS.COLLECTION.REPORT}${id}`], reportID: id},
personalDetails,
policyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${selectedReport?.policyID}`],
currentUserAccountID,
reportAttributesDerived,
),
);
const isReportArchived = archivedReportsIdSet.has(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`);
const alternateText = getAlternateText(report, {}, isReportArchived, currentUserAccountID, {}, reportAttributesDerived);
const alternateText = getAlternateText(
report,
{},
policyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${report.policyID}`],
isReportArchived,
currentUserAccountID,
{},
reportAttributesDerived,
);
return {...report, alternateText};
});

Expand All @@ -86,6 +102,7 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
loginList,
currentUserAccountID,
currentUserEmail,
policyTags,
personalDetails,
});

Expand All @@ -102,6 +119,7 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
selectedOptions,
chatOptions.recentReports,
chatOptions.personalDetails,
policyTags,
currentUserAccountID,
personalDetails,
false,
Expand Down
Loading