Skip to content

A local-first personal finance app

add bank sync provider setup to the mobile Bank Sync page (#8497)

Matt Fiddamane029793b68f9
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-1-chromium-linux.png
index f5d1753e80..97aa140709 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-2-chromium-linux.png
index c01c0296ec..f1ac2a11d7 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-3-chromium-linux.png
index 7cf4902081..606f98a5fd 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-checks-the-page-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-1-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-1-chromium-linux.png
index 9e602fe6d7..95d63fbbc3 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-1-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-2-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-2-chromium-linux.png
index 447fadbed8..ab34c8eb3e 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-2-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-3-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-3-chromium-linux.png
index d585e32480..fb4024121c 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-3-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-page-handles-empty-state-gracefully-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-1-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-1-chromium-linux.png
index db79f077f6..840ecd2915 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-1-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-2-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-2-chromium-linux.png
index afed899438..1bcf7fe7b2 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-2-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-3-chromium-linux.png b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-3-chromium-linux.png
index e055c944b1..28236f1646 100644
Binary files a/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-3-chromium-linux.png and b/packages/desktop-client/e2e/bank-sync.mobile.test.ts-snapshots/Mobile-Bank-Sync-searches-for-accounts-3-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/banksync/BuiltInProviders.tsx b/packages/desktop-client/src/components/banksync/BuiltInProviders.tsx
index b570367ddb..733d0394ba 100644
--- a/packages/desktop-client/src/components/banksync/BuiltInProviders.tsx
+++ b/packages/desktop-client/src/components/banksync/BuiltInProviders.tsx
@@ -2,7 +2,11 @@ import { Dialog, DialogTrigger } from 'react-aria-components';
import { Trans, useTranslation } from 'react-i18next';
import { Button, ButtonWithLoading } from '@actual-app/components/button';
-import { SvgDotsHorizontalTriple } from '@actual-app/components/icons/v1';
+import {
+ SvgCheveronDown,
+ SvgCheveronRight,
+ SvgDotsHorizontalTriple,
+} from '@actual-app/components/icons/v1';
import { Menu } from '@actual-app/components/menu';
import { Paragraph } from '@actual-app/components/paragraph';
import { Popover } from '@actual-app/components/popover';
@@ -20,6 +24,8 @@ type BuiltInProvidersProps = {
syncServerStatus: 'offline' | 'no-server' | 'online';
showPermissionWarning: boolean;
providersNeedingConfiguration: BuiltInBankSyncProviderState[];
+ isCollapsed?: boolean;
+ onToggleCollapse?: () => void;
};
export function BuiltInProviders({
@@ -27,15 +33,48 @@ export function BuiltInProviders({
syncServerStatus,
showPermissionWarning,
providersNeedingConfiguration,
+ isCollapsed = false,
+ onToggleCollapse,
}: BuiltInProvidersProps) {
const { t } = useTranslation();
+ const Cheveron = isCollapsed ? SvgCheveronRight : SvgCheveronDown;
+ const title = (
+ <Text style={{ fontSize: 20, fontWeight: 600 }}>
+ <Trans>Providers</Trans>
+ </Text>
+ );
+
+ if (onToggleCollapse && isCollapsed) {
+ return (
+ <Button
+ variant="bare"
+ aria-expanded={false}
+ onPress={onToggleCollapse}
+ style={{ alignSelf: 'flex-start' }}
+ >
+ {title}
+ <Cheveron width={20} height={20} style={{ marginLeft: 5 }} />
+ </Button>
+ );
+ }
+
return (
<View style={{ gap: 12 }}>
<View style={{ gap: 4 }}>
- <Text style={{ fontSize: 20, fontWeight: 600 }}>
- <Trans>Providers</Trans>
- </Text>
+ {onToggleCollapse ? (
+ <Button
+ variant="bare"
+ aria-expanded
+ onPress={onToggleCollapse}
+ style={{ alignSelf: 'flex-start' }}
+ >
+ {title}
+ <Cheveron width={20} height={20} style={{ marginLeft: 5 }} />
+ </Button>
+ ) : (
+ title
+ )}
<Paragraph style={{ fontSize: 15, color: theme.pageTextSubdued }}>
<Trans>
Set up a bank sync provider, then link new accounts or connect an
diff --git a/packages/desktop-client/src/components/banksync/index.tsx b/packages/desktop-client/src/components/banksync/index.tsx
index eee8a28559..cd51693608 100644
--- a/packages/desktop-client/src/components/banksync/index.tsx
+++ b/packages/desktop-client/src/components/banksync/index.tsx
@@ -108,7 +108,10 @@ export function BankSync() {
{openAccounts.length === 0 && (
<Text style={{ fontSize: '1.1rem' }}>
<Trans>
- To use the bank syncing features, you must first add an account.
+ No accounts yet. Once a provider is set up, use{' '}
+ <strong>Link bank account</strong> to connect your bank and create
+ your accounts automatically. You can also add accounts manually
+ and connect them here later.
</Trans>
</Text>
)}
diff --git a/packages/desktop-client/src/components/mobile/banksync/MobileBankSyncPage.tsx b/packages/desktop-client/src/components/mobile/banksync/MobileBankSyncPage.tsx
index 7884116c83..66a48329b1 100644
--- a/packages/desktop-client/src/components/mobile/banksync/MobileBankSyncPage.tsx
+++ b/packages/desktop-client/src/components/mobile/banksync/MobileBankSyncPage.tsx
@@ -13,9 +13,12 @@ import {
groupBankSyncAccounts,
} from '#components/banksync/bankSyncUtils';
import type { GroupedBankSyncAccounts } from '#components/banksync/bankSyncUtils';
+import { BuiltInProviders } from '#components/banksync/BuiltInProviders';
+import { useBuiltInBankSyncProviders } from '#components/banksync/useBuiltInBankSyncProviders';
import { Search } from '#components/common/Search';
import { MobilePageHeader, Page } from '#components/Page';
import { useAccounts } from '#hooks/useAccounts';
+import { useLocalPref } from '#hooks/useLocalPref';
import { useNavigate } from '#hooks/useNavigate';
import { pushModal } from '#modals/modalsSlice';
import { useDispatch } from '#redux';
@@ -28,7 +31,16 @@ export function MobileBankSyncPage() {
const dispatch = useDispatch();
const { data: accounts = [] } = useAccounts();
const [filter, setFilter] = useState('');
+ const [providersCollapsed = true, setProvidersCollapsed] = useLocalPref(
+ 'mobile.bankSyncProvidersCollapsed',
+ );
const syncSourceReadable = useMemo(() => getSyncSourceReadable(t), [t]);
+ const {
+ providers,
+ syncServerStatus,
+ showPermissionWarning,
+ providersNeedingConfiguration,
+ } = useBuiltInBankSyncProviders();
const openAccounts = useMemo(
() => accounts.filter(a => !a.closed),
@@ -91,30 +103,43 @@ export function MobileBankSyncPage() {
return (
<Page header={<MobilePageHeader title={t('Bank Sync')} />} padding={0}>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- backgroundColor: theme.mobilePageBackground,
- padding: 10,
- width: '100%',
- borderBottomWidth: 2,
- borderBottomStyle: 'solid',
- borderBottomColor: theme.tableBorder,
- }}
- >
- <Search
- placeholder={t('Filter accounts…')}
- value={filter}
- onChange={onSearchChange}
- width="100%"
- height={styles.mobileMinHeight}
- style={{
- backgroundColor: theme.tableBackground,
- borderColor: theme.formInputBorder,
- }}
+ <View style={{ padding: 15, flexShrink: 0 }}>
+ <BuiltInProviders
+ providers={providers}
+ syncServerStatus={syncServerStatus}
+ showPermissionWarning={showPermissionWarning}
+ providersNeedingConfiguration={providersNeedingConfiguration}
+ isCollapsed={providersCollapsed}
+ onToggleCollapse={() => setProvidersCollapsed(!providersCollapsed)}
/>
</View>
+ {openAccounts.length > 0 && (
+ <View
+ style={{
+ flexShrink: 0,
+ flexDirection: 'row',
+ alignItems: 'center',
+ backgroundColor: theme.mobilePageBackground,
+ padding: 10,
+ width: '100%',
+ borderBottomWidth: 2,
+ borderBottomStyle: 'solid',
+ borderBottomColor: theme.tableBorder,
+ }}
+ >
+ <Search
+ placeholder={t('Filter accounts…')}
+ value={filter}
+ onChange={onSearchChange}
+ width="100%"
+ height={styles.mobileMinHeight}
+ style={{
+ backgroundColor: theme.tableBackground,
+ borderColor: theme.formInputBorder,
+ }}
+ />
+ </View>
+ )}
{openAccounts.length === 0 ? (
<View
@@ -134,7 +159,9 @@ export function MobileBankSyncPage() {
}}
>
<Trans>
- To use the bank syncing features, you must first add an account.
+ Linked accounts will appear here. Use a provider above to link
+ your bank, or create an account from the Accounts tab and connect
+ it here later.
</Trans>
</Text>
</View>
diff --git a/packages/loot-core/src/types/prefs.ts b/packages/loot-core/src/types/prefs.ts
index 9b016a2f93..d0423c0f54 100644
--- a/packages/loot-core/src/types/prefs.ts
+++ b/packages/loot-core/src/types/prefs.ts
@@ -96,6 +96,7 @@ export type LocalPrefs = Partial<{
reportsViewLabel: boolean;
sidebarWidth: number;
'mobile.showSpentColumn': boolean;
+ 'mobile.bankSyncProvidersCollapsed': boolean;
}>;
export type Theme = 'light' | 'dark' | 'auto' | 'midnight' | string;
diff --git a/upcoming-release-notes/mobile-bank-sync-setup.md b/upcoming-release-notes/mobile-bank-sync-setup.md
new file mode 100644
index 0000000000..e5e2af43ff
--- /dev/null
+++ b/upcoming-release-notes/mobile-bank-sync-setup.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [matt-fidd]
+---
+
+Allow setting up bank sync providers and linking accounts from the mobile Bank Sync page