Skip to content

Commit

Permalink
Add small fixes to search
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicu committed Jun 17, 2024
1 parent f50473d commit 5f1a9be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const sortableSearchTabs: SearchQuery[] = [CONST.TAB_SEARCH.ALL];
const transactionItemMobileHeight = 100;
const reportItemTransactionHeight = 52;
const listItemPadding = 12; // this is equivalent to 'mb3' on every transaction/report list item
const searchHeaderHeight = 54;

function isTransactionListItemType(item: TransactionListItemType | ReportListItemType): item is TransactionListItemType {
const transactionListItem = item as TransactionListItemType;
Expand Down Expand Up @@ -162,7 +163,7 @@ function Search({query, policyIDs, sortBy, sortOrder}: SearchProps) {
shouldShowYear={shouldShowYear}
/>
}
customListHeaderHeight={54}
customListHeaderHeight={searchHeaderHeight}
// To enhance the smoothness of scrolling and minimize the risk of encountering blank spaces during scrolling,
// we have configured a larger windowSize and a longer delay between batch renders.
// The windowSize determines the number of items rendered before and after the currently visible items.
Expand Down
2 changes: 1 addition & 1 deletion src/libs/SearchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function getReportSections(data: OnyxTypes.SearchResults['data']): ReportListIte
}
}

return Object.values(reportIDToTransactions);
return Object.values(reportIDToTransactions).filter((item) => item.transactions?.length !== 0);
}

const searchTypeToItemMap: SearchTypeToItemMap = {
Expand Down

0 comments on commit 5f1a9be

Please sign in to comment.