Skip to content

A local-first personal finance app

Re-design mobile accounts page to better match the transactions and budget tables/list + add all accounts page (#5610)

Joel Jeremy Marquez34b6599da38f
diff --git a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png
index cec72713ea..ebbccbeddd 100644
Binary files a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png and b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png
index 2c40570f8f..ecc8281da9 100644
Binary files a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png and b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-3-chromium-linux.png b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-3-chromium-linux.png
index b5dade6693..0d62a337f0 100644
Binary files a/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-3-chromium-linux.png and b/packages/desktop-client/e2e/accounts.mobile.test.ts-snapshots/Mobile-Accounts-opens-the-accounts-page-and-asserts-on-balances-3-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/mobile/accounts/AccountsPage.tsx b/packages/desktop-client/src/components/mobile/accounts/AccountsPage.tsx
index 916d622882..a731702255 100644
--- a/packages/desktop-client/src/components/mobile/accounts/AccountsPage.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/AccountsPage.tsx
@@ -49,6 +49,8 @@ import { useDispatch, useSelector } from '@desktop-client/redux';
import { type Binding, type SheetFields } from '@desktop-client/spreadsheet';
import * as bindings from '@desktop-client/spreadsheet/bindings';
+const ROW_HEIGHT = 60;
+
type AccountHeaderProps<SheetFieldName extends SheetFields<'account'>> = {
id: string;
name: string;
@@ -77,14 +79,10 @@ function AccountHeader<SheetFieldName extends SheetFields<'account'>>({
aria-label={t('View {{name}} transactions', { name })}
onPress={onPress ? onPress : () => navigate(`/accounts/${id}`)}
style={{
- flex: 1,
- flexDirection: 'row',
- paddingTop: 15,
- paddingBottom: 15,
- paddingLeft: 0,
- paddingRight: 0,
- color: theme.pageTextLight,
+ height: ROW_HEIGHT,
width: '100%',
+ padding: '0 18px',
+ color: theme.pageTextLight,
...style,
}}
// to match the feel of the other account buttons
@@ -163,11 +161,11 @@ function AccountListItem({
<Button
{...itemProps}
style={{
+ height: ROW_HEIGHT,
width: '100%',
- border: `1px solid ${theme.pillBorder}`,
- borderRadius: 6,
- boxShadow: `0 1px 1px ${theme.mobileAccountShadow}`,
- marginTop: 10,
+ backgroundColor: theme.tableBackground,
+ border: `1px solid ${theme.tableBorder}`,
+ paddingLeft: 20,
}}
data-testid="account-list-item"
onPress={() => onSelect(account)}
@@ -175,48 +173,41 @@ function AccountListItem({
<View
style={{
flex: 1,
- margin: '10px 0',
+ alignItems: 'center',
+ flexDirection: 'row',
}}
>
- <View
+ {
+ /* TODO: Should bankId be part of the AccountEntity type? */
+ 'bankId' in account && account.bankId ? (
+ <View
+ style={{
+ backgroundColor: isPending
+ ? theme.sidebarItemBackgroundPending
+ : isFailed
+ ? theme.sidebarItemBackgroundFailed
+ : theme.sidebarItemBackgroundPositive,
+ marginRight: '8px',
+ width: 8,
+ flexShrink: 0,
+ height: 8,
+ borderRadius: 8,
+ opacity: isConnected ? 1 : 0,
+ }}
+ />
+ ) : null
+ }
+ <TextOneLine
style={{
- flexDirection: 'row',
- alignItems: 'center',
+ ...styles.text,
+ fontSize: 17,
+ fontWeight: 600,
+ color: isUpdated ? theme.mobileAccountText : theme.pillText,
}}
+ data-testid="account-name"
>
- {
- /* TODO: Should bankId be part of the AccountEntity type? */
- 'bankId' in account && account.bankId ? (
- <View
- style={{
- backgroundColor: isPending
- ? theme.sidebarItemBackgroundPending
- : isFailed
- ? theme.sidebarItemBackgroundFailed
- : theme.sidebarItemBackgroundPositive,
- marginRight: '8px',
- width: 8,
- flexShrink: 0,
- height: 8,
- borderRadius: 8,
- opacity: isConnected ? 1 : 0,
- }}
- />
- ) : null
- }
- <TextOneLine
- style={{
- ...styles.text,
- fontSize: 17,
- fontWeight: 600,
- color: isUpdated ? theme.mobileAccountText : theme.pillText,
- paddingRight: 30,
- }}
- data-testid="account-name"
- >
- {account.name}
- </TextOneLine>
- </View>
+ {account.name}
+ </TextOneLine>
</View>
<CellValue binding={getBalanceQuery(account.id)} type="financial">
{props => (
@@ -255,6 +246,7 @@ type AllAccountListProps = {
getAccountBalance: (
accountId: AccountEntity['id'],
) => Binding<'account', 'balance'>;
+ getAllAccountsBalance: () => Binding<'account', 'accounts-balance'>;
getOnBudgetBalance: () => Binding<'account', 'onbudget-accounts-balance'>;
getOffBudgetBalance: () => Binding<'account', 'offbudget-accounts-balance'>;
getClosedAccountsBalance: () => Binding<'account', 'closed-accounts-balance'>;
@@ -266,6 +258,7 @@ type AllAccountListProps = {
function AllAccountList({
accounts,
getAccountBalance,
+ getAllAccountsBalance,
getOnBudgetBalance,
getOffBudgetBalance,
getClosedAccountsBalance,
@@ -324,8 +317,13 @@ function AllAccountList({
<PullToRefresh onRefresh={onSync}>
<View
aria-label={t('Account list')}
- style={{ margin: 10, paddingBottom: MOBILE_NAV_HEIGHT }}
+ style={{ paddingBottom: MOBILE_NAV_HEIGHT }}
>
+ <AccountHeader
+ id="all"
+ name={t('All accounts')}
+ amount={getAllAccountsBalance()}
+ />
{onBudgetAccounts.length > 0 && (
<AccountHeader
id="onbudget"
@@ -344,7 +342,6 @@ function AllAccountList({
id="offbudget"
name={t('Off budget')}
amount={getOffBudgetBalance()}
- style={{ marginTop: 30 }}
/>
)}
<AccountList
@@ -473,6 +470,7 @@ const AccountList = forwardRef<HTMLDivElement, AccountListProps>(
items={accounts}
dragAndDropHooks={dragAndDropHooks}
ref={ref}
+ style={{ display: 'flex', flexDirection: 'column', margin: '0 8px' }}
>
{account => (
<AccountListItem
@@ -526,6 +524,7 @@ export function AccountsPage() {
key={numberFormat + hideFraction}
accounts={accounts}
getAccountBalance={bindings.accountBalance}
+ getAllAccountsBalance={bindings.allAccountBalance}
getOnBudgetBalance={bindings.onBudgetAccountBalance}
getOffBudgetBalance={bindings.offBudgetAccountBalance}
getClosedAccountsBalance={bindings.closedAccountBalance}
diff --git a/upcoming-release-notes/5610.md b/upcoming-release-notes/5610.md
new file mode 100644
index 0000000000..30f6be7682
--- /dev/null
+++ b/upcoming-release-notes/5610.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [joel-jeremy]
+---
+
+Re-design mobile accounts page to better match the transactions and budget tables/list + add all accounts page