[PR #6629] Update the Create Linked Account workflow to prompt for Starting Date and Balance #6639

Closed
opened 2026-02-28 21:30:58 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6629

State: closed
Merged: Yes


Summary

Adds the ability to specify a custom starting date and balance when linking new bank sync accounts in the Select Linked Accounts modal.

This addresses a recurring problem where new users set up linked accounts but the balance doesn't match because they never entered a starting balance. The "Link Bank Account" flow was originally designed for adding sync to existing accounts and never prompted for a starting balance when creating new accounts.

Changes

Frontend (SelectLinkedAccountsModal.tsx)

  • Added inline date and amount input fields in the account linking table for new accounts
  • Created shared CustomStartingSettings type to replace repeated inline type definitions
  • Extracted reusable StartingOptionsFields component supporting both 'inline' (desktop table) and 'stacked' (mobile card) layouts
  • Mobile-responsive with separate AccountCard layout using the stacked variant

Redux (accountsSlice.ts)

  • Extended link account actions (linkAccount, linkAccountSimpleFin, linkAccountPluggyAi) to accept startingDate and startingBalance parameters
  • Created shared LinkAccountBasePayload type to consolidate common fields across all three payload types

Backend (app.ts)

  • Updated account linking handlers to accept and forward custom values to sync logic
  • Created shared LinkAccountBaseParams type for the three link account functions

Sync (sync.ts)

  • Modified syncAccount to accept customStartingDate and customStartingBalance parameters
  • Modified processBankSyncDownload to use custom starting date/balance for initial sync transactions

Features

  • Only displays starting options when creating new accounts (not when linking existing accounts)
  • AmountInput with smart sign detection based on account balance (negative for credit cards/loans)
  • Sensible defaults: 90 days ago for date, 0 for balance
  • Works across all sync providers: GoCardless, SimpleFIN, and Pluggy.ai

How it works

The custom starting balance is used directly for the starting balance transaction, and the custom starting date determines both:

  1. The sync start date (how far back to fetch transactions)
  2. The transaction date for the starting balance entry

AI Disclaimer

This change was written with assistance from Claude.

Discord discussion: https://discord.com/channels/937901803608096828/1402270361625563186


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 28 14.55 MB → 14.58 MB (+23.19 kB) +0.16%
loot-core 1 5.86 MB → 5.86 MB (+891 B) +0.01%
api 1 4.39 MB → 4.39 MB (+775 B) +0.02%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
28 14.55 MB → 14.58 MB (+23.19 kB) +0.16%
Changeset
File Δ Size
src/components/modals/SelectLinkedAccountsModal.tsx 📈 +14.92 kB (+53.89%) 27.68 kB → 42.6 kB
locale/pt-BR.json 📈 +8.06 kB (+5.50%) 146.51 kB → 154.57 kB
src/accounts/accountsSlice.ts 📈 +222 B (+1.98%) 10.96 kB → 11.17 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.31 MB → 9.32 MB (+15.13 kB) +0.16%
static/js/pt-BR.js 146.51 kB → 154.57 kB (+8.06 kB) +5.50%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/da.js 106.62 kB 0%
static/js/de.js 178.39 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 164.16 kB 0%
static/js/es.js 173.83 kB 0%
static/js/fr.js 179.62 kB 0%
static/js/it.js 171.44 kB 0%
static/js/nb-NO.js 157.23 kB 0%
static/js/nl.js 106.65 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/ru.js 106.97 kB 0%
static/js/sv.js 78.2 kB 0%
static/js/th.js 182.35 kB 0%
static/js/uk.js 215.11 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.11 MB 0%
static/js/narrow.js 640.46 kB 0%
static/js/TransactionList.js 105.97 kB 0%
static/js/wide.js 160.07 kB 0%
static/js/AppliedFilters.js 9.71 kB 0%
static/js/usePayeeRuleCounts.js 11.79 kB 0%
static/js/useTransactionBatchActions.js 13.23 kB 0%
static/js/FormulaEditor.js 1.04 MB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.86 MB → 5.86 MB (+891 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts 📈 +518 B (+2.06%) 24.58 kB → 25.09 kB
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts 📈 +373 B (+1.40%) 25.98 kB → 26.34 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.CahdYISk.js 0 B → 5.86 MB (+5.86 MB) -

Removed

Asset File Size % Changed
kcab.worker.CiaHZEop.js 5.86 MB → 0 B (-5.86 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.39 MB → 4.39 MB (+775 B) +0.02%
Changeset
File Δ Size
src/server/accounts/sync.ts 📈 +458 B (+2.04%) 21.94 kB → 22.39 kB
src/server/accounts/app.ts 📈 +317 B (+1.40%) 22.16 kB → 22.47 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
bundle.api.js 4.39 MB → 4.39 MB (+775 B) +0.02%

Smaller
No assets were smaller

Unchanged
No assets were unchanged

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6629 **State:** closed **Merged:** Yes --- ## Summary Adds the ability to specify a custom starting date and balance when linking new bank sync accounts in the Select Linked Accounts modal. This addresses a recurring problem where new users set up linked accounts but the balance doesn't match because they never entered a starting balance. The "Link Bank Account" flow was originally designed for adding sync to existing accounts and never prompted for a starting balance when creating new accounts. ## Changes ### Frontend ([SelectLinkedAccountsModal.tsx](packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.tsx)) - Added inline date and amount input fields in the account linking table for new accounts - Created shared `CustomStartingSettings` type to replace repeated inline type definitions - Extracted reusable `StartingOptionsFields` component supporting both `'inline'` (desktop table) and `'stacked'` (mobile card) layouts - Mobile-responsive with separate `AccountCard` layout using the stacked variant ### Redux ([accountsSlice.ts](packages/desktop-client/src/accounts/accountsSlice.ts)) - Extended link account actions (`linkAccount`, `linkAccountSimpleFin`, `linkAccountPluggyAi`) to accept `startingDate` and `startingBalance` parameters - Created shared `LinkAccountBasePayload` type to consolidate common fields across all three payload types ### Backend ([app.ts](packages/loot-core/src/server/accounts/app.ts)) - Updated account linking handlers to accept and forward custom values to sync logic - Created shared `LinkAccountBaseParams` type for the three link account functions ### Sync ([sync.ts](packages/loot-core/src/server/accounts/sync.ts)) - Modified `syncAccount` to accept `customStartingDate` and `customStartingBalance` parameters - Modified `processBankSyncDownload` to use custom starting date/balance for initial sync transactions ## Features - Only displays starting options when creating **new** accounts (not when linking existing accounts) - `AmountInput` with smart sign detection based on account balance (negative for credit cards/loans) - Sensible defaults: 90 days ago for date, 0 for balance - Works across all sync providers: GoCardless, SimpleFIN, and Pluggy.ai ## How it works The custom starting balance is used directly for the starting balance transaction, and the custom starting date determines both: 1. The sync start date (how far back to fetch transactions) 2. The transaction date for the starting balance entry ## AI Disclaimer This change was written with assistance from Claude. ## Related Discord discussion: https://discord.com/channels/937901803608096828/1402270361625563186 <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 28 | 14.55 MB → 14.58 MB (+23.19 kB) | +0.16% loot-core | 1 | 5.86 MB → 5.86 MB (+891 B) | +0.01% api | 1 | 4.39 MB → 4.39 MB (+775 B) | +0.02% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 28 | 14.55 MB → 14.58 MB (+23.19 kB) | +0.16% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/modals/SelectLinkedAccountsModal.tsx` | 📈 +14.92 kB (+53.89%) | 27.68 kB → 42.6 kB `locale/pt-BR.json` | 📈 +8.06 kB (+5.50%) | 146.51 kB → 154.57 kB `src/accounts/accountsSlice.ts` | 📈 +222 B (+1.98%) | 10.96 kB → 11.17 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 9.31 MB → 9.32 MB (+15.13 kB) | +0.16% static/js/pt-BR.js | 146.51 kB → 154.57 kB (+8.06 kB) | +5.50% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/indexeddb-main-thread-worker-e59fee74.js | 12.94 kB | 0% static/js/workbox-window.prod.es5.js | 5.64 kB | 0% static/js/da.js | 106.62 kB | 0% static/js/de.js | 178.39 kB | 0% static/js/en-GB.js | 7.18 kB | 0% static/js/en.js | 164.16 kB | 0% static/js/es.js | 173.83 kB | 0% static/js/fr.js | 179.62 kB | 0% static/js/it.js | 171.44 kB | 0% static/js/nb-NO.js | 157.23 kB | 0% static/js/nl.js | 106.65 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/ru.js | 106.97 kB | 0% static/js/sv.js | 78.2 kB | 0% static/js/th.js | 182.35 kB | 0% static/js/uk.js | 215.11 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.11 MB | 0% static/js/narrow.js | 640.46 kB | 0% static/js/TransactionList.js | 105.97 kB | 0% static/js/wide.js | 160.07 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 11.79 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.86 MB → 5.86 MB (+891 B) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/sync.ts` | 📈 +518 B (+2.06%) | 24.58 kB → 25.09 kB `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts` | 📈 +373 B (+1.40%) | 25.98 kB → 26.34 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CahdYISk.js | 0 B → 5.86 MB (+5.86 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CiaHZEop.js | 5.86 MB → 0 B (-5.86 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.39 MB → 4.39 MB (+775 B) | +0.02% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/server/accounts/sync.ts` | 📈 +458 B (+2.04%) | 21.94 kB → 22.39 kB `src/server/accounts/app.ts` | 📈 +317 B (+1.40%) | 22.16 kB → 22.47 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.39 MB → 4.39 MB (+775 B) | +0.02% **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end --->
GiteaMirror added the pull-request label 2026-02-28 21:30:58 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6639