From 7243629db5bf266bffa9baa723db5f476643119b Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 30 Jan 2026 08:41:45 +0700 Subject: [PATCH 1/7] refactor getOptionData and sortReportsToDisplayInLHN to use conciergeReportID from useOnyx --- .../LHNOptionsList/OptionRowLHNData.tsx | 3 + src/hooks/useSidebarOrderedReports.tsx | 6 +- src/libs/ReportUtils.ts | 3 +- src/libs/SidebarUtils.ts | 20 ++- tests/perf-test/SidebarUtils.perf-test.ts | 1 + tests/unit/SidebarUtilsTest.ts | 123 +++++++++++++++++- 6 files changed, 140 insertions(+), 16 deletions(-) diff --git a/src/components/LHNOptionsList/OptionRowLHNData.tsx b/src/components/LHNOptionsList/OptionRowLHNData.tsx index b14bf53029730..f96a2626fea0e 100644 --- a/src/components/LHNOptionsList/OptionRowLHNData.tsx +++ b/src/components/LHNOptionsList/OptionRowLHNData.tsx @@ -51,6 +51,7 @@ 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 [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID, {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]); @@ -67,6 +68,7 @@ function OptionRowLHNData({ personalDetails, policy, parentReportAction, + conciergeReportID, lastMessageTextFromReport, invoiceReceiverPolicy, card, @@ -102,6 +104,7 @@ function OptionRowLHNData({ preferredLocale, policy, parentReportAction, + conciergeReportID, iouReportReportActions, transaction, receiptTransactions, diff --git a/src/hooks/useSidebarOrderedReports.tsx b/src/hooks/useSidebarOrderedReports.tsx index 26d707ce24a52..fd0c855028e97 100644 --- a/src/hooks/useSidebarOrderedReports.tsx +++ b/src/hooks/useSidebarOrderedReports.tsx @@ -76,6 +76,7 @@ function SidebarOrderedReportsContextProvider({ const [reportsDrafts, {sourceValue: reportsDraftsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true}); const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true}); const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: reportsSelector, canBeMissing: true}); + const [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID, {canBeMissing: true}); const [currentReportsToDisplay, setCurrentReportsToDisplay] = useState({}); const {shouldUseNarrowLayout} = useResponsiveLayout(); const {accountID} = useCurrentUserPersonalDetails(); @@ -230,10 +231,11 @@ function SidebarOrderedReportsContextProvider({ }, [reportsToDisplayInLHN]); const getOrderedReportIDs = useCallback( - () => SidebarUtils.sortReportsToDisplayInLHN(deepComparedReportsToDisplayInLHN ?? {}, priorityMode, localeCompare, deepComparedReportsDrafts, reportNameValuePairs), + () => + SidebarUtils.sortReportsToDisplayInLHN(deepComparedReportsToDisplayInLHN ?? {}, priorityMode, localeCompare, deepComparedReportsDrafts, reportNameValuePairs, conciergeReportID), // Rule disabled intentionally - reports should be sorted only when the reportsToDisplayInLHN changes // eslint-disable-next-line react-hooks/exhaustive-deps - [deepComparedReportsToDisplayInLHN, localeCompare, deepComparedReportsDrafts], + [deepComparedReportsToDisplayInLHN, localeCompare, deepComparedReportsDrafts, conciergeReportID], ); const orderedReportIDs = useMemo(() => getOrderedReportIDs(), [getOrderedReportIDs]); diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index bde4474a0294a..2da7d02979731 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5597,6 +5597,7 @@ function getReportName( isReportArchived?: boolean, reports?: Report[], policies?: Policy[], + conciergeReportID: string = onboarding?.chatReportID ?? '', ): string { // Check if we can use report name in derived values - only when we have report but no other params const canUseDerivedValue = @@ -6062,7 +6063,7 @@ function getReportName( }); } - if (isConciergeChatReport(report)) { + if (isConciergeChatReport(report, conciergeReportID)) { formattedName = CONST.CONCIERGE_DISPLAY_NAME; } diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index d9147fe48b5eb..41d12d703a0e9 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -357,7 +357,12 @@ function updateReportsToDisplayInLHN({ /** * Categorizes reports into their respective LHN groups */ -function categorizeReportsForLHN(reportsToDisplay: ReportsToDisplayInLHN, reportsDrafts: OnyxCollection | undefined, reportNameValuePairs?: OnyxCollection) { +function categorizeReportsForLHN( + reportsToDisplay: ReportsToDisplayInLHN, + reportsDrafts: OnyxCollection | undefined, + conciergeReportID: string, + reportNameValuePairs?: OnyxCollection, +) { const pinnedAndGBRReports: MiniReport[] = []; const errorReports: MiniReport[] = []; const draftReports: MiniReport[] = []; @@ -383,7 +388,7 @@ function categorizeReportsForLHN(reportsToDisplay: ReportsToDisplayInLHN, report const reportID = report.reportID; // eslint-disable-next-line @typescript-eslint/no-deprecated - const displayName = getReportName(report); + const displayName = getReportName(report, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, conciergeReportID); const miniReport: MiniReport = { reportID, displayName, @@ -518,7 +523,8 @@ function sortReportsToDisplayInLHN( priorityMode: OnyxEntry, localeCompare: LocaleContextProps['localeCompare'], reportsDrafts: OnyxCollection | undefined, - reportNameValuePairs?: OnyxCollection, + reportNameValuePairs: OnyxCollection | undefined, + conciergeReportID: string, ): string[] { Performance.markStart(CONST.TIMING.GET_ORDERED_REPORT_IDS); @@ -536,7 +542,7 @@ function sortReportsToDisplayInLHN( // - Sorted by reportDisplayName in GSD (focus) view mode // Step 1: Categorize reports - const categories = categorizeReportsForLHN(reportsToDisplay, reportsDrafts, reportNameValuePairs); + const categories = categorizeReportsForLHN(reportsToDisplay, reportsDrafts, conciergeReportID, reportNameValuePairs); // Step 2: Sort each category const sortedCategories = sortCategorizedReports(categories, isInDefaultMode, localeCompare); @@ -642,6 +648,7 @@ function getOptionData({ personalDetails, policy, parentReportAction, + conciergeReportID, lastMessageTextFromReport: lastMessageTextFromReportProp, invoiceReceiverPolicy, card, @@ -660,6 +667,7 @@ function getOptionData({ personalDetails: OnyxEntry; policy: OnyxEntry | undefined; parentReportAction: OnyxEntry | undefined; + conciergeReportID: string; lastMessageTextFromReport?: string; invoiceReceiverPolicy?: OnyxEntry; reportAttributes: OnyxEntry; @@ -758,7 +766,7 @@ function getOptionData({ result.tooltipText = getReportParticipantsTitle(visibleParticipantAccountIDs); result.hasOutstandingChildTask = report.hasOutstandingChildTask; result.hasParentAccess = report.hasParentAccess; - result.isConciergeChat = isConciergeChatReport(report); + result.isConciergeChat = isConciergeChatReport(report, conciergeReportID); result.participants = report.participants; const isExpense = isExpenseReport(report); @@ -1044,7 +1052,7 @@ function getOptionData({ } // eslint-disable-next-line @typescript-eslint/no-deprecated - const reportName = getReportName(report, policy, undefined, undefined, invoiceReceiverPolicy, undefined, undefined, isReportArchived); + const reportName = getReportName(report, policy, undefined, undefined, invoiceReceiverPolicy, undefined, undefined, isReportArchived, undefined, undefined, conciergeReportID); result.text = reportName; result.subtitle = subtitle; diff --git a/tests/perf-test/SidebarUtils.perf-test.ts b/tests/perf-test/SidebarUtils.perf-test.ts index ab45ab1c4642c..fc114b17deb14 100644 --- a/tests/perf-test/SidebarUtils.perf-test.ts +++ b/tests/perf-test/SidebarUtils.perf-test.ts @@ -83,6 +83,7 @@ describe('SidebarUtils', () => { personalDetails, policy, parentReportAction, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, lastAction: undefined, diff --git a/tests/unit/SidebarUtilsTest.ts b/tests/unit/SidebarUtilsTest.ts index 3a7e7eb1a9846..2e108e293aa46 100644 --- a/tests/unit/SidebarUtilsTest.ts +++ b/tests/unit/SidebarUtilsTest.ts @@ -344,6 +344,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -360,6 +361,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1162,6 +1164,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1224,6 +1227,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1289,6 +1293,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1338,6 +1343,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy, parentReportAction: undefined, + conciergeReportID: '', lastMessageTextFromReport: 'test message', oneTransactionThreadReport: undefined, card: undefined, @@ -1379,6 +1385,7 @@ describe('SidebarUtils', () => { personalDetails: LHNTestUtils.fakePersonalDetails, policy, parentReportAction: undefined, + conciergeReportID: '', lastMessageTextFromReport: 'test message', oneTransactionThreadReport: undefined, card: undefined, @@ -1417,6 +1424,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy, parentReportAction: undefined, + conciergeReportID: '', lastMessageTextFromReport: 'test message', oneTransactionThreadReport: undefined, card: undefined, @@ -1545,6 +1553,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, lastAction: undefined, @@ -1587,6 +1596,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy, parentReportAction: undefined, + conciergeReportID: '', lastMessageTextFromReport: 'test message', oneTransactionThreadReport: undefined, card: undefined, @@ -1660,6 +1670,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1721,6 +1732,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1772,6 +1784,7 @@ describe('SidebarUtils', () => { }, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1850,6 +1863,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -1969,6 +1983,7 @@ describe('SidebarUtils', () => { personalDetails: {}, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -2055,6 +2070,7 @@ describe('SidebarUtils', () => { personalDetails: LHNTestUtils.fakePersonalDetails, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, translate: translateLocal, @@ -2153,6 +2169,7 @@ describe('SidebarUtils', () => { personalDetails: personalDetailList, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, lastAction: lastReportPreviewAction, @@ -2252,6 +2269,7 @@ describe('SidebarUtils', () => { personalDetails: personalDetailList, policy: undefined, parentReportAction: undefined, + conciergeReportID: '', oneTransactionThreadReport: undefined, card: undefined, lastAction: lastReportPreviewAction, @@ -2266,6 +2284,97 @@ describe('SidebarUtils', () => { expect(result?.alternateText).toBe(reportPreviewMessage); }); }); + + describe('conciergeReportID parameter', () => { + it('returns isConciergeChat as true when conciergeReportID matches the report reportID', () => { + // Given a report with a specific reportID + const MOCK_REPORT: OnyxEntry = { + reportID: '123456', + }; + const conciergeReportID = '123456'; + + // When getOptionData is called with matching conciergeReportID + const result = SidebarUtils.getOptionData({ + report: MOCK_REPORT, + reportAttributes: undefined, + reportNameValuePairs: {}, + personalDetails: {}, + policy: undefined, + parentReportAction: undefined, + conciergeReportID, + oneTransactionThreadReport: undefined, + card: undefined, + translate: translateLocal, + localeCompare, + lastAction: undefined, + lastActionReport: undefined, + isReportArchived: undefined, + currentUserAccountID: 0, + }); + + // Then isConciergeChat should be true + expect(result?.isConciergeChat).toBe(true); + }); + + it('returns isConciergeChat as false when conciergeReportID does not match the report reportID', () => { + // Given a report with a specific reportID + const MOCK_REPORT: OnyxEntry = { + reportID: '123456', + }; + const conciergeReportID = '999999'; + + // When getOptionData is called with non-matching conciergeReportID + const result = SidebarUtils.getOptionData({ + report: MOCK_REPORT, + reportAttributes: undefined, + reportNameValuePairs: {}, + personalDetails: {}, + policy: undefined, + parentReportAction: undefined, + conciergeReportID, + oneTransactionThreadReport: undefined, + card: undefined, + translate: translateLocal, + localeCompare, + lastAction: undefined, + lastActionReport: undefined, + isReportArchived: undefined, + currentUserAccountID: 0, + }); + + // Then isConciergeChat should be false + expect(result?.isConciergeChat).toBe(false); + }); + + it('returns isConciergeChat as false when conciergeReportID is empty string', () => { + // Given a report with a specific reportID + const MOCK_REPORT: OnyxEntry = { + reportID: '123456', + }; + + // When getOptionData is called with empty conciergeReportID + const result = SidebarUtils.getOptionData({ + report: MOCK_REPORT, + reportAttributes: undefined, + reportNameValuePairs: {}, + personalDetails: {}, + policy: undefined, + parentReportAction: undefined, + conciergeReportID: '', + oneTransactionThreadReport: undefined, + card: undefined, + translate: translateLocal, + localeCompare, + lastAction: undefined, + lastActionReport: undefined, + isReportArchived: undefined, + currentUserAccountID: 0, + }); + + // Then isConciergeChat should be false + expect(result?.isConciergeChat).toBe(false); + }); + }); }); describe('sortReportsToDisplayInLHN', () => { @@ -2279,7 +2388,7 @@ describe('SidebarUtils', () => { }; // When the reports are categorized - const result = SidebarUtils.categorizeReportsForLHN(reports, reportsDrafts, reportNameValuePairs); + const result = SidebarUtils.categorizeReportsForLHN(reports, reportsDrafts, '', reportNameValuePairs); // Then the reports are categorized into the correct groups expect(result.pinnedAndGBRReports).toHaveLength(1); @@ -2306,7 +2415,7 @@ describe('SidebarUtils', () => { ]); // When the reports are categorized - const result = SidebarUtils.categorizeReportsForLHN(reports, undefined, undefined); + const result = SidebarUtils.categorizeReportsForLHN(reports, undefined, '', undefined); // Then the reports are categorized into the correct groups expect(result.pinnedAndGBRReports).toHaveLength(1); @@ -2333,7 +2442,7 @@ describe('SidebarUtils', () => { }; // When the reports are categorized - const result = SidebarUtils.categorizeReportsForLHN(reports, {}); + const result = SidebarUtils.categorizeReportsForLHN(reports, {}, ''); // Then the reports are categorized into the correct groups expect(result.pinnedAndGBRReports).toHaveLength(0); @@ -2347,7 +2456,7 @@ describe('SidebarUtils', () => { it('should handle empty reports object', () => { // Given the reports are empty - const result = SidebarUtils.categorizeReportsForLHN({}, {}); + const result = SidebarUtils.categorizeReportsForLHN({}, {}, ''); // Then the reports are categorized into the correct groups expect(result.pinnedAndGBRReports).toHaveLength(0); @@ -2584,7 +2693,7 @@ describe('SidebarUtils', () => { const priorityMode = CONST.PRIORITY_MODE.DEFAULT; // When the reports are sorted - const result = SidebarUtils.sortReportsToDisplayInLHN(reports, priorityMode, mockLocaleCompare, undefined); + const result = SidebarUtils.sortReportsToDisplayInLHN(reports, priorityMode, mockLocaleCompare, undefined, undefined, ''); // Then the reports are sorted in the correct order expect(result).toEqual(['0', '1', '2']); // Pinned first, Error second, Normal third @@ -2610,10 +2719,10 @@ describe('SidebarUtils', () => { const mockLocaleCompare = (a: string, b: string) => a.localeCompare(b); // When the reports are sorted in default mode - const defaultResult = SidebarUtils.sortReportsToDisplayInLHN(reports, CONST.PRIORITY_MODE.DEFAULT, mockLocaleCompare, undefined); + const defaultResult = SidebarUtils.sortReportsToDisplayInLHN(reports, CONST.PRIORITY_MODE.DEFAULT, mockLocaleCompare, undefined, undefined, ''); // When the reports are sorted in GSD mode - const gsdResult = SidebarUtils.sortReportsToDisplayInLHN(reports, CONST.PRIORITY_MODE.GSD, mockLocaleCompare, undefined); + const gsdResult = SidebarUtils.sortReportsToDisplayInLHN(reports, CONST.PRIORITY_MODE.GSD, mockLocaleCompare, undefined, undefined, ''); // Then the reports are sorted in the correct order expect(defaultResult).toEqual(['1', '0']); // Most recent first (index 1 has later date) From 8f93446901b39502c35a1f18a7cf6716c4810d81 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 30 Jan 2026 09:00:11 +0700 Subject: [PATCH 2/7] update lint --- src/libs/ReportUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 2da7d02979731..edbc0bfce6d77 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5586,6 +5586,7 @@ function getReportActionMessage({ * Use ReportNameUtils.computeReportName for full name generation. * For reading a stored name only, use ReportNameUtils.getReportName. */ +// eslint-disable-next-line @typescript-eslint/max-params function getReportName( report: OnyxEntry, policy?: OnyxEntry, @@ -5597,7 +5598,7 @@ function getReportName( isReportArchived?: boolean, reports?: Report[], policies?: Policy[], - conciergeReportID: string = onboarding?.chatReportID ?? '', + conciergeReportID: string | undefined = onboarding?.chatReportID, ): string { // Check if we can use report name in derived values - only when we have report but no other params const canUseDerivedValue = From 12024bbe3bb78de5963c5f997513ac8bb2aa3616 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 30 Jan 2026 09:58:35 +0700 Subject: [PATCH 3/7] update test --- tests/unit/useSidebarOrderedReportsTest.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/useSidebarOrderedReportsTest.tsx b/tests/unit/useSidebarOrderedReportsTest.tsx index 98c7004ca966f..8339298b0e897 100644 --- a/tests/unit/useSidebarOrderedReportsTest.tsx +++ b/tests/unit/useSidebarOrderedReportsTest.tsx @@ -202,6 +202,7 @@ describe('useSidebarOrderedReports', () => { expect.any(Function), // localeCompare expect.any(Object), // reportsDrafts expect.any(Object), // reportNameValuePairs + expect.any(String), // conciergeReportID ); }); From f7b21c5314ad5f5036d0e7903c062e5b6a538734 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 2 Feb 2026 12:07:43 +0700 Subject: [PATCH 4/7] change default value --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 9461a160d8794..59e7ab82f1b57 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5643,7 +5643,7 @@ function getReportName( isReportArchived?: boolean, reports?: Report[], policies?: Policy[], - conciergeReportID: string | undefined = onboarding?.chatReportID, + conciergeReportID: string | undefined = conciergeReportIDOnyxConnect, ): string { // Check if we can use report name in derived values - only when we have report but no other params const canUseDerivedValue = From e4a894a1c0b76db03820c48e51792b258abf3271 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 18 Feb 2026 21:32:22 +0700 Subject: [PATCH 5/7] remove empty string --- src/hooks/useSidebarOrderedReports.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useSidebarOrderedReports.tsx b/src/hooks/useSidebarOrderedReports.tsx index 77be79bd02a9e..64ccd2d1deb34 100644 --- a/src/hooks/useSidebarOrderedReports.tsx +++ b/src/hooks/useSidebarOrderedReports.tsx @@ -73,7 +73,7 @@ function SidebarOrderedReportsContextProvider({ const [reportNameValuePairs, {sourceValue: reportNameValuePairsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {canBeMissing: true}); const [reportsDrafts, {sourceValue: reportsDraftsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true}); const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true}); - const [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID, {canBeMissing: true}); + const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID, {canBeMissing: true}); const reportAttributes = useReportAttributes(); const [currentReportsToDisplay, setCurrentReportsToDisplay] = useState({}); const {shouldUseNarrowLayout} = useResponsiveLayout(); From 1a1ddd2eb2da2163edb9c7bb578b60fffcc978aa Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 18 Feb 2026 21:46:02 +0700 Subject: [PATCH 6/7] update lint --- tests/unit/SidebarUtilsTest.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit/SidebarUtilsTest.ts b/tests/unit/SidebarUtilsTest.ts index bf8a51ea46a25..cf4f9a800a911 100644 --- a/tests/unit/SidebarUtilsTest.ts +++ b/tests/unit/SidebarUtilsTest.ts @@ -2508,6 +2508,7 @@ describe('SidebarUtils', () => { localeCompare, lastAction: undefined, lastActionReport: undefined, + invoiceReceiverPolicy: undefined, isReportArchived: undefined, currentUserAccountID: 0, }); @@ -2538,6 +2539,7 @@ describe('SidebarUtils', () => { localeCompare, lastAction: undefined, lastActionReport: undefined, + invoiceReceiverPolicy: undefined, isReportArchived: undefined, currentUserAccountID: 0, }); @@ -2567,6 +2569,7 @@ describe('SidebarUtils', () => { localeCompare, lastAction: undefined, lastActionReport: undefined, + invoiceReceiverPolicy: undefined, isReportArchived: undefined, currentUserAccountID: 0, }); From 408d2bc8a7f58dea2a0c89711ac8e4217e8c8aab Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 18 Feb 2026 22:14:16 +0700 Subject: [PATCH 7/7] update test --- src/libs/ReportUtils.ts | 2 +- tests/unit/useSidebarOrderedReportsTest.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6d2146dfdbbe3..11df176bfe2fa 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5762,7 +5762,7 @@ function getReportName( isReportArchived?: boolean, reports?: Report[], policies?: Policy[], - conciergeReportID: string = '', + conciergeReportID?: string, ): string { // Check if we can use report name in derived values - only when we have report but no other params const canUseDerivedValue = diff --git a/tests/unit/useSidebarOrderedReportsTest.tsx b/tests/unit/useSidebarOrderedReportsTest.tsx index 8339298b0e897..ebf3bd91557b4 100644 --- a/tests/unit/useSidebarOrderedReportsTest.tsx +++ b/tests/unit/useSidebarOrderedReportsTest.tsx @@ -202,7 +202,7 @@ describe('useSidebarOrderedReports', () => { expect.any(Function), // localeCompare expect.any(Object), // reportsDrafts expect.any(Object), // reportNameValuePairs - expect.any(String), // conciergeReportID + undefined, // conciergeReportID - undefined when not set in Onyx ); });