Skip to content
8 changes: 7 additions & 1 deletion src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,9 @@ const ONYXKEYS = {
NVP_LAST_ECASH_ANDROID_LOGIN: 'nvp_lastECashAndroidLogin',
NVP_LAST_ANDROID_LOGIN: 'nvp_lastAndroidLogin',

/** Draft report comments */
NVP_DRAFT_REPORT_COMMENTS: 'nvp_draftReportComments',

/** Collection Keys */
COLLECTION: {
DOWNLOAD: 'download_',
Expand Down Expand Up @@ -598,7 +601,8 @@ const ONYXKEYS = {
REPORT_ACTIONS_DRAFTS: 'reportActionsDrafts_',
REPORT_ACTIONS_PAGES: 'reportActionsPages_',
REPORT_ACTIONS_REACTIONS: 'reportActionsReactions_',
REPORT_DRAFT_COMMENT: 'reportDraftComment_',
/** @deprecated */
REPORT_DRAFT_COMMENT: 'reportDraftComment_', // eslint-disable-line deprecation/deprecation
REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_',
REPORT_USER_IS_TYPING: 'reportUserIsTyping_',
REPORT_USER_IS_LEAVING_ROOM: 'reportUserIsLeavingRoom_',
Expand Down Expand Up @@ -1001,6 +1005,7 @@ type OnyxCollectionValuesMapping = {
[ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS]: OnyxTypes.ReportActionsDrafts;
[ONYXKEYS.COLLECTION.REPORT_ACTIONS_PAGES]: OnyxTypes.Pages;
[ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS]: OnyxTypes.ReportActionReactions;
// eslint-disable-next-line deprecation/deprecation
[ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT]: string;
[ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE]: boolean;
[ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING]: OnyxTypes.ReportUserIsTyping;
Expand Down Expand Up @@ -1226,6 +1231,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.ONBOARDING_USER_REPORTED_INTEGRATION]: OnboardingAccounting;
[ONYXKEYS.HYBRID_APP]: OnyxTypes.HybridApp;
[ONYXKEYS.NVP_CSV_EXPORT_LAYOUTS]: Record<string, OnyxTypes.ExportTemplate>;
[ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS]: OnyxTypes.DraftReportComments;
};

type OnyxDerivedValuesMapping = {
Expand Down
7 changes: 2 additions & 5 deletions src/components/LHNOptionsList/LHNOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import useRootNavigationState from '@hooks/useRootNavigationState';
import useScrollEventEmitter from '@hooks/useScrollEventEmitter';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import {isValidDraftComment} from '@libs/DraftCommentUtils';
import getPlatform from '@libs/getPlatform';
import Log from '@libs/Log';
import {getIOUReportIDOfLastAction, getLastMessageTextForReport} from '@libs/OptionsListUtils';
Expand Down Expand Up @@ -53,7 +52,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
const [policy] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: false});
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {canBeMissing: true});
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: false});
const [draftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: false});
const [draftComments] = useOnyx(ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS, {canBeMissing: true});
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: false});
const [dismissedProductTraining, dismissedProductTrainingMetadata] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {canBeMissing: true});
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
Expand Down Expand Up @@ -189,7 +188,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
? (getOriginalMessage(itemParentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID)
: CONST.DEFAULT_NUMBER_ID;
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`];
const hasDraftComment = isValidDraftComment(draftComments?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`]);
const hasDraftComment = !!draftComments?.[reportID];

const isReportArchived = !!itemReportNameValuePairs?.private_isArchived;
const canUserPerformWrite = canUserPerformWriteAction(item, isReportArchived);
Expand Down Expand Up @@ -288,7 +287,6 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
policy,
personalDetails,
data.length,
draftComments,
optionMode,
preferredLocale,
transactions,
Expand All @@ -305,7 +303,6 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
policy,
personalDetails,
data.length,
draftComments,
optionMode,
preferredLocale,
transactions,
Expand Down
16 changes: 16 additions & 0 deletions src/hooks/useDiffPrevious.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import union from 'lodash/union';
import {useMemo} from 'react';
import usePrevious from './usePrevious';

/** This hook provides a list of which keys changed in an object vs the previous render
* akin to `sourceValue` for collections. Generally, using this hook at all is an anti-pattern.
* Avoid it at all costs */
export default function useDiffPrevious<T extends Record<string, unknown>>(value: T): string[] {
const previous = usePrevious(value);
const diff = useMemo(() => {
const allKeys = union(Object.keys(value), Object.keys(previous));
return allKeys.filter((key) => value[key] !== previous[key]);
}, [value, previous]);

return diff;
}
2 changes: 1 addition & 1 deletion src/hooks/usePriorityChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import usePrevious from './usePrevious';

