+
changeFilters({ account })}
+ label="Analytics account" className="w-full min-[430px]:w-52" />
{(Object.keys(periodLabels) as TimePeriod[]).map((p) => (
No transactions for {period === 'allTime' ? 'all time' : periodDisplayLabel.toLowerCase()}
- Add some transactions to see analytics
+ {accountFilter === 'all' ? Add some transactions to see analytics
+ : <>This account has no activity in the selected period.
+ >}
@@ -1093,6 +1105,7 @@ export function Analytics({
{show('ai-financial-forecast') && (
+ {accountFilter !== 'all' && The saved forecast covers all accounts.
}
diff --git a/client/src/components/common/AccountFilterSelect.tsx b/client/src/components/common/AccountFilterSelect.tsx
new file mode 100644
index 00000000..f75f4f3c
--- /dev/null
+++ b/client/src/components/common/AccountFilterSelect.tsx
@@ -0,0 +1,33 @@
+import { Select } from './select'
+
+type AccountOption = {
+ id: string
+ name: string
+ currency: string
+ type: string
+ archived_at?: number | null
+}
+
+export function AccountFilterSelect({ accounts, value, onChange, label, className, selectClassName }: {
+ accounts: AccountOption[]
+ value: string
+ onChange: (value: string) => void
+ label: string
+ className?: string
+ selectClassName?: string
+}) {
+ const cashAccounts = accounts.filter(account => account.type === 'cash')
+ .sort((a, b) => Number(a.archived_at != null) - Number(b.archived_at != null) || a.name.localeCompare(b.name))
+
+ return
+
+
+}
diff --git a/client/src/components/dashboard-module/TransactionCalendar.tsx b/client/src/components/dashboard-module/TransactionCalendar.tsx
index 86dd6490..56c92fad 100644
--- a/client/src/components/dashboard-module/TransactionCalendar.tsx
+++ b/client/src/components/dashboard-module/TransactionCalendar.tsx
@@ -26,6 +26,8 @@ const dateKey = (date: Date) => format(date, 'yyyy-MM-dd')
export function TransactionCalendar({
transactions,
+ linkedTransactions = transactions,
+ accountFiltered = false,
accounts,
currentMonth,
privacyMode,
@@ -38,6 +40,8 @@ export function TransactionCalendar({
sortOrder,
}: {
transactions: Transaction[]
+ linkedTransactions?: Transaction[]
+ accountFiltered?: boolean
accounts: Account[]
currentMonth: Date
privacyMode: 'visible' | 'hidden'
@@ -58,7 +62,7 @@ export function TransactionCalendar({
const displayTransactions = useMemo(() => {
const all = transactions
- const byId = new Map(all.map(tx => [tx.id, tx]))
+ const byId = new Map(linkedTransactions.map(tx => [tx.id, tx]))
const consumedIds = new Set
()
return all.flatMap(tx => {
@@ -75,13 +79,13 @@ export function TransactionCalendar({
return [tx]
}
- const primary = tx.amount < 0 ? tx : related.amount < 0 ? related : tx.amount <= related.amount ? tx : related
+ const primary = accountFiltered ? tx : tx.amount < 0 ? tx : related.amount < 0 ? related : tx.amount <= related.amount ? tx : related
const secondary = primary.id === tx.id ? related : tx
consumedIds.add(primary.id)
consumedIds.add(secondary.id)
return [{ ...primary, relatedTx: secondary }]
})
- }, [transactions])
+ }, [transactions, linkedTransactions, accountFiltered])
const transactionsByDay = useMemo(() => displayTransactions.reduce>((days, tx) => {
const key = tx.date.slice(0, 10)
@@ -171,7 +175,7 @@ export function TransactionCalendar({
-
+ {!accountFiltered &&
BALANCE TREND
{baseline === null ?
Balance trend unavailable: missing exchange rates.
:
@@ -220,7 +224,7 @@ export function TransactionCalendar({
}
-
+
}
{['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'].map(day =>
{day}
)}
@@ -280,7 +284,7 @@ export function TransactionCalendar({
{selectedTransactions.length ? selectedTransactions.map(tx => {
const transfer = !!tx.linked_transaction_id
- const label = transfer ? `Transfer to ${tx.relatedTx ? getAccountName(tx.relatedTx.account_id) : 'account'}` : (tx.description || getCategoryName(tx.category_id))
+ const label = transfer ? `Transfer ${tx.amount < 0 || !accountFiltered ? 'to' : 'from'} ${tx.relatedTx ? getAccountName(tx.relatedTx.account_id) : 'account'}` : (tx.description || getCategoryName(tx.category_id))
return
= 0 ? 'bg-success/10' : 'bg-secondary'}`}>{transfer ?
: getCategoryIcon(tx.category_id)}
{label}
{getAccountName(tx.account_id)} · {transfer ? 'Transfer' : getCategoryName(tx.category_id)}
diff --git a/client/src/components/dashboard-module/TransactionList.test.tsx b/client/src/components/dashboard-module/TransactionList.test.tsx
index 89b00eea..8da7f106 100644
--- a/client/src/components/dashboard-module/TransactionList.test.tsx
+++ b/client/src/components/dashboard-module/TransactionList.test.tsx
@@ -120,6 +120,28 @@ function mockRates(rate = 0.2) {
}
describe('TransactionList redesigned transfers', () => {
+ it('filters the list and calendar by receiving account without losing the transfer pair', async () => {
+ const user = userEvent.setup()
+ renderTransfers({ transactions: [...postedTransfer,
+ { id: 'other-expense', account_id: 'other', amount: -50, date: '2020-01-01', description: 'Other expense' },
+ ] })
+ const filter = screen.getByRole('combobox', { name: 'Transaction account' })
+ expect(within(filter).getByRole('option', { name: 'Archived cash (HUF) · Archived' })).toBeInTheDocument()
+ await user.selectOptions(filter, 'destination')
+ expect(screen.queryByText('Other expense')).not.toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'Edit transfer' })).toBeInTheDocument()
+ expect(screen.getByText('1 posted')).toBeInTheDocument()
+
+ await user.click(screen.getByRole('button', { name: 'Calendar', exact: true }))
+ expect(screen.getByText('Transfer from Savings')).toBeInTheDocument()
+ expect(screen.queryByText('Other expense')).not.toBeInTheDocument()
+
+ await user.selectOptions(filter, 'archived')
+ await user.click(screen.getByRole('button', { name: 'Show all accounts' }))
+ expect(filter).toHaveValue('all')
+ expect(screen.getByText('Other expense')).toBeInTheDocument()
+ })
+
it('previews posted edit deltas, preserves both native amounts when swapping, and reverts the full edit', async () => {
mockRates()
const user = userEvent.setup()
diff --git a/client/src/components/dashboard-module/TransactionList.tsx b/client/src/components/dashboard-module/TransactionList.tsx
index 89b219cc..8d5f6d31 100644
--- a/client/src/components/dashboard-module/TransactionList.tsx
+++ b/client/src/components/dashboard-module/TransactionList.tsx
@@ -6,10 +6,11 @@ import type { HoldingFields } from '../../../../shared/holding'
import type { DashboardFilters, FilterChange } from '../../navigation/filters'
import { useUnsavedChanges } from '../../navigation/UnsavedChanges'
import { matchesTransaction } from '../../lib/global-search'
-import { useState, useEffect, useRef } from 'react'
+import { useCallback, useState, useEffect, useRef } from 'react'
import { Button } from '../common/button'
import { Input } from '../common/input'
import { Label } from '../common/label'
+import { AccountFilterSelect } from '../common/AccountFilterSelect'
import { Select } from '../common/select'
import { Card, CardContent, CardHeader, CardTitle } from '../common/card'
import { Modal } from '../common/modal'
@@ -73,6 +74,8 @@ type Account = HoldingFields & {
is_locked?: boolean
}
+type TransactionFilters = Pick
& { search: string }
+
type Category = {
id: string
name: string
@@ -172,7 +175,16 @@ export function TransactionList({
const [fetchedCategories, setCategories] = useState([])
const categories = availableCategories ?? fetchedCategories
const [upcomingOpen, setUpcomingOpen] = useState(false)
- const [filtersOpen, setFiltersOpen] = useState(false)
+ const [filterDraft, setFilterDraft] = useState(null)
+ const filtersOpen = filterDraft !== null
+ const closeFilters = useCallback(() => setFilterDraft(null), [])
+ useEffect(() => {
+ if (!filtersOpen) return
+ const desktop = window.matchMedia('(min-width: 640px)')
+ const handleChange = () => { if (desktop.matches) closeFilters() }
+ desktop.addEventListener('change', handleChange)
+ return () => desktop.removeEventListener('change', handleChange)
+ }, [filtersOpen, closeFilters])
const [activeTxId, setActiveTxId] = useState(null)
const [pendingDetails, setPendingDetails] = useState(null)
const [legacyTradeId,setLegacyTradeId]=useState(null)
@@ -205,12 +217,14 @@ export function TransactionList({
manual_price: false,
})
const editedTransferPairRef = useRef(null)
+ const [localAccountFilter, setLocalAccountFilter] = useState('all')
+ const accountFilter = filters?.account ?? localAccountFilter
+ const setAccountFilter = (account: string) => onFiltersChange ? onFiltersChange({ account }) : setLocalAccountFilter(account)
+ const matchesAccount = (tx: Transaction) => accountFilter === 'all' || tx.account_id === accountFilter
const [localCategoryFilter, setCategoryFilterLocal] = useState('all')
const categoryFilter = filters?.category ?? localCategoryFilter
- const setCategoryFilter = (value: string) => onFiltersChange ? onFiltersChange({ category: value }) : setCategoryFilterLocal(value)
const [localSortOrder, setSortOrderLocal] = useState<'date' | 'amount-high' | 'amount-low'>('date')
const sortOrder = filters?.sort ?? localSortOrder
- const setSortOrder = (value: 'date' | 'amount-high' | 'amount-low') => onFiltersChange ? onFiltersChange({ sort: value }) : setSortOrderLocal(value)
const [showAllTransactions, setShowAllTransactions] = useState(false)
const [localTransactionView, setTransactionViewLocal] = useState<'list' | 'calendar'>('list')
const transactionView = filters?.view ?? localTransactionView
@@ -256,7 +270,7 @@ export function TransactionList({
// Reset showAllTransactions when filter, sort, search, or date range changes
useEffect(() => {
setShowAllTransactions(false)
- }, [categoryFilter, sortOrder, searchQuery, dateRange])
+ }, [accountFilter, categoryFilter, sortOrder, searchQuery, dateRange])
useEffect(() => {
onCalendarViewChange?.(transactionView === 'calendar')
@@ -1254,7 +1268,7 @@ export function TransactionList({
: categoryFilter === 'all-income' ? (tx.amount > 0 && !tx.linked_transaction_id)
: categoryFilter === 'transfer' ? !!tx.linked_transaction_id
: tx.category_id === categoryFilter
- return catMatch && matchesSearch(tx)
+ return matchesAccount(tx) && catMatch && matchesSearch(tx)
}
const visibleUpcomingTransactions = upcomingTransactions.filter(tx => !resolvedPendingIds.has(tx.id))
@@ -1270,7 +1284,7 @@ export function TransactionList({
return [{ ...group[0], id: `split:${tx.split_id}`, description: tx.split_description, amount: group.reduce((sum, line) => sum + line.amount, 0), splitGroup: group }]
})
}
- const standardPendingCount = visibleUpcomingTransactions.filter(tx => !isMcpReviewTransaction(tx)).length
+ const standardPendingCount = visibleUpcomingTransactions.filter(tx => !isMcpReviewTransaction(tx) && matchesAccount(tx)).length
const mcpReviewTransactions = groupPendingSplits(getMcpReviewItems(visibleUpcomingTransactions, applyFilters))
.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime())
const mcpReviewCount = mcpReviewTransactions.length
@@ -1284,7 +1298,8 @@ export function TransactionList({
const readyTransactions = pendingFilteredTransactions.filter(tx => tx.date <= today)
const futureTransactions = pendingFilteredTransactions.filter(tx => tx.date > today)
- const totalFilteredCount = transactions.filter(applyFilters).length
+ const filteredPostedTransactions = transactions.filter(applyFilters)
+ const totalFilteredCount = filteredPostedTransactions.length
+ pendingFilteredTransactions.length
+ mcpReviewTransactions.length
@@ -1486,37 +1501,69 @@ export function TransactionList({
if (composerOnly && isAdding) handleCancel()
}, [navigationKey, composerOnly, isAdding, handleCancel])
+ const appliedFilters: TransactionFilters = { account: accountFilter, category: categoryFilter, sort: sortOrder, search: searchQuery }
+ const applyFilterChanges = ({ search, ...patch }: Partial) => {
+ if (search !== undefined) setSearchQuery(search)
+ if (onFiltersChange) {
+ if (Object.keys(patch).length > 0) onFiltersChange(patch)
+ } else {
+ if (patch.account !== undefined) setLocalAccountFilter(patch.account)
+ if (patch.category !== undefined) setCategoryFilterLocal(patch.category)
+ if (patch.sort !== undefined) setSortOrderLocal(patch.sort)
+ }
+ }
+
+ const filterControls = (
+ { account, category: selectedCategory, sort, search }: TransactionFilters,
+ onChange: (patch: Partial) => void,
+ ) => (<>
+
+
+ onChange({ search: e.target.value })} placeholder="Search transactions..." className="h-11 sm:h-10 w-full rounded-lg border border-border bg-background pl-8 pr-3 text-base sm:text-[13px] outline-none focus:ring-1 focus:ring-primary" />
+
+
+ {([['all', 'All'], ['all-expenses', 'Expenses'], ['all-income', 'Income'], ['transfer', 'Transfers']] as const).map(([value, label]) => )}
+
+
+ onChange({ account: value })}
+ label="Transaction account" className="w-full sm:w-52" selectClassName="h-11 text-base sm:h-10 sm:text-sm" />
+
+ >)
+
return (
{!composerOnly &&
-
Transactions{processTransactions(transactions).length} posted{standardPendingCount > 0 ? ` · ${standardPendingCount} upcoming` : ''}{mcpReviewCount > 0 ? ` · ${mcpReviewCount} MCP drafts` : ''}
+
Transactions{processTransactions(transactions.filter(matchesAccount)).length} posted{standardPendingCount > 0 ? ` · ${standardPendingCount} upcoming` : ''}{mcpReviewCount > 0 ? ` · ${mcpReviewCount} MCP drafts` : ''}
-
-
-
-
- setSearchQuery(e.target.value)} placeholder="Search transactions..." className="h-10 w-full rounded-lg border border-border bg-background pl-8 pr-3 text-[13px] outline-none focus:ring-1 focus:ring-primary" />
-
-
- {([['all', 'All'], ['all-expenses', 'Expenses'], ['all-income', 'Income'], ['transfer', 'Transfers']] as const).map(([value, label]) => )}
-
-
-
+
+
+ {filterControls(appliedFilters, applyFilterChanges)}
}
+ {!composerOnly && filterDraft && (
+
+ {filterControls(filterDraft, patch => setFilterDraft(current => current && { ...current, ...patch }))}
+
+
+
+
+ )}
+
{!composerOnly &&
- {transactionView === 'calendar' ?
+ No matching posted transactions for this account.
+
+ }
+ {transactionView === 'calendar' ?
:
{reviewTransactions.length > 0 &&
@@ -1756,7 +1809,7 @@ export function TransactionList({
{upcomingOpen && {futureTransactions.map(tx => renderPendingTransaction(tx, false))}
}
}
{(() => {
- const allProcessed = sortOrder === 'date' ? sortedDates.flatMap(date => processTransactions(groupedTransactions[date].filter(applyFilters))) : processTransactions(transactions.filter(applyFilters)).sort((a, b) => sortOrder === 'amount-high' ? Math.abs(b.amount) - Math.abs(a.amount) : Math.abs(a.amount) - Math.abs(b.amount))
+ const allProcessed = sortOrder === 'date' ? sortedDates.flatMap(date => processTransactions(groupedTransactions[date].filter(applyFilters))) : processTransactions(filteredPostedTransactions).sort((a, b) => sortOrder === 'amount-high' ? Math.abs(b.amount) - Math.abs(a.amount) : Math.abs(a.amount) - Math.abs(b.amount))
const shown = showAllTransactions ? allProcessed : allProcessed.slice(0, DISPLAY_LIMIT)
return <>
{sortOrder === 'date' ? sortedDates.map(date => {
@@ -1776,8 +1829,9 @@ export function TransactionList({
})()}
{loading && transactions.length === 0 && upcomingTransactions.length === 0 &&
Loading transactions…
}
{!loading && totalFilteredCount === 0 && !isAdding &&
-
{transactions.length === 0 && upcomingTransactions.length === 0 ? 'No transactions yet' : 'No transactions found'}
+
{accountFilter !== 'all' ? 'No matching transactions for this account' : transactions.length === 0 && upcomingTransactions.length === 0 ? 'No transactions yet' : 'No transactions found'}
{transactions.length === 0 && upcomingTransactions.length === 0 ? 'Record your first transaction to start tracking' : 'Try changing the filters or period.'}
+ {accountFilter !== 'all' &&
}
{searchQuery && !isAllTimeRange(dateRange) &&
}
}
}
diff --git a/client/src/navigation/filters.test.ts b/client/src/navigation/filters.test.ts
index c766c079..4863c159 100644
--- a/client/src/navigation/filters.test.ts
+++ b/client/src/navigation/filters.test.ts
@@ -51,3 +51,16 @@ describe('view URL contract', () => {
expect(parseDashboardFilters(params('view=calendar&range=allTime'), today)).toMatchObject({ range: 'allTime', view: 'list' })
})
})
+
+
+it('round trips a cash account on both pages and validates only with loaded accounts', () => {
+ const accounts = [{ id: 'archived-cash', type: 'cash', archived_at: 1 }, { id: 'holding', type: 'investment' }]
+ const query = params('account=archived-cash')
+ expect(dashboardSearch(parseDashboardFilters(query, today, undefined, accounts))).toBe(query.toString())
+ expect(analyticsSearch(parseAnalyticsFilters(query, today, undefined, accounts))).toBe(query.toString())
+ for (const parse of [parseDashboardFilters, parseAnalyticsFilters]) {
+ expect(parse(query, today).account).toBe('archived-cash')
+ expect(parse(params('account=holding'), today, undefined, accounts).account).toBe('all')
+ expect(parse(params('account=missing'), today, undefined, accounts).account).toBe('all')
+ }
+})
diff --git a/client/src/navigation/filters.ts b/client/src/navigation/filters.ts
index 90769b83..bd8734a9 100644
--- a/client/src/navigation/filters.ts
+++ b/client/src/navigation/filters.ts
@@ -2,8 +2,11 @@ import { endOfMonth, format, isValid, parseISO, startOfMonth } from 'date-fns'
import type { IncomeExpensesTrendResolution } from '../components/analytics-module/IncomeExpensesTrendChart'
import type { TimePeriod } from '../components/analytics-module/types'
+type CashAccountOption = { id: string; type: string }
+
type Category = { id: string; type: 'income' | 'expense' }
export type DashboardFilters = {
+ account: string
range: 'current' | 'custom' | 'allTime'
startDate: string
endDate: string
@@ -12,6 +15,7 @@ export type DashboardFilters = {
view: 'list' | 'calendar'
}
export type AnalyticsFilters = {
+ account: string
period: TimePeriod
date: string
pinned: boolean
@@ -33,11 +37,18 @@ function category(value: string | null, categories?: Category[], type?: Category
return !categories || categories.some(item => item.id === value && (!type || item.type === type)) ? value : 'all'
}
-export function parseDashboardFilters(params: URLSearchParams, today = new Date(), categories?: Category[]): DashboardFilters {
+function accountFilter(params: URLSearchParams, accounts?: CashAccountOption[]): string {
+ const value = params.get('account')
+ if (!value || value === 'all' || value.length > 128) return 'all'
+ return !accounts || accounts.some(item => item.id === value && item.type === 'cash') ? value : 'all'
+}
+
+export function parseDashboardFilters(params: URLSearchParams, today = new Date(), categories?: Category[], accounts?: CashAccountOption[]): DashboardFilters {
const from = params.get('from'), to = params.get('to')
const allTime = params.get('range') === 'allTime' || (from === '1900-01-01' && to === '2100-12-31')
const custom = !allTime && calendarDate(from) && calendarDate(to) && from <= to
const filters: DashboardFilters = {
+ account: accountFilter(params, accounts),
range: allTime ? 'allTime' : custom ? 'custom' : 'current',
startDate: allTime ? '1900-01-01' : custom ? from : format(startOfMonth(today), 'yyyy-MM-dd'),
endDate: allTime ? '2100-12-31' : custom ? to : format(endOfMonth(today), 'yyyy-MM-dd'),
@@ -65,10 +76,11 @@ export function dashboardSearch(filters: DashboardFilters): string {
if (filters.category !== 'all') params.set('category', filters.category)
if (filters.sort !== 'date') params.set('sort', filters.sort)
if (filters.view !== 'list') params.set('view', filters.view)
+ if (filters.account !== 'all') params.set('account', filters.account)
return params.toString()
}
-export function parseAnalyticsFilters(params: URLSearchParams, today = new Date(), categories?: Category[]): AnalyticsFilters {
+export function parseAnalyticsFilters(params: URLSearchParams, today = new Date(), categories?: Category[], accounts?: CashAccountOption[]): AnalyticsFilters {
const period = params.get('period') === 'year' || params.get('period') === 'allTime' ? params.get('period') as TimePeriod : 'month'
const month = params.get('month'), year = params.get('year')
const monthDate = month && /^\d{4}-\d{2}$/.test(month) ? `${month}-01` : null
@@ -76,6 +88,7 @@ export function parseAnalyticsFilters(params: URLSearchParams, today = new Date(
const explicitDate = period === 'month' ? monthDate : period === 'year' ? yearDate : null
const pinned = calendarDate(explicitDate)
return {
+ account: accountFilter(params, accounts),
period, date: pinned ? explicitDate : format(startOfMonth(today), 'yyyy-MM-dd'), pinned,
mode: params.get('mode') === 'projected' ? 'projected' : 'actual',
expenseCategory: category(params.get('expenseCategory'), categories, 'expense'),
@@ -94,5 +107,6 @@ export function analyticsSearch(filters: AnalyticsFilters): string {
if (filters.expenseCategory !== 'all') params.set('expenseCategory', filters.expenseCategory)
if (filters.incomeCategory !== 'all') params.set('incomeCategory', filters.incomeCategory)
if (filters.resolution !== 'default') params.set('resolution', filters.resolution)
+ if (filters.account !== 'all') params.set('account', filters.account)
return params.toString()
}
diff --git a/client/src/pages/AnalyticsPage.tsx b/client/src/pages/AnalyticsPage.tsx
index 42fe9441..22701b5e 100644
--- a/client/src/pages/AnalyticsPage.tsx
+++ b/client/src/pages/AnalyticsPage.tsx
@@ -10,7 +10,10 @@ export function AnalyticsPage() {
const { finance, masterCurrency, outlook } = useOutletContext()
const { dataStatus } = finance
const categoriesReady = dataStatus.categories.loaded && !dataStatus.categories.loading && !dataStatus.categories.error
- const parseFilters = useCallback((params: URLSearchParams) => parseAnalyticsFilters(params, new Date(), categoriesReady ? finance.categories : undefined), [categoriesReady, finance.categories])
+ const accountsStatus = finance.dataStatus.accounts
+ const accountsReady = accountsStatus.loaded && !accountsStatus.loading && !accountsStatus.error
+ const parseFilters = useCallback((params: URLSearchParams) => parseAnalyticsFilters(params, new Date(), categoriesReady ? finance.categories : undefined,
+ accountsReady ? finance.accounts : undefined), [categoriesReady, finance.categories, accountsReady, finance.accounts])
const [filters, updateFilters] = useUrlFilters(parseFilters, analyticsSearch)
const projectionReady = dataStatus.upcoming.loaded && !dataStatus.upcoming.loading && !dataStatus.upcoming.error
const comparisonReady = [dataStatus.accounts, dataStatus.history].every(status => status.loaded && !status.loading && !status.error)
diff --git a/client/src/pages/DashboardPage.tsx b/client/src/pages/DashboardPage.tsx
index 39b9cf54..9b24a256 100644
--- a/client/src/pages/DashboardPage.tsx
+++ b/client/src/pages/DashboardPage.tsx
@@ -20,7 +20,10 @@ export function DashboardPage() {
const searchRequest = location.state as { transactionSearch?: string } | null
const { finance, masterCurrency } = useOutletContext()
const categoriesReady = finance.dataStatus.categories.loaded && !finance.dataStatus.categories.loading && !finance.dataStatus.categories.error
- const parseFilters = useCallback((params: URLSearchParams) => parseDashboardFilters(params, new Date(), categoriesReady ? finance.categories : undefined), [categoriesReady, finance.categories])
+ const accountsStatus = finance.dataStatus.accounts
+ const accountsReady = accountsStatus.loaded && !accountsStatus.loading && !accountsStatus.error
+ const parseFilters = useCallback((params: URLSearchParams) => parseDashboardFilters(params, new Date(), categoriesReady ? finance.categories : undefined,
+ accountsReady ? finance.accounts : undefined), [categoriesReady, finance.categories, accountsReady, finance.accounts])
const [filters, updateFilters] = useUrlFilters(parseFilters, dashboardSearch)
const dateRange = useMemo(() => ({ startDate: filters.startDate, endDate: filters.endDate }), [filters.startDate, filters.endDate])
const currentMonth = filters.range === 'allTime' ? new Date() : parseISO(filters.startDate)