Skip to content

A local-first personal finance app

Virtualize mobile payees list (#5904)

Matiss Janis Aboltinsadae3e4352ce
diff --git a/packages/desktop-client/src/components/mobile/payees/PayeesList.tsx b/packages/desktop-client/src/components/mobile/payees/PayeesList.tsx
index 9c59b5a83d..14ebe68d78 100644
--- a/packages/desktop-client/src/components/mobile/payees/PayeesList.tsx
+++ b/packages/desktop-client/src/components/mobile/payees/PayeesList.tsx
@@ -1,4 +1,4 @@
-import { GridList } from 'react-aria-components';
+import { GridList, Virtualizer, ListLayout } from 'react-aria-components';
import { Trans, useTranslation } from 'react-i18next';
import { AnimatedLoading } from '@actual-app/components/icons/AnimatedLoading';
@@ -71,27 +71,29 @@ export function PayeesList({
return (
<View style={{ flex: 1 }}>
- <GridList
- aria-label={t('Payees')}
- aria-busy={isLoading || undefined}
- items={payees}
- style={{
- flex: 1,
- paddingBottom: MOBILE_NAV_HEIGHT,
- overflow: 'auto',
- }}
- dependencies={[ruleCounts, isRuleCountsLoading]}
- >
- {payee => (
- <PayeesListItem
- value={payee}
- ruleCount={ruleCounts.get(payee.id) ?? 0}
- isRuleCountLoading={isRuleCountsLoading}
- onAction={() => onPayeePress(payee)}
- onDelete={() => onPayeeDelete(payee)}
- />
- )}
- </GridList>
+ <Virtualizer layout={ListLayout}>
+ <GridList
+ aria-label={t('Payees')}
+ aria-busy={isLoading || undefined}
+ items={payees}
+ style={{
+ flex: 1,
+ paddingBottom: MOBILE_NAV_HEIGHT,
+ overflow: 'auto',
+ }}
+ dependencies={[ruleCounts, isRuleCountsLoading]}
+ >
+ {payee => (
+ <PayeesListItem
+ value={payee}
+ ruleCount={ruleCounts.get(payee.id) ?? 0}
+ isRuleCountLoading={isRuleCountsLoading}
+ onAction={() => onPayeePress(payee)}
+ onDelete={() => onPayeeDelete(payee)}
+ />
+ )}
+ </GridList>
+ </Virtualizer>
{isLoading && (
<View
style={{
diff --git a/upcoming-release-notes/5904.md b/upcoming-release-notes/5904.md
new file mode 100644
index 0000000000..1aba6e568c
--- /dev/null
+++ b/upcoming-release-notes/5904.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [MatissJanis]
+---
+
+Mobile payees: add list virtualization