Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
513f681
Remove call to getReportNameValuePairs() in method getIcons from Repo…
Krishna2323 Jul 25, 2025
13ad592
add test for archieved workspace report icon.
Krishna2323 Jul 25, 2025
6a8fb51
fix spell check.
Krishna2323 Jul 25, 2025
940e06e
fix spell check.
Krishna2323 Jul 25, 2025
fd31912
use isArchivedReport for task parent report.
Krishna2323 Jul 26, 2025
98f0688
remove useReportIsArchived from HeaderView.tsx.
Krishna2323 Jul 26, 2025
0fa1714
minor update.
Krishna2323 Jul 28, 2025
7e5b159
pass ReportNameValuePairs collection from Search page.
Krishna2323 Jul 28, 2025
feecf81
Merge branch 'main' into krishna2323/issue/67092
Krishna2323 Jul 28, 2025
8dc205d
Merge branch 'Expensify:main' into krishna2323/issue/67092
Krishna2323 Jul 28, 2025
27a93ce
Merge branch 'main' into krishna2323/issue/67092
Krishna2323 Jul 28, 2025
3f8c48f
fix ESLint.
Krishna2323 Jul 28, 2025
98a746d
Merge branch 'main' into krishna2323/issue/67092
Krishna2323 Jul 29, 2025
4bd3af4
add selector for NVPs.
Krishna2323 Jul 29, 2025
cda53f1
create an array of archived reports id.
Krishna2323 Jul 30, 2025
a707ef4
convert archived reports id array to set.
Krishna2323 Jul 30, 2025
fc3c817
Merge branch 'main' into krishna2323/issue/67092
Krishna2323 Jul 30, 2025
112e39e
minor update.
Krishna2323 Jul 31, 2025
e13290d
Merge branch 'main' into krishna2323/issue/67092
Krishna2323 Aug 1, 2025
b31bb07
fix ESlint.
Krishna2323 Aug 1, 2025
40654f5
Merge branch 'main' into krishna2323/issue/67092
Krishna2323 Aug 1, 2025
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
4 changes: 2 additions & 2 deletions src/components/AvatarWithDisplayName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ function AvatarWithDisplayName({
const subtitle = getChatRoomSubtitle(report, {isCreateExpenseFlow: true});
const parentNavigationSubtitleData = getParentNavigationSubtitle(report, policy);
const isMoneyRequestOrReport = isMoneyRequestReport(report) || isMoneyRequest(report) || isTrackExpenseReport(report) || isInvoiceReport(report);
const icons = getIcons(report, personalDetails, null, '', -1, policy, invoiceReceiverPolicy);
const isReportArchived = useReportIsArchived(report?.reportID);
const icons = getIcons(report, personalDetails, null, '', -1, policy, invoiceReceiverPolicy, isReportArchived);
const ownerPersonalDetails = getPersonalDetailsForAccountIDs(report?.ownerAccountID ? [report.ownerAccountID] : [], personalDetails);
const displayNamesWithTooltips = getDisplayNamesWithTooltips(Object.values(ownerPersonalDetails), false);
const isReportArchived = useReportIsArchived(report?.reportID);
const shouldShowSubscriptAvatar = shouldReportShowSubscript(report, isReportArchived);
const avatarBorderColor = avatarBorderColorProp ?? (isAnonymous ? theme.highlightBG : theme.componentBG);

Expand Down
29 changes: 24 additions & 5 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTop
import type {PlatformStackNavigationProp} from '@libs/Navigation/PlatformStackNavigation/types';
import Performance from '@libs/Performance';
import {getIOUActionForTransactionID, isExportIntegrationAction, isIntegrationMessageAction} from '@libs/ReportActionsUtils';
import {canEditFieldOfMoneyRequest, generateReportID} from '@libs/ReportUtils';
import {canEditFieldOfMoneyRequest, generateReportID, isArchivedReport} from '@libs/ReportUtils';
import {buildCannedSearchQuery, buildSearchQueryString} from '@libs/SearchQueryUtils';
import {
getColumnsToShow,
Expand All @@ -44,7 +44,7 @@ import {
shouldShowEmptyState,
shouldShowYear as shouldShowYearUtil,
} from '@libs/SearchUIUtils';
import type {SearchKey} from '@libs/SearchUIUtils';
import type {ArchivedReportsIDSet, SearchKey} from '@libs/SearchUIUtils';
import {isOnHold, isTransactionPendingDelete} from '@libs/TransactionUtils';
import Navigation, {navigationRef} from '@navigation/Navigation';
import type {SearchFullscreenNavigatorParamList} from '@navigation/types';
Expand Down Expand Up @@ -171,6 +171,26 @@ function Search({queryJSON, searchResults, onSearchListScroll, contentContainerS
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
const previousTransactions = usePrevious(transactions);
const [reportActions] = useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS, {canBeMissing: true});

const [archivedReportsIdSet = new Set<string>()] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {
canBeMissing: true,
selector: (all): ArchivedReportsIDSet => {
const ids = new Set<string>();
if (!all) {
return ids;
}

const prefixLength = ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS.length;
for (const [key, value] of Object.entries(all)) {
if (isArchivedReport(value)) {
const reportID = key.slice(prefixLength);
ids.add(reportID);
}
}
return ids;
},
});

// Create a selector for only the reportActions needed to determine if a report has been exported or not, grouped by report
const [exportReportActions] = useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS, {
canEvict: false,
Expand Down Expand Up @@ -305,9 +325,8 @@ function Search({queryJSON, searchResults, onSearchListScroll, contentContainerS
if (groupBy && (isChat || isTask)) {
return [];
}

return getSections(type, searchResults.data, searchResults.search, groupBy, exportReportActions, searchKey);
}, [searchKey, exportReportActions, groupBy, isDataLoaded, searchResults, type]);
return getSections(type, searchResults.data, searchResults.search, groupBy, exportReportActions, searchKey, archivedReportsIdSet);
}, [searchKey, exportReportActions, groupBy, isDataLoaded, searchResults, type, archivedReportsIdSet]);

useEffect(() => {
/** We only want to display the skeleton for the status filters the first time we load them for a specific data type */
Expand Down
10 changes: 7 additions & 3 deletions src/hooks/useReportAvatarDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
import type {PersonalDetailsList, Policy, Report, ReportAction, Transaction} from '@src/types/onyx';
import type {Icon} from '@src/types/onyx/OnyxCommon';
import useOnyx from './useOnyx';
import useReportIsArchived from './useReportIsArchived';
import useTransactionsAndViolationsForReport from './useTransactionsAndViolationsForReport';

type ReportAvatarDetails = {
Expand Down Expand Up @@ -72,11 +73,11 @@ function getIconDetails({
reportPreviewSenderID,
innerPolicies,
policy,
}: AvatarDetailsProps & {reportPreviewSenderID: number | undefined}) {
isReportArchived = false,
}: AvatarDetailsProps & {reportPreviewSenderID: number | undefined; isReportArchived?: boolean}) {
const delegatePersonalDetails = action?.delegateAccountID ? personalDetails?.[action?.delegateAccountID] : undefined;
const actorAccountID = getReportActionActorAccountID(action, iouReport, report, delegatePersonalDetails);
const accountID = reportPreviewSenderID ?? actorAccountID ?? CONST.DEFAULT_NUMBER_ID;

const activePolicies = policies ?? innerPolicies;

const ownerAccountID = iouReport?.ownerAccountID ?? action?.childOwnerAccountID;
Expand Down Expand Up @@ -177,7 +178,7 @@ function getIconDetails({
if (!isWorkspaceActor) {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const avatarIconIndex = report?.isOwnPolicyExpenseChat || isPolicyExpenseChat(report) ? 0 : 1;
const reportIcons = getIcons(report, personalDetails, undefined, undefined, undefined, policy);
const reportIcons = getIcons(report, personalDetails, undefined, undefined, undefined, policy, undefined, isReportArchived);

return reportIcons.at(avatarIconIndex) ?? defaultAvatar;
}
Expand Down Expand Up @@ -221,6 +222,7 @@ function useReportAvatarDetails({iouReport, report, action, ...rest}: AvatarDeta
canBeMissing: true,
selector: (actions) => Object.values(actions ?? {}).filter(isMoneyRequestAction),
});
const isReportArchived = useReportIsArchived(report?.reportID);

const {transactions: reportTransactions} = useTransactionsAndViolationsForReport(action?.childReportID);
const transactions = useMemo(() => getAllNonDeletedTransactions(reportTransactions, iouActions ?? []), [reportTransactions, iouActions]);
Expand All @@ -243,6 +245,7 @@ function useReportAvatarDetails({iouReport, report, action, ...rest}: AvatarDeta
report,
iouReport,
reportPreviewSenderID: undefined,
isReportArchived,
}),
};
}
Expand Down Expand Up @@ -280,6 +283,7 @@ function useReportAvatarDetails({iouReport, report, action, ...rest}: AvatarDeta
report,
iouReport,
reportPreviewSenderID,
isReportArchived,
}),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
*/
let currentUserLogin: string | undefined;
let currentUserAccountID: number | undefined;
Onyx.connect({

Check warning on line 335 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
currentUserLogin = value?.email;
Expand All @@ -341,19 +341,19 @@
});

let loginList: OnyxEntry<Login>;
Onyx.connect({

Check warning on line 344 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.LOGIN_LIST,
callback: (value) => (loginList = isEmptyObject(value) ? {} : value),
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
Onyx.connect({

Check warning on line 350 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => (allPersonalDetails = isEmptyObject(value) ? {} : value),
});

const policies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 356 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
callback: (policy, key) => {
if (!policy || !key || !policy.name) {
Expand All @@ -365,14 +365,14 @@
});

let allPolicies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 368 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (val) => (allPolicies = val),
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 375 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -381,7 +381,7 @@
});

let allReportNameValuePairs: OnyxCollection<ReportNameValuePairs>;
Onyx.connect({

Check warning on line 384 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -393,7 +393,7 @@
const allSortedReportActions: Record<string, ReportAction[]> = {};
let allReportActions: OnyxCollection<ReportActions>;
const lastVisibleReportActions: ReportActions = {};
Onyx.connect({

Check warning on line 396 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -452,13 +452,13 @@
});

let activePolicyID: OnyxEntry<string>;
Onyx.connect({

Check warning on line 455 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ACTIVE_POLICY_ID,
callback: (value) => (activePolicyID = value),
});

let nvpDismissedProductTraining: OnyxEntry<DismissedProductTraining>;
Onyx.connect({

Check warning on line 461 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING,
callback: (value) => (nvpDismissedProductTraining = value),
});
Expand Down Expand Up @@ -1033,7 +1033,7 @@
}

result.text = reportName;
result.icons = getIcons(report, personalDetails, personalDetail?.avatar, personalDetail?.login, personalDetail?.accountID, null);
result.icons = getIcons(report, personalDetails, personalDetail?.avatar, personalDetail?.login, personalDetail?.accountID, null, undefined, !!result?.private_isArchived);
result.subtitle = subtitle;

return result;
Expand Down
36 changes: 2 additions & 34 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3252,6 +3252,7 @@ function getIcons(
defaultAccountID = -1,
policy?: OnyxInputOrEntry<Policy>,
invoiceReceiverPolicy?: OnyxInputOrEntry<Policy>,
isReportArchived = false,
): Icon[] {
if (isEmptyObject(report)) {
return [
Expand All @@ -3275,15 +3276,7 @@ function getIcons(
if (isDomainRoom(report)) {
return getIconsForDomainRoom(report);
}
const reportNameValuePairs = allReportNameValuePair?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`];
// This will get removed as part of https://github.com/Expensify/App/issues/59961
// eslint-disable-next-line deprecation/deprecation
if (
isAdminRoom(report) ||
isAnnounceRoom(report) ||
isChatRoom(report) ||
(isArchivedNonExpenseReport(report, !!reportNameValuePairs?.private_isArchived) && !chatIncludesConcierge(report))
) {
if (isAdminRoom(report) || isAnnounceRoom(report) || isChatRoom(report) || (isArchivedNonExpenseReport(report, isReportArchived) && !chatIncludesConcierge(report))) {
return getIconsForPolicyRoom(report, personalDetails, policy, invoiceReceiverPolicy);
}
if (isPolicyExpenseChat(report)) {
Expand Down Expand Up @@ -9613,30 +9606,6 @@ function getOptimisticDataForParentReportAction(reportID: string | undefined, la
});
}

function getQuickActionDetails(
quickActionReport: Report,
personalDetails: PersonalDetailsList | undefined,
policyChatForActivePolicy: Report | undefined,
reportNameValuePairs: ReportNameValuePairs,
): {quickActionAvatars: Icon[]; hideQABSubtitle: boolean} {
const isValidQuickActionReport = !(isEmptyObject(quickActionReport) || isArchivedReport(reportNameValuePairs));
let hideQABSubtitle = false;
let quickActionAvatars: Icon[] = [];
if (isValidQuickActionReport) {
const avatars = getIcons(quickActionReport, personalDetails);
quickActionAvatars = avatars.length <= 1 || isPolicyExpenseChat(quickActionReport) ? avatars : avatars.filter((avatar) => avatar.id !== currentUserAccountID);
} else {
hideQABSubtitle = true;
}
if (!isEmptyObject(policyChatForActivePolicy)) {
quickActionAvatars = getIcons(policyChatForActivePolicy, personalDetails);
}
return {
quickActionAvatars,
hideQABSubtitle,
};
}

function canBeAutoReimbursed(report: OnyxInputOrEntry<Report>, policy: OnyxInputOrEntry<Policy> | SearchPolicy): boolean {
if (isEmptyObject(policy)) {
return false;
Expand Down Expand Up @@ -11408,7 +11377,6 @@ export {
getInvoicePayerName,
getInvoicesChatName,
getPayeeName,
getQuickActionDetails,
hasActionWithErrorsForTransaction,
hasAutomatedExpensifyAccountIDs,
hasExpensifyGuidesEmails,
Expand Down
12 changes: 8 additions & 4 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ type SearchDateModifier = ValueOf<typeof CONST.SEARCH.DATE_MODIFIERS>;

type SearchDateModifierLower = Lowercase<SearchDateModifier>;

type ArchivedReportsIDSet = ReadonlySet<string>;

/**
* Returns a list of all possible searches in the LHN, along with their query & hash.
* *NOTE* When rendering the LHN, you should use the "createTypeMenuSections" method, which
Expand Down Expand Up @@ -1021,7 +1023,7 @@ function getAction(
*
* Do not use directly, use only via `getSections()` facade.
*/
function getTaskSections(data: OnyxTypes.SearchResults['data']): TaskListItemType[] {
function getTaskSections(data: OnyxTypes.SearchResults['data'], archivedReportsIDList?: ArchivedReportsIDSet): TaskListItemType[] {
return (
Object.keys(data)
.filter(isReportEntry)
Expand Down Expand Up @@ -1061,7 +1063,8 @@ function getTaskSections(data: OnyxTypes.SearchResults['data']): TaskListItemTyp
// eslint-disable-next-line deprecation/deprecation
const policy = getPolicy(parentReport.policyID);
const parentReportName = getReportName(parentReport, policy, undefined, undefined);
const icons = getIcons(parentReport, personalDetails, null, '', -1, policy);
const isParentReportArchived = archivedReportsIDList?.has(parentReport?.reportID);
const icons = getIcons(parentReport, personalDetails, null, '', -1, policy, undefined, isParentReportArchived);
const parentReportIcon = icons?.at(0);

result.parentReportName = parentReportName;
Expand Down Expand Up @@ -1275,12 +1278,13 @@ function getSections(
groupBy?: SearchGroupBy,
reportActions: Record<string, OnyxTypes.ReportAction[]> = {},
currentSearch: SearchKey = CONST.SEARCH.SEARCH_KEYS.EXPENSES,
archivedReportsIDList?: ArchivedReportsIDSet,
) {
if (type === CONST.SEARCH.DATA_TYPES.CHAT) {
return getReportActionsSections(data);
}
if (type === CONST.SEARCH.DATA_TYPES.TASK) {
return getTaskSections(data);
return getTaskSections(data, archivedReportsIDList);
}

if (groupBy) {
Expand Down Expand Up @@ -1883,4 +1887,4 @@ export {
isTransactionAmountTooLong,
isTransactionTaxAmountTooLong,
};
export type {SavedSearchMenuItem, SearchTypeMenuSection, SearchTypeMenuItem, SearchDateModifier, SearchDateModifierLower, SearchKey};
export type {SavedSearchMenuItem, SearchTypeMenuSection, SearchTypeMenuItem, SearchDateModifier, SearchDateModifierLower, SearchKey, ArchivedReportsIDSet};
11 changes: 10 additions & 1 deletion src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,16 @@ function getOptionData({
result.subtitle = subtitle;
result.participantsList = participantPersonalDetailList;

result.icons = getIcons(report, personalDetails, personalDetail?.avatar, personalDetail?.login, personalDetail?.accountID ?? CONST.DEFAULT_NUMBER_ID, policy, invoiceReceiverPolicy);
result.icons = getIcons(
report,
personalDetails,
personalDetail?.avatar,
personalDetail?.login,
personalDetail?.accountID ?? CONST.DEFAULT_NUMBER_ID,
policy,
invoiceReceiverPolicy,
!!result.private_isArchived,
);
result.displayNamesWithTooltips = displayNamesWithTooltips;

if (status) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ function ReportDetailsPage({policy, report, route, reportMetadata}: ReportDetail
return getDisplayNamesWithTooltips(getPersonalDetailsForAccountIDs(participants, personalDetails), hasMultipleParticipants);
}, [participants, personalDetails]);

const icons = useMemo(() => getIcons(report, personalDetails, null, '', -1, policy), [report, personalDetails, policy]);
const icons = useMemo(() => getIcons(report, personalDetails, null, '', -1, policy, undefined, isReportArchived), [report, personalDetails, policy, isReportArchived]);

const chatRoomSubtitleText = chatRoomSubtitle ? (
<DisplayNames
Expand Down
14 changes: 6 additions & 8 deletions src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import useLoadingBarVisibility from '@hooks/useLoadingBarVisibility';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import usePolicy from '@hooks/usePolicy';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useSubscriptionPlan from '@hooks/useSubscriptionPlan';
import useTheme from '@hooks/useTheme';
Expand Down Expand Up @@ -120,7 +119,7 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`, {canBeMissing: true});
const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report?.reportID}`, {canBeMissing: true});
const isReportArchived = useReportIsArchived(report?.reportID);
const isReportArchived = isArchivedReport(reportNameValuePairs);
Comment thread
Krishna2323 marked this conversation as resolved.

const {translate} = useLocalize();
const theme = useTheme();
Expand Down Expand Up @@ -204,16 +203,15 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
// If the onboarding report is directly loaded, shouldShowDiscountBanner can return wrong value as it is not
// linked to the react lifecycle directly. Wait for trial dates to load, before calculating.
const shouldShowDiscount = useMemo(
() => shouldShowDiscountBanner(hasTeam2025Pricing, subscriptionPlan) && !isArchivedReport(reportNameValuePairs),
() => shouldShowDiscountBanner(hasTeam2025Pricing, subscriptionPlan) && !isReportArchived,
// eslint-disable-next-line react-compiler/react-compiler
// eslint-disable-next-line react-hooks/exhaustive-deps
[firstDayFreeTrial, lastDayFreeTrial, hasTeam2025Pricing, reportNameValuePairs, subscriptionPlan],
);

const isArchived = isArchivedReport(reportNameValuePairs);
const shouldShowSubscript = shouldReportShowSubscript(report, isArchived);
const shouldShowSubscript = shouldReportShowSubscript(report, isReportArchived);
const defaultSubscriptSize = isExpenseRequest(report) ? CONST.AVATAR_SIZE.SMALL_NORMAL : CONST.AVATAR_SIZE.DEFAULT;
const icons = getIcons(reportHeaderData, personalDetails, null, '', -1, policy, invoiceReceiverPolicy);
const icons = getIcons(reportHeaderData, personalDetails, null, '', -1, policy, invoiceReceiverPolicy, isReportArchived);
const brickRoadIndicator = hasReportNameError(report) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '';
const shouldDisableDetailPage = shouldDisableDetailPageReportUtils(report);
const shouldUseGroupTitle = isGroupChat && (!!report?.reportName || !isMultipleParticipant);
Expand All @@ -225,7 +223,7 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
const [onboardingPurposeSelected] = useOnyx(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED, {canBeMissing: true});
const isChatUsedForOnboarding = isChatUsedForOnboardingReportUtils(report, onboardingPurposeSelected);
const shouldShowRegisterForWebinar = introSelected?.companySize === CONST.ONBOARDING_COMPANY_SIZE.MICRO && (isChatUsedForOnboarding || (isAdminRoom(report) && !isChatThread));
const shouldShowOnBoardingHelpDropdownButton = (shouldShowRegisterForWebinar || shouldShowGuideBooking) && !isArchived;
const shouldShowOnBoardingHelpDropdownButton = (shouldShowRegisterForWebinar || shouldShowGuideBooking) && !isReportArchived;
const shouldShowEarlyDiscountBanner = shouldShowDiscount && isChatUsedForOnboarding;
const latestScheduledCall = reportNameValuePairs?.calendlyCalls?.at(-1);
const hasActiveScheduledCall = latestScheduledCall && !isPast(latestScheduledCall.eventTime) && latestScheduledCall.status !== CONST.SCHEDULE_CALL_STATUS.CANCELLED;
Expand Down Expand Up @@ -302,7 +300,7 @@ function HeaderView({report, parentReportAction, onNavigationMenuButtonClicked,
tooltipEnabled
numberOfLines={1}
textStyles={[styles.headerText, styles.pre]}
shouldUseFullTitle={isChatRoom || isPolicyExpenseChat || isChatThread || isTaskReport || shouldUseGroupTitle || isArchived}
shouldUseFullTitle={isChatRoom || isPolicyExpenseChat || isChatThread || isTaskReport || shouldUseGroupTitle || isReportArchived}
renderAdditionalText={renderAdditionalText}
shouldAddEllipsis={shouldAddEllipsis}
/>
Expand Down
Loading
Loading