From e6e63caffcd6c0ffa3dbf02ffae63f28cfb5d0fe Mon Sep 17 00:00:00 2001 From: Faizan Shoukat Abbasi Date: Mon, 16 Feb 2026 23:37:58 +0500 Subject: [PATCH 1/6] 79170: Reports-After moving expense to new report on 'Top Spenders', menu only shows 'Export' option --- src/components/Search/SearchList/index.tsx | 6 ++++++ src/components/Search/index.tsx | 16 ++++++++++++++++ .../Search/TransactionGroupListItem.tsx | 9 +++++++++ .../SelectionListWithSections/types.ts | 2 ++ 4 files changed, 33 insertions(+) diff --git a/src/components/Search/SearchList/index.tsx b/src/components/Search/SearchList/index.tsx index e89d7c3d3b51..57fa2952120f 100644 --- a/src/components/Search/SearchList/index.tsx +++ b/src/components/Search/SearchList/index.tsx @@ -138,6 +138,9 @@ type SearchListProps = Pick, 'onScroll' | 'conten /** Whether all transactions have been loaded from snapshots in group-by views */ hasLoadedAllTransactions?: boolean; + /** When set, group list items collapse so user must click header row again to see updated expense list (e.g. after closing RHP) */ + collapseExpandedGroupsTrigger?: number; + /** Reference to the outer element */ ref?: ForwardedRef; }; @@ -224,6 +227,7 @@ function SearchList({ isDEWBetaEnabled, selectedTransactions, hasLoadedAllTransactions, + collapseExpandedGroupsTrigger, ref, }: SearchListProps) { const styles = useThemeStyles(); @@ -494,6 +498,7 @@ function SearchList({ customCardNames={customCardNames} onFocus={onFocus} newTransactionID={newTransactionID} + collapseExpandedGroupsTrigger={'transactions' in item ? collapseExpandedGroupsTrigger : undefined} /> ); @@ -526,6 +531,7 @@ function SearchList({ onDEWModalOpen, isDEWBetaEnabled, customCardNames, + collapseExpandedGroupsTrigger, ], ); diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 6118504e0a23..80f4269c060c 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -238,6 +238,7 @@ function Search({ const {isSmallScreenWidth, isLargeScreenWidth} = useResponsiveLayout(); const navigation = useNavigation>(); const isFocused = useIsFocused(); + const prevIsFocused = usePrevious(isFocused); const {markReportIDAsExpense} = useWideRHPActions(); const { currentSearchHash, @@ -570,6 +571,20 @@ function Search({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [handleSearch, isOffline, offset, queryJSON, searchKey, shouldCalculateTotals]); + // When returning to a grouped search (e.g. Top Spenders after closing expense RHP), collapse expanded groups + // so the user must click the header row again to see the expense list (with updated data from refetch). + const [collapseExpandedGroupsTrigger, setCollapseExpandedGroupsTrigger] = useState(0); + useEffect(() => { + const didReturnToScreen = prevIsFocused === false && isFocused === true; + if (!didReturnToScreen || !validGroupBy || isOffline || searchResults?.search?.isLoading) { + return; + } + setCollapseExpandedGroupsTrigger((prev) => prev + 1); + handleSearch({queryJSON, searchKey, offset, shouldCalculateTotals, prevReportsLength: filteredDataLength, isLoading: false}); + // Only run when screen gains focus (returning from RHP/modal); refetch and collapse so re-expand shows fresh data. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [isFocused, prevIsFocused]); + useEffect(() => { if (!shouldRetrySearchWithTotalsRef.current || searchResults?.search?.isLoading || !shouldCalculateTotals) { return; @@ -1456,6 +1471,7 @@ function Search({ ref={searchListRef} data={sortedData} ListItem={ListItem} + collapseExpandedGroupsTrigger={collapseExpandedGroupsTrigger} onSelectRow={onSelectRow} onCheckboxPress={toggleTransaction} onAllCheckboxPress={toggleAllTransactions} diff --git a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx index 868d090ecc9b..237ee7adb370 100644 --- a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx +++ b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx @@ -77,6 +77,7 @@ function TransactionGroupListItem({ newTransactionID, onDEWModalOpen, isDEWBetaEnabled, + collapseExpandedGroupsTrigger = 0, }: TransactionGroupListItemProps) { const groupItem = item as unknown as TransactionGroupListItemType; @@ -112,6 +113,14 @@ function TransactionGroupListItem({ const isExpenseReportType = searchType === CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT; const [transactionsVisibleLimit, setTransactionsVisibleLimit] = useState(CONST.TRANSACTION.RESULTS_PAGE_SIZE as number); const [isExpanded, setIsExpanded] = useState(false); + + // When returning from expense RHP, collapse so user must click the header row again to see the expense (with updated data). + useEffect(() => { + if (collapseExpandedGroupsTrigger > 0) { + setIsExpanded(false); + } + }, [collapseExpandedGroupsTrigger]); + const [isActionLoadingSet = CONST.EMPTY_SET] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}`, {canBeMissing: true, selector: isActionLoadingSetSelector}); const [allReportMetadata] = useOnyx(ONYXKEYS.COLLECTION.REPORT_METADATA, {canBeMissing: true}); const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST, {canBeMissing: true}); diff --git a/src/components/SelectionListWithSections/types.ts b/src/components/SelectionListWithSections/types.ts index 03ecfb999f28..b4b04782c9de 100644 --- a/src/components/SelectionListWithSections/types.ts +++ b/src/components/SelectionListWithSections/types.ts @@ -708,6 +708,8 @@ type TransactionGroupListItemProps = ListItemProps void; /** Whether the DEW beta flag is enabled */ isDEWBetaEnabled?: boolean; + /** When incremented, collapse this group (e.g. when returning from expense RHP so user re-expands to see updated row) */ + collapseExpandedGroupsTrigger?: number; }; type TransactionGroupListExpandedProps = Pick< From a85e653d7fc1a6930fc0526b9ea4f29dc865fcb4 Mon Sep 17 00:00:00 2001 From: Faizan Shoukat Abbasi Date: Tue, 17 Feb 2026 00:23:43 +0500 Subject: [PATCH 2/6] Fixed Eslint issues --- .../Search/TransactionGroupListItem.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx index 237ee7adb370..56fdd97f0f1f 100644 --- a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx +++ b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx @@ -116,9 +116,10 @@ function TransactionGroupListItem({ // When returning from expense RHP, collapse so user must click the header row again to see the expense (with updated data). useEffect(() => { - if (collapseExpandedGroupsTrigger > 0) { - setIsExpanded(false); + if (collapseExpandedGroupsTrigger <= 0) { + return; } + setIsExpanded(false); }, [collapseExpandedGroupsTrigger]); const [isActionLoadingSet = CONST.EMPTY_SET] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}`, {canBeMissing: true, selector: isActionLoadingSetSelector}); From eead2b9f438feb97a6445c85531f50ba2e0cd0f9 Mon Sep 17 00:00:00 2001 From: Faizan Shoukat Abbasi Date: Thu, 5 Mar 2026 01:51:15 +0500 Subject: [PATCH 3/6] Refresh expanded grouped search rows on focus return to keep transaction counts and dropdown actions in sync after moving expenses. --- src/components/Search/SearchList/index.tsx | 6 ------ src/components/Search/index.tsx | 16 -------------- .../Search/TransactionGroupListItem.tsx | 21 ++++++++++++++++--- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/components/Search/SearchList/index.tsx b/src/components/Search/SearchList/index.tsx index e22795810a46..a26fa3510a92 100644 --- a/src/components/Search/SearchList/index.tsx +++ b/src/components/Search/SearchList/index.tsx @@ -138,9 +138,6 @@ type SearchListProps = Pick, 'onScroll' | 'conten /** Whether all transactions have been loaded from snapshots in group-by views */ hasLoadedAllTransactions?: boolean; - /** When set, group list items collapse so user must click header row again to see updated expense list (e.g. after closing RHP) */ - collapseExpandedGroupsTrigger?: number; - /** Reference to the outer element */ ref?: ForwardedRef; }; @@ -227,7 +224,6 @@ function SearchList({ isDEWBetaEnabled, selectedTransactions, hasLoadedAllTransactions, - collapseExpandedGroupsTrigger, ref, }: SearchListProps) { const styles = useThemeStyles(); @@ -450,7 +446,6 @@ function SearchList({ customCardNames={customCardNames} onFocus={onFocus} newTransactionID={newTransactionID} - collapseExpandedGroupsTrigger={'transactions' in item ? collapseExpandedGroupsTrigger : undefined} /> ); @@ -484,7 +479,6 @@ function SearchList({ lastPaymentMethod, personalPolicyID, customCardNames, - collapseExpandedGroupsTrigger, ], ); diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index c648c275cf31..15316f776217 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -227,7 +227,6 @@ function Search({ const {isSmallScreenWidth, isLargeScreenWidth} = useResponsiveLayout(); const navigation = useNavigation>(); const isFocused = useIsFocused(); - const prevIsFocused = usePrevious(isFocused); const {markReportIDAsExpense} = useWideRHPActions(); const {currentSearchHash, selectedTransactions, shouldTurnOffSelectionMode, lastSearchType, areAllMatchingItemsSelected, shouldResetSearchQuery, shouldUseLiveData} = useSearchStateContext(); @@ -603,20 +602,6 @@ function Search({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [handleSearch, isOffline, offset, queryJSON, searchKey, shouldCalculateTotals, validGroupBy]); - // When returning to a grouped search (e.g. Top Spenders after closing expense RHP), collapse expanded groups - // so the user must click the header row again to see the expense list (with updated data from refetch). - const [collapseExpandedGroupsTrigger, setCollapseExpandedGroupsTrigger] = useState(0); - useEffect(() => { - const didReturnToScreen = prevIsFocused === false && isFocused === true; - if (!didReturnToScreen || !validGroupBy || isOffline || searchResults?.search?.isLoading) { - return; - } - setCollapseExpandedGroupsTrigger((prev) => prev + 1); - handleSearch({queryJSON, searchKey, offset, shouldCalculateTotals, prevReportsLength: filteredDataLength, isLoading: false}); - // Only run when screen gains focus (returning from RHP/modal); refetch and collapse so re-expand shows fresh data. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [isFocused, prevIsFocused]); - useEffect(() => { if (!shouldRetrySearchWithTotalsOrGroupedRef.current || searchResults?.search?.isLoading || (!shouldCalculateTotals && !validGroupBy)) { return; @@ -1405,7 +1390,6 @@ function Search({ ref={searchListRef} data={sortedData} ListItem={ListItem} - collapseExpandedGroupsTrigger={collapseExpandedGroupsTrigger} onSelectRow={onSelectRow} onCheckboxPress={toggleTransaction} onAllCheckboxPress={toggleAllTransactions} diff --git a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx index a487e000d2c9..909433002ea9 100644 --- a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx +++ b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx @@ -1,4 +1,5 @@ -import React, {useEffect, useRef, useState} from 'react'; +import {useIsFocused} from '@react-navigation/native'; +import React, {useCallback, useEffect, useRef, useState} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; // Use the original useOnyx hook to get the real-time data from Onyx and not from the snapshot @@ -88,6 +89,7 @@ function TransactionGroupListItem({ const {selectedTransactions} = useSearchStateContext(); const {isLargeScreenWidth} = useResponsiveLayout(); const currentUserDetails = useCurrentUserPersonalDetails(); + const isScreenFocused = useIsFocused(); const oneTransactionItem = groupItem.isOneTransactionReport ? groupItem.transactions.at(0) : undefined; const [parentReport] = originalUseOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(oneTransactionItem?.reportID)}`); @@ -158,7 +160,7 @@ function TransactionGroupListItem({ const isDisabledOrEmpty = isEmpty || isDisabled; // Search transactions - handles both refresh (offset 0) and pagination (current offset + pageSize) - const searchTransactions = (pageSize = 0, isRefresh = false) => { + const searchTransactions = useCallback((pageSize = 0, isRefresh = false) => { if (!groupItem.transactionsQueryJSON) { return; } @@ -171,7 +173,7 @@ function TransactionGroupListItem({ isLoading: !!transactionsSnapshot?.search?.isLoading, isOffline, }); - }; + }, [groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading, transactionsSnapshot?.search?.offset]); const animatedHighlightStyle = useAnimatedHighlightStyle({ borderRadius: variables.componentBorderRadius, @@ -194,6 +196,19 @@ function TransactionGroupListItem({ searchTransactions(0, true); }, [newTransactionID, isExpanded, searchTransactions]); + const wasScreenFocusedRef = useRef(isScreenFocused); + useEffect(() => { + const didReturnToScreen = wasScreenFocusedRef.current === false && isScreenFocused === true; + wasScreenFocusedRef.current = isScreenFocused; + + if (!didReturnToScreen || !isExpanded || isExpenseReportType) { + return; + } + + // Keep expanded group rows in sync with updated grouped totals after returning from RHP flows. + searchTransactions(0, true); + }, [isScreenFocused, isExpanded, isExpenseReportType, searchTransactions]); + const handleToggle = () => { setIsExpanded((prev) => { const newExpandedState = !prev; From 6b36f546ca05734d1732e70484498c4bfea12e44 Mon Sep 17 00:00:00 2001 From: Faizan Shoukat Abbasi Date: Thu, 5 Mar 2026 02:05:48 +0500 Subject: [PATCH 4/6] Fixed prettier issue --- .../Search/TransactionGroupListItem.tsx | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx index 909433002ea9..a73995295f18 100644 --- a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx +++ b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx @@ -160,20 +160,23 @@ function TransactionGroupListItem({ const isDisabledOrEmpty = isEmpty || isDisabled; // Search transactions - handles both refresh (offset 0) and pagination (current offset + pageSize) - const searchTransactions = useCallback((pageSize = 0, isRefresh = false) => { - if (!groupItem.transactionsQueryJSON) { - return; - } + const searchTransactions = useCallback( + (pageSize = 0, isRefresh = false) => { + if (!groupItem.transactionsQueryJSON) { + return; + } - search({ - queryJSON: groupItem.transactionsQueryJSON, - searchKey: undefined, - offset: isRefresh ? 0 : (transactionsSnapshot?.search?.offset ?? 0) + pageSize, - shouldCalculateTotals: false, - isLoading: !!transactionsSnapshot?.search?.isLoading, - isOffline, - }); - }, [groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading, transactionsSnapshot?.search?.offset]); + search({ + queryJSON: groupItem.transactionsQueryJSON, + searchKey: undefined, + offset: isRefresh ? 0 : (transactionsSnapshot?.search?.offset ?? 0) + pageSize, + shouldCalculateTotals: false, + isLoading: !!transactionsSnapshot?.search?.isLoading, + isOffline, + }); + }, + [groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading, transactionsSnapshot?.search?.offset], + ); const animatedHighlightStyle = useAnimatedHighlightStyle({ borderRadius: variables.componentBorderRadius, From b1e10f5cd9bd27f1c8d8d654f92e87d5d60b9c50 Mon Sep 17 00:00:00 2001 From: Faizan Shoukat Abbasi Date: Sat, 14 Mar 2026 03:35:44 +0500 Subject: [PATCH 5/6] Fixed Melvin Bot feedback --- .../Search/TransactionGroupListItem.tsx | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx index a73995295f18..ee4a11ea4189 100644 --- a/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx +++ b/src/components/SelectionListWithSections/Search/TransactionGroupListItem.tsx @@ -159,9 +159,24 @@ function TransactionGroupListItem({ const shouldDisplayEmptyView = isEmpty && isExpenseReportType; const isDisabledOrEmpty = isEmpty || isDisabled; - // Search transactions - handles both refresh (offset 0) and pagination (current offset + pageSize) + const refreshTransactions = useCallback(() => { + if (!groupItem.transactionsQueryJSON) { + return; + } + + search({ + queryJSON: groupItem.transactionsQueryJSON, + searchKey: undefined, + offset: 0, + shouldCalculateTotals: false, + isLoading: !!transactionsSnapshot?.search?.isLoading, + isOffline, + }); + }, [groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading]); + + // Search transactions for pagination (current offset + pageSize) const searchTransactions = useCallback( - (pageSize = 0, isRefresh = false) => { + (pageSize = 0) => { if (!groupItem.transactionsQueryJSON) { return; } @@ -169,7 +184,7 @@ function TransactionGroupListItem({ search({ queryJSON: groupItem.transactionsQueryJSON, searchKey: undefined, - offset: isRefresh ? 0 : (transactionsSnapshot?.search?.offset ?? 0) + pageSize, + offset: (transactionsSnapshot?.search?.offset ?? 0) + pageSize, shouldCalculateTotals: false, isLoading: !!transactionsSnapshot?.search?.isLoading, isOffline, @@ -196,8 +211,8 @@ function TransactionGroupListItem({ if (!newTransactionID || !isExpanded) { return; } - searchTransactions(0, true); - }, [newTransactionID, isExpanded, searchTransactions]); + refreshTransactions(); + }, [newTransactionID, isExpanded, refreshTransactions]); const wasScreenFocusedRef = useRef(isScreenFocused); useEffect(() => { @@ -209,15 +224,15 @@ function TransactionGroupListItem({ } // Keep expanded group rows in sync with updated grouped totals after returning from RHP flows. - searchTransactions(0, true); - }, [isScreenFocused, isExpanded, isExpenseReportType, searchTransactions]); + refreshTransactions(); + }, [isScreenFocused, isExpanded, isExpenseReportType, refreshTransactions]); const handleToggle = () => { setIsExpanded((prev) => { const newExpandedState = !prev; if (newExpandedState) { - searchTransactions(0, true); + refreshTransactions(); } else { setTransactionsVisibleLimit(CONST.TRANSACTION.RESULTS_PAGE_SIZE); } From 88031cb3908303750e256a483feac80c4f1560b4 Mon Sep 17 00:00:00 2001 From: Faizan Shoukat Abbasi Date: Thu, 9 Apr 2026 00:21:21 +0500 Subject: [PATCH 6/6] removed useMemo, useCallbacks --- .../ListItem/TransactionGroupListItem.tsx | 65 ++++++++++++------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx b/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx index 6ac5e943b413..8891206910bb 100644 --- a/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx +++ b/src/components/Search/SearchList/ListItem/TransactionGroupListItem.tsx @@ -1,5 +1,5 @@ import {useIsFocused} from '@react-navigation/native'; -import React, {useCallback, useEffect, useRef, useState} from 'react'; +import React, {useEffect, useRef, useState} from 'react'; import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; // Use the original useOnyx hook to get the real-time data from Onyx and not from the snapshot @@ -157,7 +157,7 @@ function TransactionGroupListItem({ const shouldDisplayEmptyView = isEmpty && isExpenseReportType; const isDisabledOrEmpty = isEmpty || isDisabled; - const refreshTransactions = useCallback(() => { + const refreshTransactions = () => { if (!groupItem.transactionsQueryJSON) { return; } @@ -170,26 +170,23 @@ function TransactionGroupListItem({ isLoading: !!transactionsSnapshot?.search?.isLoading, isOffline, }); - }, [groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading]); + }; // Search transactions for pagination (current offset + pageSize) - const searchTransactions = useCallback( - (pageSize = 0) => { - if (!groupItem.transactionsQueryJSON) { - return; - } + const searchTransactions = (pageSize = 0) => { + if (!groupItem.transactionsQueryJSON) { + return; + } - search({ - queryJSON: groupItem.transactionsQueryJSON, - searchKey: undefined, - offset: (transactionsSnapshot?.search?.offset ?? 0) + pageSize, - shouldCalculateTotals: false, - isLoading: !!transactionsSnapshot?.search?.isLoading, - isOffline, - }); - }, - [groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading, transactionsSnapshot?.search?.offset], - ); + search({ + queryJSON: groupItem.transactionsQueryJSON, + searchKey: undefined, + offset: (transactionsSnapshot?.search?.offset ?? 0) + pageSize, + shouldCalculateTotals: false, + isLoading: !!transactionsSnapshot?.search?.isLoading, + isOffline, + }); + }; const animatedHighlightStyle = useAnimatedHighlightStyle({ borderRadius: variables.componentBorderRadius, @@ -209,8 +206,19 @@ function TransactionGroupListItem({ if (!newTransactionID || !isExpanded) { return; } - refreshTransactions(); - }, [newTransactionID, isExpanded, refreshTransactions]); + if (!groupItem.transactionsQueryJSON) { + return; + } + + search({ + queryJSON: groupItem.transactionsQueryJSON, + searchKey: undefined, + offset: 0, + shouldCalculateTotals: false, + isLoading: !!transactionsSnapshot?.search?.isLoading, + isOffline, + }); + }, [newTransactionID, isExpanded, groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading]); const wasScreenFocusedRef = useRef(isScreenFocused); useEffect(() => { @@ -222,8 +230,19 @@ function TransactionGroupListItem({ } // Keep expanded group rows in sync with updated grouped totals after returning from RHP flows. - refreshTransactions(); - }, [isScreenFocused, isExpanded, isExpenseReportType, refreshTransactions]); + if (!groupItem.transactionsQueryJSON) { + return; + } + + search({ + queryJSON: groupItem.transactionsQueryJSON, + searchKey: undefined, + offset: 0, + shouldCalculateTotals: false, + isLoading: !!transactionsSnapshot?.search?.isLoading, + isOffline, + }); + }, [isScreenFocused, isExpanded, isExpenseReportType, groupItem.transactionsQueryJSON, isOffline, transactionsSnapshot?.search?.isLoading]); const handleToggle = () => { setIsExpanded((prev) => {