function usePriorityMode() {
const [priorityMode] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE, {canBeMissing: true});
const [allReportsWithDraftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
const [allReportsWithDraftComments] = useOnyx(ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS, {canBeMissing: true});
const prevPriorityMode = usePrevious(priorityMode);

useEffect(() => {
Expand Down
16 changes: 10 additions & 6 deletions src/hooks/useSidebarOrderedReports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import SidebarUtils from '@libs/SidebarUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type * as OnyxTypes from '@src/types/onyx';
import {getEmptyObject} from '@src/types/utils/EmptyObject';
import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems';
import useCurrentReportID from './useCurrentReportID';
import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails';
import useDiffPrevious from './useDiffPrevious';
import useLocalize from './useLocalize';
import useOnyx from './useOnyx';
import usePrevious from './usePrevious';
Expand Down Expand Up @@ -65,7 +67,8 @@ function SidebarOrderedReportsContextProvider({
const [transactions, {sourceValue: transactionsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
const [transactionViolations, {sourceValue: transactionViolationsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
const [reportNameValuePairs, {sourceValue: reportNameValuePairsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {canBeMissing: true});
const [, {sourceValue: reportsDraftsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
const [drafts = getEmptyObject<OnyxTypes.DraftReportComments>()] = useOnyx(ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS, {canBeMissing: true});
const reportsDraftsUpdates = useDiffPrevious(drafts);
const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true});
const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: (value) => value?.reports, canBeMissing: true});
const [currentReportsToDisplay, setCurrentReportsToDisplay] = useState<ReportsToDisplayInLHN>({});
Expand Down Expand Up @@ -98,8 +101,8 @@ function SidebarOrderedReportsContextProvider({
reportsToUpdate = Object.keys(transactionViolationsUpdates ?? {})
.map((key) => key.replace(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, ONYXKEYS.COLLECTION.TRANSACTION))
.map((key) => `${ONYXKEYS.COLLECTION.REPORT}${transactions?.[key]?.reportID}`);
} else if (reportsDraftsUpdates) {
reportsToUpdate = Object.keys(reportsDraftsUpdates).map((key) => key.replace(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, ONYXKEYS.COLLECTION.REPORT));
} else if (reportsDraftsUpdates.length > 0) {
reportsToUpdate = reportsDraftsUpdates.map((key) => `${ONYXKEYS.COLLECTION.REPORT}${key}`);
} else if (policiesUpdates) {
const updatedPolicies = Object.keys(policiesUpdates).map((key) => key.replace(ONYXKEYS.COLLECTION.POLICY, ''));
reportsToUpdate = Object.entries(chatReports ?? {})
Expand Down Expand Up @@ -150,10 +153,10 @@ function SidebarOrderedReportsContextProvider({
derivedCurrentReportID,
priorityMode === CONST.PRIORITY_MODE.GSD,
betas,
policies,
transactionViolations,
reportNameValuePairs,
reportAttributes,
drafts,
);
} else {
reportsToDisplay = SidebarUtils.getReportsToDisplayInLHN(
Expand All @@ -165,19 +168,20 @@ function SidebarOrderedReportsContextProvider({
transactionViolations,
reportNameValuePairs,
reportAttributes,
drafts,
);
}
return reportsToDisplay;
// Rule disabled intentionally — triggering a re-render on currentReportsToDisplay would cause an infinite loop
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [getUpdatedReports, chatReports, derivedCurrentReportID, priorityMode, betas, policies, transactionViolations, reportNameValuePairs, reportAttributes]);
}, [getUpdatedReports, chatReports, derivedCurrentReportID, priorityMode, betas, policies, transactionViolations, reportNameValuePairs, reportAttributes, reportsDraftsUpdates]);

useEffect(() => {
setCurrentReportsToDisplay(reportsToDisplayInLHN);
}, [reportsToDisplayInLHN]);

const getOrderedReportIDs = useCallback(
() => SidebarUtils.sortReportsToDisplayInLHN(reportsToDisplayInLHN, priorityMode, localeCompare, reportNameValuePairs, reportAttributes),
() => SidebarUtils.sortReportsToDisplayInLHN(reportsToDisplayInLHN, priorityMode, localeCompare, reportNameValuePairs, reportAttributes, drafts),
// Rule disabled intentionally - reports should be sorted only when the reportsToDisplayInLHN changes
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
[reportsToDisplayInLHN, localeCompare],
Expand Down
6 changes: 6 additions & 0 deletions src/libs/API/parameters/SaveReportDraftCommentParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type SaveReportDraftCommentParams = {
reportID: string;
reportComment: string;
};

export default SaveReportDraftCommentParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,4 @@ export type {default as ReopenReportParams} from './ReopenReportParams';
export type {default as OpenUnreportedExpensesPageParams} from './OpenUnreportedExpensesPageParams';
export type {default as VerifyTestDriveRecipientParams} from './VerifyTestDriveRecipientParams';
export type {default as ExportSearchWithTemplateParams} from './ExportSearchWithTemplateParams';
export type {default as SaveReportDraftCommentParams} from './SaveReportDraftCommentParams';
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type UpdateBeneficialOwnersForBankAccountParams from './parameters/Update
type ApiRequestType = ValueOf<typeof CONST.API_REQUEST_TYPE>;

const WRITE_COMMANDS = {
SAVE_REPORT_DRAFT_COMMENT: 'SaveReportDraftComment',
CLEAN_POLICY_TAGS: 'ClearPolicyTags',
IMPORT_MULTI_LEVEL_TAGS: 'ImportMultiLevelTags',
SET_WORKSPACE_AUTO_REPORTING_FREQUENCY: 'SetWorkspaceAutoReportingFrequency',
Expand Down Expand Up @@ -861,6 +862,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.FINISH_CORPAY_BANK_ACCOUNT_ONBOARDING]: Parameters.FinishCorpayBankAccountOnboardingParams;
[WRITE_COMMANDS.DELETE_VACATION_DELEGATE]: null;
[WRITE_COMMANDS.REOPEN_REPORT]: Parameters.ReopenReportParams;
[WRITE_COMMANDS.SAVE_REPORT_DRAFT_COMMENT]: Parameters.SaveReportDraftCommentParams;

[WRITE_COMMANDS.DELETE_MONEY_REQUEST_ON_SEARCH]: Parameters.DeleteMoneyRequestOnSearchParams;
[WRITE_COMMANDS.HOLD_MONEY_REQUEST_ON_SEARCH]: Parameters.HoldMoneyRequestOnSearchParams;
Expand Down
25 changes: 9 additions & 16 deletions src/libs/DraftCommentUtils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import ONYXKEYS from '@src/ONYXKEYS';
import type {DraftReportComments} from '@src/types/onyx';

let draftCommentCollection: OnyxCollection<string> = {};
let draftComments: OnyxEntry<DraftReportComments> = {};
Onyx.connect({

Check warning on line 7 in src/libs/DraftCommentUtils.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function

Check warning on line 7 in src/libs/DraftCommentUtils.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_DRAFT_COMMENT,
key: ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS,
callback: (nextVal) => {
draftCommentCollection = nextVal;
draftComments = nextVal;
},
waitForCollectionCallback: true,
});

/**
Expand All @@ -17,22 +17,15 @@
* A valid use-case of this function is outside React components, like in utility functions.
*/
function getDraftComment(reportID: string): OnyxEntry<string> | null | undefined {
return draftCommentCollection?.[ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT + reportID];
}

/**
* Returns true if the report has a valid draft comment.
* A valid draft comment is a non-empty string.
*/
function isValidDraftComment(comment?: string | null): boolean {
return !!comment;
return draftComments?.[reportID];
}

/**
* Returns true if the report has a valid draft comment.
* NOTE: please prefer useOnyx when possible
*/
function hasValidDraftComment(reportID: string): boolean {
return isValidDraftComment(getDraftComment(reportID));
return !!getDraftComment(reportID);
}

/**
Expand All @@ -44,4 +37,4 @@
return comment || null;
}

export {getDraftComment, isValidDraftComment, hasValidDraftComment, prepareDraftComment};
export {getDraftComment, hasValidDraftComment, prepareDraftComment};
32 changes: 26 additions & 6 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
import type {PartialPolicyForSidebar, ReportsToDisplayInLHN} from '@hooks/useSidebarOrderedReports';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Card, PersonalDetails, PersonalDetailsList, ReportActions, ReportAttributesDerivedValue, ReportNameValuePairs, Transaction, TransactionViolation} from '@src/types/onyx';
import type {
Card,
DraftReportComments,
PersonalDetails,
PersonalDetailsList,
ReportActions,
ReportAttributesDerivedValue,
ReportNameValuePairs,
Transaction,
TransactionViolation,
} from '@src/types/onyx';
import type Beta from '@src/types/onyx/Beta';
import type {ReportAttributes} from '@src/types/onyx/DerivedValues';
import type {Errors} from '@src/types/onyx/OnyxCommon';
Expand All @@ -15,7 +25,6 @@
import type Report from '@src/types/onyx/Report';
import type ReportAction from '@src/types/onyx/ReportAction';
import {extractCollectionItemID} from './CollectionUtils';
import {hasValidDraftComment} from './DraftCommentUtils';
import {translateLocal} from './Localize';
import {getLastActorDisplayName, getLastMessageTextForReport, getPersonalDetailsForAccountIDs, shouldShowLastActorDisplayName} from './OptionsListUtils';
import Parser from './Parser';
Expand Down Expand Up @@ -132,7 +141,7 @@

const visibleReportActionItems: ReportActions = {};
let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
Onyx.connect({

Check warning on line 144 in src/libs/SidebarUtils.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 = value ?? {};
Expand All @@ -140,7 +149,7 @@
});

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

Check warning on line 152 in src/libs/SidebarUtils.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 @@ -148,7 +157,7 @@
},
});

Onyx.connect({

Check warning on line 160 in src/libs/SidebarUtils.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,
callback: (actions, key) => {
if (!actions || !key) {
Expand Down Expand Up @@ -207,6 +216,7 @@
transactionViolations: OnyxCollection<TransactionViolation[]>,
isReportArchived?: boolean,
reportAttributes?: ReportAttributesDerivedValue['reports'],
draftReportComments?: DraftReportComments,
) {
if (!report) {
return {shouldDisplay: false};
Expand Down Expand Up @@ -237,7 +247,12 @@
// Check if report should override hidden status
const isSystemChat = isSystemChatUtil(report);
const shouldOverrideHidden =
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || !!report.isPinned || reportAttributes?.[report?.reportID]?.requiresAttention;
!!draftReportComments?.[report.reportID] ||
hasErrorsOtherThanFailedReceipt ||
isFocused ||
isSystemChat ||
!!report.isPinned ||
reportAttributes?.[report?.reportID]?.requiresAttention;

if (isHidden && !shouldOverrideHidden) {
return {shouldDisplay: false};
Expand Down Expand Up @@ -268,6 +283,7 @@
transactionViolations: OnyxCollection<TransactionViolation[]>,
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
reportAttributes?: ReportAttributesDerivedValue['reports'],
draftReportComments?: DraftReportComments,
) {
const isInFocusMode = priorityMode === CONST.PRIORITY_MODE.GSD;
const allReportsDictValues = reports ?? {};
Expand All @@ -287,6 +303,7 @@
transactionViolations,
isArchivedReport(reportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`]),
reportAttributes,
draftReportComments,
);

if (shouldDisplay) {
Expand All @@ -304,10 +321,10 @@
currentReportId: string | undefined,
isInFocusMode: boolean,
betas: OnyxEntry<Beta[]>,
policies: OnyxCollection<PartialPolicyForSidebar>,
transactionViolations: OnyxCollection<TransactionViolation[]>,
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
reportAttributes?: ReportAttributesDerivedValue['reports'],
draftReportComments?: DraftReportComments,
) {
const displayedReportsCopy = {...displayedReports};
updatedReportsKeys.forEach((reportID) => {
Expand All @@ -325,6 +342,7 @@
transactionViolations,
isArchivedReport(reportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`]),
reportAttributes,
draftReportComments,
);

if (shouldDisplay) {
Expand All @@ -343,6 +361,7 @@
reportsToDisplay: ReportsToDisplayInLHN,
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
reportAttributes?: ReportAttributesDerivedValue['reports'],
draftReportComments?: DraftReportComments,
) {
const pinnedAndGBRReports: MiniReport[] = [];
const errorReports: MiniReport[] = [];
Expand All @@ -355,7 +374,7 @@
const reportID = report.reportID;
const isPinned = !!report.isPinned;
const hasErrors = !!report.hasErrorsOtherThanFailedReceipt;
const hasDraft = reportID ? hasValidDraftComment(reportID) : false;
const hasDraft = reportID ? !!draftReportComments?.[reportID] : false;
const reportNameValuePairsKey = `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`;
const rNVPs = reportNameValuePairs?.[reportNameValuePairsKey];

Expand Down Expand Up @@ -469,6 +488,7 @@
localeCompare: LocaleContextProps['localeCompare'],
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
reportAttributes?: ReportAttributesDerivedValue['reports'],
draftReportComments?: DraftReportComments,
): string[] {
Performance.markStart(CONST.TIMING.GET_ORDERED_REPORT_IDS);

Expand All @@ -486,7 +506,7 @@
// - Sorted by reportDisplayName in GSD (focus) view mode

// Step 1: Categorize reports
const categories = categorizeReportsForLHN(reportsToDisplay, reportNameValuePairs, reportAttributes);
const categories = categorizeReportsForLHN(reportsToDisplay, reportNameValuePairs, reportAttributes, draftReportComments);

// Step 2: Sort each category
const sortedCategories = sortCategorizedReports(categories, isInDefaultMode, localeCompare);
Expand Down
Loading
Loading