Skip to content

Move redux state to react-query - category states - #5977

Merged
joel-jeremy merged 28 commits into
masterfrom
react-query-categories
Feb 5, 2026
Merged

joel-jeremy merged 28 commits into
masterfrom
react-query-categories

Conversation

@joel-jeremy

@joel-jeremy joel-jeremy commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor

The move to react-query is an effort to further reduce the overall database queries by leveraging a cache. Right now, data that is used by Actual is maintained in the redux store. There is a lot of manual tracking done right now to prevent loading the data more than necessary (via isLoading, isLoaded, isDirty states). Moving to react-query removes the need to manually track those states.

If this is approved, I'm planning to migrate the entire redux store, one slice at a time.

I didn't change the return types of the category hooks in this PR but I'm planning to expose the react-query states in a future PR i.e.

const { data: categories, isLoading, isFetching, error  } = useCategories();

This also opens up the possibility to use Suspense to simplify showing of loading states throughout the app


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 28 14.47 MB → 14.55 MB (+84.27 kB) +0.57%
loot-core 1 5.85 MB 0%
api 1 4.39 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
28 14.47 MB → 14.55 MB (+84.27 kB) +0.57%
Changeset
File Δ Size
src/budget/mutations.ts 🆕 +21.44 kB 0 B → 21.44 kB
node_modules/@tanstack/query-core/build/modern/queryObserver.js 🆕 +15.52 kB 0 B → 15.52 kB
node_modules/@tanstack/query-core/build/modern/query.js 🆕 +11.35 kB 0 B → 11.35 kB
node_modules/@tanstack/query-core/build/modern/queryClient.js 🆕 +8.82 kB 0 B → 8.82 kB
node_modules/@tanstack/query-core/build/modern/mutation.js 🆕 +6.44 kB 0 B → 6.44 kB
node_modules/@tanstack/query-core/build/modern/utils.js 🆕 +5.72 kB 0 B → 5.72 kB
node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js 🆕 +3.73 kB 0 B → 3.73 kB
node_modules/@tanstack/query-core/build/modern/mutationObserver.js 🆕 +3.32 kB 0 B → 3.32 kB
node_modules/@tanstack/query-core/build/modern/mutationCache.js 🆕 +3.24 kB 0 B → 3.24 kB
node_modules/@tanstack/query-core/build/modern/retryer.js 🆕 +3.18 kB 0 B → 3.18 kB
node_modules/@tanstack/react-query/build/modern/useBaseQuery.js 🆕 +2.56 kB 0 B → 2.56 kB
node_modules/@tanstack/query-core/build/modern/queryCache.js 🆕 +2.1 kB 0 B → 2.1 kB
node_modules/@tanstack/query-core/build/modern/notifyManager.js 🆕 +1.81 kB 0 B → 1.81 kB
node_modules/@tanstack/query-core/build/modern/timeoutManager.js 🆕 +1.71 kB 0 B → 1.71 kB
node_modules/@tanstack/query-core/build/modern/focusManager.js 🆕 +1.39 kB 0 B → 1.39 kB
node_modules/@tanstack/query-core/build/modern/onlineManager.js 🆕 +1.28 kB 0 B → 1.28 kB
src/budget/queries.ts 🆕 +1.08 kB 0 B → 1.08 kB
node_modules/@tanstack/react-query/build/modern/suspense.js 🆕 +1016 B 0 B → 1016 B
node_modules/@tanstack/react-query/build/modern/useMutation.js 🆕 +912 B 0 B → 912 B
node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js 🆕 +699 B 0 B → 699 B
node_modules/@tanstack/query-core/build/modern/thenable.js 🆕 +633 B 0 B → 633 B
node_modules/@tanstack/query-core/build/modern/removable.js 🆕 +599 B 0 B → 599 B
node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js 🆕 +572 B 0 B → 572 B
node_modules/@tanstack/query-core/build/modern/subscribable.js 🆕 +454 B 0 B → 454 B
node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js 🆕 +392 B 0 B → 392 B
src/hooks/useCategoriesQuery.ts 🆕 +261 B 0 B → 261 B
node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js 🆕 +160 B 0 B → 160 B
node_modules/@tanstack/react-query/build/modern/useQuery.js 🆕 +92 B 0 B → 92 B
node_modules/@tanstack/react-query/build/modern/queryOptions.js 🆕 +75 B 0 B → 75 B
src/components/budget/index.tsx 📈 +1.83 kB (+17.02%) 10.75 kB → 12.58 kB
src/index.tsx 📈 +166 B (+10.74%) 1.51 kB → 1.67 kB
src/hooks/useCategory.ts 📈 +26 B (+5.92%) 439 B → 465 B
src/hooks/useCategoryGroup.ts 📈 +10 B (+2.16%) 463 B → 473 B
src/global-events.ts 📈 +74 B (+1.95%) 3.71 kB → 3.79 kB
src/components/App.tsx 📈 +117 B (+1.21%) 9.44 kB → 9.56 kB
src/components/mobile/budget/ExpenseGroupList.tsx 📈 +38 B (+0.70%) 5.31 kB → 5.34 kB
src/sync-events.ts 📈 +65 B (+0.65%) 9.8 kB → 9.86 kB
src/components/mobile/budget/IncomeCategoryList.tsx 📈 +18 B (+0.53%) 3.31 kB → 3.33 kB
src/components/mobile/budget/ExpenseCategoryList.tsx 📈 +18 B (+0.46%) 3.83 kB → 3.85 kB
src/components/transactions/TransactionsTable.tsx 📈 +214 B (+0.24%) 85.88 kB → 86.09 kB
src/components/reports/reports/CashFlow.tsx 📈 +1 B (+0.01%) 8.97 kB → 8.97 kB
src/components/reports/Header.tsx 📈 +1 B (+0.01%) 14.21 kB → 14.21 kB
src/components/reports/reports/NetWorth.tsx 📈 +1 B (+0.01%) 14.64 kB → 14.64 kB
src/components/reports/reports/Summary.tsx 📈 +1 B (+0.00%) 27.38 kB → 27.38 kB
src/components/reports/reports/Calendar.tsx 📈 +1 B (+0.00%) 28.98 kB → 28.99 kB
src/components/reports/reports/Crossover.tsx 📉 -7 B (-0.02%) 40.88 kB → 40.88 kB
src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx 📉 -21 B (-0.07%) 28.32 kB → 28.3 kB
src/components/formula/QueryManager.tsx 📉 -43 B (-0.18%) 23.89 kB → 23.85 kB
src/components/reports/reports/Spending.tsx 📉 -48 B (-0.20%) 23.34 kB → 23.29 kB
src/components/budget/BudgetTable.tsx 📉 -88 B (-0.78%) 11.03 kB → 10.95 kB
src/components/autocomplete/CategoryAutocomplete.tsx 📉 -146 B (-0.82%) 17.3 kB → 17.16 kB
src/components/reports/reports/CrossoverCard.tsx 📉 -116 B (-1.06%) 10.73 kB → 10.61 kB
src/components/mobile/budget/BudgetPage.tsx 📉 -829 B (-2.01%) 40.37 kB → 39.56 kB
src/redux/store.ts 📉 -23 B (-2.29%) 1006 B → 983 B
src/hooks/useCategories.ts 📉 -537 B (-64.70%) 830 B → 293 B
src/budget/budgetSlice.ts 🔥 -10.13 kB (-100%) 10.13 kB → 0 B
src/hooks/useCategoryActions.ts 🔥 -6.77 kB (-100%) 6.77 kB → 0 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.22 MB → 9.31 MB (+85.21 kB) +0.90%

Smaller

Asset File Size % Changed
static/js/narrow.js 641.19 kB → 640.46 kB (-755 B) -0.11%
static/js/ReportRouter.js 1.11 MB → 1.11 MB (-209 B) -0.02%

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.5 kB 0%
static/js/en-GB.js 7.18 kB 0%
static/js/en.js 162.91 kB 0%
static/js/es.js 173.92 kB 0%
static/js/fr.js 179.72 kB 0%
static/js/it.js 171.54 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/pt-BR.js 146.62 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/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.85 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.C30497Fh.js 5.85 MB 0%

api

Total

Files count Total bundle size % Changed
1 4.39 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
bundle.api.js 4.39 MB 0%

@actual-github-bot actual-github-bot Bot changed the title Move redux state to react-query - category states [WIP] Move redux state to react-query - category states Oct 21, 2025
@netlify

netlify Bot commented Oct 21, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 803d493
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/6983e41e98d90300083dbd17
😎 Deploy Preview https://deploy-preview-5977.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
25 13.83 MB → 13.92 MB (+88.1 kB) +0.62%
Changeset
File Δ Size
src/budget/mutations.ts 🆕 +17.61 kB 0 B → 17.61 kB
node_modules/@tanstack/query-core/build/modern/queryObserver.js 🆕 +15.52 kB 0 B → 15.52 kB
node_modules/@tanstack/query-core/build/modern/query.js 🆕 +11.35 kB 0 B → 11.35 kB
node_modules/@tanstack/query-core/build/modern/queryClient.js 🆕 +8.82 kB 0 B → 8.82 kB
node_modules/@tanstack/query-core/build/modern/mutation.js 🆕 +6.44 kB 0 B → 6.44 kB
node_modules/@tanstack/query-core/build/modern/utils.js 🆕 +5.7 kB 0 B → 5.7 kB
node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js 🆕 +3.73 kB 0 B → 3.73 kB
node_modules/@tanstack/query-core/build/modern/mutationObserver.js 🆕 +3.3 kB 0 B → 3.3 kB
node_modules/@tanstack/query-core/build/modern/mutationCache.js 🆕 +3.24 kB 0 B → 3.24 kB
node_modules/@tanstack/query-core/build/modern/retryer.js 🆕 +3.18 kB 0 B → 3.18 kB
node_modules/@tanstack/react-query/build/modern/useBaseQuery.js 🆕 +2.56 kB 0 B → 2.56 kB
node_modules/@tanstack/query-core/build/modern/queryCache.js 🆕 +2.1 kB 0 B → 2.1 kB
node_modules/@tanstack/query-core/build/modern/notifyManager.js 🆕 +1.81 kB 0 B → 1.81 kB
node_modules/@tanstack/query-core/build/modern/timeoutManager.js 🆕 +1.71 kB 0 B → 1.71 kB
node_modules/@tanstack/query-core/build/modern/focusManager.js 🆕 +1.39 kB 0 B → 1.39 kB
node_modules/@tanstack/query-core/build/modern/onlineManager.js 🆕 +1.28 kB 0 B → 1.28 kB
src/budget/queries.ts 🆕 +1.08 kB 0 B → 1.08 kB
node_modules/@tanstack/react-query/build/modern/suspense.js 🆕 +1016 B 0 B → 1016 B
node_modules/@tanstack/react-query/build/modern/useMutation.js 🆕 +908 B 0 B → 908 B
node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js 🆕 +699 B 0 B → 699 B
node_modules/@tanstack/query-core/build/modern/thenable.js 🆕 +633 B 0 B → 633 B
node_modules/@tanstack/query-core/build/modern/removable.js 🆕 +599 B 0 B → 599 B
node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js 🆕 +572 B 0 B → 572 B
node_modules/@tanstack/query-core/build/modern/subscribable.js 🆕 +454 B 0 B → 454 B
node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js 🆕 +392 B 0 B → 392 B
src/hooks/useCategoriesQuery.ts 🆕 +245 B 0 B → 245 B
node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js 🆕 +160 B 0 B → 160 B
node_modules/@tanstack/react-query/build/modern/useQuery.js 🆕 +92 B 0 B → 92 B
node_modules/@tanstack/react-query/build/modern/queryOptions.js 🆕 +75 B 0 B → 75 B
src/index.tsx 📈 +166 B (+10.76%) 1.51 kB → 1.67 kB
src/components/budget/index.tsx 📈 +731 B (+4.60%) 15.51 kB → 16.22 kB
src/hooks/useCategory.ts 📈 +10 B (+2.28%) 439 B → 449 B
src/global-events.ts 📈 +74 B (+1.95%) 3.71 kB → 3.79 kB
src/components/mobile/budget/BudgetPage.tsx 📈 +689 B (+1.57%) 42.87 kB → 43.54 kB
src/components/App.tsx 📈 +117 B (+1.53%) 7.47 kB → 7.59 kB
src/components/mobile/budget/ExpenseGroupList.tsx 📈 +38 B (+0.70%) 5.31 kB → 5.34 kB
src/sync-events.ts 📈 +65 B (+0.65%) 9.73 kB → 9.8 kB
src/components/mobile/budget/IncomeCategoryList.tsx 📈 +18 B (+0.53%) 3.31 kB → 3.33 kB
src/components/mobile/budget/ExpenseCategoryList.tsx 📈 +18 B (+0.46%) 3.83 kB → 3.85 kB
src/components/transactions/TransactionsTable.tsx 📈 +214 B (+0.24%) 85.39 kB → 85.6 kB
src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx 📉 -21 B (-0.07%) 27.54 kB → 27.52 kB
src/components/autocomplete/CategoryAutocomplete.tsx 📉 -146 B (-0.85%) 16.68 kB → 16.53 kB
src/hooks/useCategoryGroup.ts 📉 -6 B (-1.30%) 463 B → 457 B
src/components/budget/BudgetTable.tsx 📉 -156 B (-1.35%) 11.27 kB → 11.12 kB
src/redux/store.ts 📉 -23 B (-2.28%) 1010 B → 987 B
src/hooks/useCategories.ts 📉 -537 B (-64.70%) 830 B → 293 B
src/budget/budgetSlice.ts 🔥 -9.65 kB (-100%) 9.65 kB → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 9.02 MB → 9.08 MB (+64.85 kB) +0.70%
static/js/usePayeeRuleCounts.js 11.79 kB → 33.58 kB (+21.79 kB) +184.81%
static/js/narrow.js 609.5 kB → 610.25 kB (+763 B) +0.12%
static/js/wide.js 185.6 kB → 186.32 kB (+731 B) +0.38%

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 110.41 kB 0%
static/js/de.js 163.91 kB 0%
static/js/en-GB.js 6.84 kB 0%
static/js/en.js 153.59 kB 0%
static/js/fr.js 171.48 kB 0%
static/js/it.js 165.78 kB 0%
static/js/nl.js 99.93 kB 0%
static/js/pl.js 90.75 kB 0%
static/js/pt-BR.js 147.06 kB 0%
static/js/ru.js 112.25 kB 0%
static/js/th.js 187.39 kB 0%
static/js/uk.js 213.33 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.48 kB 0%
static/js/ReportRouter.js 1.08 MB 0%
static/js/TransactionList.js 100.22 kB 0%
static/js/AppliedFilters.js 9.42 kB 0%
static/js/useTransactionBatchActions.js 12.98 kB 0%
static/js/FormulaEditor.js 1.08 MB 0%

@github-actions

github-actions Bot commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
1 5.79 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.B0YqDUqb.js 5.79 MB 0%

@joel-jeremy
joel-jeremy force-pushed the react-query-categories branch from ac87e1a to c6a636b Compare October 22, 2025 15:52
@joel-jeremy joel-jeremy changed the title [WIP] Move redux state to react-query - category states Move redux state to react-query - category states Oct 22, 2025
@coderabbitai

coderabbitai Bot commented Oct 22, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Migrates budget/category state from a Redux slice to TanStack React Query: removes the Redux budgetSlice, adds categoryQueries and a comprehensive set of mutation hooks, integrates a QueryClient provider, and updates hooks, components, and sync/global handlers to use queries/mutations and query invalidation.

Changes

Cohort / File(s) Summary
Package Dependencies
\packages/desktop-client/package.json``
Added @tanstack/react-query (^5.90.5) to devDependencies.
Removed Redux slice
\packages/desktop-client/src/budget/budgetSlice.ts``
Deleted the entire Redux budget slice and all exported thunks, actions, types, helpers, and public surface.
React Query surface
\packages/desktop-client/src/budget/queries.ts`, `packages/desktop-client/src/budget/mutations.ts`, `packages/desktop-client/src/budget/index.ts``
Added categoryQueries (keys + list query) and a large set of mutation hooks (create/update/save/delete/move/reorder for categories & groups) plus useBudgetActions; re-exported via index.
App bootstrap / QueryClient
\packages/desktop-client/src/index.tsx`, `packages/desktop-client/src/components/App.tsx``
Created and exposed a QueryClient, wrapped app with QueryClientProvider, and passed queryClient into global event handling.
Store & Mocks
\packages/desktop-client/src/redux/store.ts`, `packages/desktop-client/src/redux/mock.tsx``
Removed budgetSlice import and reducer registration from root reducer and mock store.
Hooks → query-based
\packages/desktop-client/src/hooks/useCategories.ts`, `packages/desktop-client/src/hooks/useCategoriesQuery.ts`, `packages/desktop-client/src/hooks/useCategory.ts`, `packages/desktop-client/src/hooks/useCategoryGroup.ts``
Replaced Redux selectors/logic with React Query useQuery wrappers; added useCategoriesQuery; removed dirty-state/effect logic.
Removed hook
\packages/desktop-client/src/hooks/useCategoryActions.ts``
Deleted legacy useCategoryActions (Redux-based orchestration for category CRUD & reorder).
Components — mutation integration
\packages/desktop-client/src/components/budget/index.tsx`, `packages/desktop-client/src/components/budget/BudgetTable.tsx`, `packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx``
Replaced dispatch-based flows with mutation hooks (mutate(...)), tightened onReorderCategory signature to require groupId, and removed some default fallbacks for categoryGroups.
Mobile budget components
\packages/desktop-client/src/components/mobile/budget/*.tsx``
Replaced dispatch usage with mutation hooks (create/update/delete/move/reorder); drag/drop handlers call mutate(...) instead of dispatching.
Event & sync handling
\packages/desktop-client/src/global-events.ts`, `packages/desktop-client/src/sync-events.ts``
Extended handlers to accept QueryClient; replaced dispatch(reloadCategories()) with queryClient.invalidateQueries({ queryKey: categoryQueries.lists() }); updated call sites.
Transactions & Import
\packages/desktop-client/src/components/transactions/TransactionsTable.tsx`, `packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx``
Added a memoized module-scoped getCategoriesById; switched to passing/using the flat categories array from hooks.
Linter rule tweak
\.oxlintrc.json``
Anchored react/exhaustive-deps additionalHooks regex to exact hook names.
Release notes
\upcoming-release-notes/5977.md``
Added release note documenting migration of category state to React Query.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant UI as "UI Component"
    participant QC as "QueryClient / React Query"
    participant API as "Backend API"

    rect rgba(200,230,255,0.5)
    Note over UI,QC: Mutation-driven category operations
    User->>UI: trigger create/update/delete/move
    UI->>QC: call mutation.mutate(payload)
    QC->>API: send request (send-or-throw)
    API-->>QC: respond (success / error)
    alt success
        QC->>QC: invalidateQueries(categoryQueries.lists())
        QC-->>UI: refetch -> UI updates
    else error
        QC-->>UI: onError -> show notification
    end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇
I hopped from slice to query, quick and spry,
Mutations leap where thunks would once apply.
Cache refreshed with a twitch of my nose,
Categories bloom where the new flow goes.
✨ Hooray — a rabbit's small recompose!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main objective of the PR: migrating category state management from Redux to React Query.
Description check ✅ Passed The pull request description is clearly related to the changeset, explaining the migration from Redux to react-query for category state management and detailing the rationale, goals, and future plans.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch react-query-categories

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (8)
packages/desktop-client/src/index.tsx (1)

87-88: Consider configuring QueryClient options for optimal behavior.

The QueryClient is instantiated with default options. Consider configuring options that align with Actual's data synchronization patterns:

-const queryClient = new QueryClient();
+const queryClient = new QueryClient({
+  defaultOptions: {
+    queries: {
+      // Prevent refetch on window focus since Actual handles sync explicitly
+      refetchOnWindowFocus: false,
+      // Adjust based on sync frequency requirements
+      staleTime: 60000, // 1 minute
+      retry: 1,
+    },
+  },
+});
packages/desktop-client/src/components/transactions/TransactionsTable.tsx (1)

2990-3001: Consider centralizing getCategoriesById to avoid duplication.

The getCategoriesById helper is duplicated here to avoid importing from the removed budgetSlice. If this logic is used in multiple places, consider extracting it to a shared utility module (e.g., @desktop-client/categories/utils.ts) to maintain a single source of truth and reduce code duplication.

packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx (1)

46-46: LGTM with a minor documentation issue.

The mutation-based API is correctly implemented for category group reordering. However, the comment on lines 125-127 mentions "moveCategory" when it should refer to "moveCategoryGroup".

Apply this diff to fix the comment:

-          // Due to the way `moveCategory` works, we use the category next to the
-          // actual target category here because `moveCategory` always shoves the
-          // category *before* the target category.
+          // Due to the way `moveCategoryGroup` works, we use the group next to the
+          // actual target group here because `moveCategoryGroup` always shoves the
+          // group *before* the target group.

Also applies to: 106-109, 123-131

packages/desktop-client/src/global-events.ts (1)

9-9: Use absolute import for desktop-client modules.

Guideline: “Use absolute imports in desktop-client.” Change to the alias form.

-import { categoryQueries } from './budget';
+import { categoryQueries } from '@desktop-client/budget';
packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (1)

226-241: Delete group flow: good transfer path; ensure errors surface in UI.

Flow covers must‑transfer and direct delete. If you want UX feedback on failure, prefer mutateAsync with try/catch to keep the modal context, otherwise the hook’s notification is the only signal.

Also applies to: 237-238

packages/desktop-client/src/components/budget/index.tsx (2)

254-262: Memoize: wrap onApplyBudgetTemplatesInGroup in useCallback.

Reduces rerenders of children receiving this prop.

-  const onApplyBudgetTemplatesInGroup = async categories => {
-    applyBudgetAction.mutate({
+  const onApplyBudgetTemplatesInGroup = useCallback(async (categories) => {
+    applyBudgetAction.mutate({
       month: startMonth,
       type: 'apply-multiple-templates',
       args: { categories },
     });
-  };
+  }, [applyBudgetAction, startMonth]);

264-266: Memoize: wrap onBudgetAction in useCallback.

Keeps callback identity stable for large tables/components.

-  const onBudgetAction = (month, type, args) => {
-    applyBudgetAction.mutate({ month, type, args });
-  };
+  const onBudgetAction = useCallback((month, type, args) => {
+    applyBudgetAction.mutate({ month, type, args });
+  }, [applyBudgetAction]);
packages/desktop-client/src/budget/index.ts (1)

55-65: Consider removing unnecessary optional chaining.

The category.name?.toLowerCase() on line 61 uses optional chaining, but according to the CategoryEntity type, name is a required field. While this defensive approach doesn't cause issues, removing the optional chaining would be more accurate to the type contract.

   return {
     ...category,
     name:
-      category.name?.toLowerCase() === 'starting balances'
+      category.name.toLowerCase() === 'starting balances'
         ? i18n.t('Starting Balances')
         : category.name,
   };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab4aa21 and 6d16fa2.

⛔ Files ignored due to path filters (2)
  • upcoming-release-notes/5977.md is excluded by !**/*.md
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (25)
  • eslint.config.mjs (2 hunks)
  • packages/desktop-client/package.json (1 hunks)
  • packages/desktop-client/src/budget/budgetSlice.ts (0 hunks)
  • packages/desktop-client/src/budget/index.ts (1 hunks)
  • packages/desktop-client/src/components/App.tsx (2 hunks)
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/BudgetTable.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/index.tsx (6 hunks)
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (9 hunks)
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (4 hunks)
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx (4 hunks)
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx (6 hunks)
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx (2 hunks)
  • packages/desktop-client/src/global-events.ts (4 hunks)
  • packages/desktop-client/src/hooks/useBudgetActions.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategories.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategory.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoryGroup.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoryMutations.ts (1 hunks)
  • packages/desktop-client/src/index.tsx (3 hunks)
  • packages/desktop-client/src/redux/mock.tsx (0 hunks)
  • packages/desktop-client/src/redux/store.ts (0 hunks)
  • packages/desktop-client/src/sync-events.ts (3 hunks)
💤 Files with no reviewable changes (3)
  • packages/desktop-client/src/redux/store.ts
  • packages/desktop-client/src/redux/mock.tsx
  • packages/desktop-client/src/budget/budgetSlice.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Prefer type over interface in TypeScript
Avoid enum; use objects or maps instead
Avoid any and unknown unless absolutely necessary
Avoid type assertions (as, non-null !); prefer satisfies for narrowing
Use inline type imports: import { type X } from '...'
Favor functional/declarative patterns; avoid classes
Use the function keyword for pure functions
Use named exports for components and utilities (avoid default exports except specific cases)
Maintain import order groups (React, Node built-ins, externals, Actual packages, parent, sibling, index) with newlines between groups
Do not directly reference platform-specific imports by extension (.api, .web, .electron)

Files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/hooks/useCategoryMutations.ts
  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/hooks/useCategory.ts
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/global-events.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/hooks/useCategories.ts
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Do not use console.*; use the logger instead
Import uuid with destructuring: import { v4 as uuidv4 } from 'uuid'

Files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/hooks/useCategoryMutations.ts
  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/hooks/useCategory.ts
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/global-events.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/hooks/useCategories.ts
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
packages/{desktop-client,component-library}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/{desktop-client,component-library}/src/**/*.{ts,tsx}: All user-facing strings must be translated
Prefer <Trans> component over t() when possible
Do not use React.* namespace imports; use named imports
Use theme tokens; do not import colors directly

Files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/hooks/useCategoryMutations.ts
  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/hooks/useCategory.ts
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/global-events.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/hooks/useCategories.ts
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
packages/desktop-client/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/desktop-client/src/**/*.{ts,tsx}: Use custom navigation hook from src/hooks instead of react-router directly
Use useDispatch, useSelector, useStore from src/redux (not react-redux)
Use absolute imports in desktop-client

Files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/hooks/useCategoryMutations.ts
  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/hooks/useCategory.ts
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/global-events.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/hooks/useCategories.ts
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
packages/{desktop-client,component-library}/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

packages/{desktop-client,component-library}/src/**/*.tsx: Do not use React.FC/React.FunctionComponent; type props directly
Avoid unstable nested components in JSX
Prefer declarative, minimal JSX; avoid unnecessary curly braces and prefer concise conditional expressions (condition && <Component />)

Files:

  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
packages/desktop-client/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use <Link> instead of <a> tags

Files:

  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
🧠 Learnings (5)
📚 Learning: 2025-03-14T15:11:36.220Z
Learnt from: joel-jeremy
PR: actualbudget/actual#4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget mobile app, the callback functions `onEditCategory` (implemented as `onOpenCategoryMenuModal`) and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-03-14T15:11:36.220Z
Learnt from: joel-jeremy
PR: actualbudget/actual#4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget app, the callback functions `onEditCategory` and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-10T02:29:05.655Z
Learnt from: tlesicka
PR: actualbudget/actual#3593
File: packages/desktop-client/src/components/sidebar/Sidebar.tsx:112-116
Timestamp: 2024-10-10T02:29:05.655Z
Learning: In `packages/desktop-client/src/components/sidebar/BudgetName.tsx`, the `BudgetName` component consists of three parts: `BudgetName`, `EditBudgetName`, and the Menu. Keeping `EditBudgetName` as a separate component helps maintain cleaner code by separating concerns.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-18T15:33:24.453Z
Learnt from: joel-jeremy
PR: actualbudget/actual#3685
File: .eslintrc.js:164-169
Timestamp: 2024-10-18T15:33:24.453Z
Learning: When updating the `additionalHooks` pattern for `react-hooks/exhaustive-deps`, only `useQuery` should be added, not generalized patterns.

Applied to files:

  • eslint.config.mjs
📚 Learning: 2025-10-21T06:59:54.845Z
Learnt from: CR
PR: actualbudget/actual#0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.845Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use `useDispatch`, `useSelector`, `useStore` from `src/redux` (not react-redux)

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
🧬 Code graph analysis (20)
packages/desktop-client/src/hooks/useCategoryGroup.ts (1)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/hooks/useCategoryMutations.ts (6)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/loot-core/src/types/models/category-group.ts (1)
  • CategoryGroupEntity (3-11)
packages/desktop-client/src/redux/index.ts (1)
  • useDispatch (18-18)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/notifications/notificationsSlice.ts (2)
  • addNotification (58-68)
  • addGenericErrorNotification (69-79)
packages/loot-core/src/server/db/index.ts (2)
  • moveCategory (491-510)
  • moveCategoryGroup (395-408)
packages/desktop-client/src/index.tsx (1)
packages/desktop-client/src/components/App.tsx (1)
  • App (173-256)
packages/desktop-client/src/hooks/useBudgetActions.ts (3)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/desktop-client/src/redux/index.ts (1)
  • useDispatch (18-18)
packages/desktop-client/src/notifications/notificationsSlice.ts (1)
  • addNotification (58-68)
packages/desktop-client/src/hooks/useCategory.ts (1)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (2)
packages/desktop-client/src/hooks/useBudgetActions.ts (1)
  • useBudgetActions (166-317)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
packages/desktop-client/src/sync-events.ts (2)
packages/desktop-client/src/redux/store.ts (2)
  • store (80-87)
  • AppStore (89-89)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/global-events.ts (2)
packages/desktop-client/src/redux/store.ts (2)
  • store (80-87)
  • AppStore (89-89)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (2)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
packages/loot-core/src/server/db/index.ts (1)
  • moveCategory (491-510)
packages/desktop-client/src/components/App.tsx (1)
packages/desktop-client/src/global-events.ts (1)
  • handleGlobalEvents (21-174)
packages/desktop-client/src/components/budget/BudgetTable.tsx (3)
packages/desktop-client/src/components/util/GenericInput.jsx (1)
  • categoryGroups (45-45)
packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx (1)
  • categoryGroups (497-497)
packages/desktop-client/src/hooks/useCategories.ts (1)
  • useCategories (3-7)
packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx (1)
packages/desktop-client/src/hooks/useCategories.ts (1)
  • useCategories (3-7)
packages/desktop-client/src/budget/index.ts (2)
packages/loot-core/src/types/models/category-group.ts (1)
  • CategoryGroupEntity (3-11)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/desktop-client/src/hooks/useCategories.ts (2)
packages/desktop-client/src/queries/liveQuery.ts (1)
  • query (43-45)
packages/desktop-client/src/hooks/useCategoriesQuery.ts (1)
  • useCategoriesQuery (5-7)
packages/desktop-client/src/hooks/useCategoriesQuery.ts (2)
packages/desktop-client/src/hooks/useQuery.ts (1)
  • useQuery (13-58)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx (2)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
packages/loot-core/src/server/db/index.ts (1)
  • moveCategory (491-510)
packages/desktop-client/src/components/transactions/TransactionsTable.tsx (4)
packages/desktop-client/src/components/util/GenericInput.jsx (1)
  • categoryGroups (45-45)
packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx (1)
  • categoryGroups (497-497)
packages/loot-core/src/types/models/category-group.ts (1)
  • CategoryGroupEntity (3-11)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx (1)
packages/desktop-client/src/hooks/useCategories.ts (1)
  • useCategories (3-7)
packages/desktop-client/src/components/budget/index.tsx (2)
packages/desktop-client/src/hooks/useBudgetActions.ts (1)
  • useBudgetActions (166-317)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx (2)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
packages/loot-core/src/server/db/index.ts (1)
  • moveCategoryGroup (395-408)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: build (macos-latest)
  • GitHub Check: Functional Desktop App
  • GitHub Check: Wait for Netlify build to finish
  • GitHub Check: Generate VRT Updates
🔇 Additional comments (26)
packages/desktop-client/package.json (1)

23-23: LGTM! React Query dependency added.

The addition of @tanstack/react-query v5.90.5 supports the migration from Redux to React Query for category state management. The version choice is appropriate and aligns with the current stable release.

packages/desktop-client/src/index.tsx (1)

96-98: LGTM! QueryClientProvider properly integrated.

The QueryClientProvider correctly wraps the App component, providing React Query context to the entire application. The placement within the provider hierarchy (inside Redux Provider and ServerProvider) is appropriate.

eslint.config.mjs (2)

157-157: Clarify why react-hooks recommended config is commented out.

The pluginReactHooks.configs.flat.recommended configuration is commented out. This removes default React Hooks linting rules. Could you explain the reason for this change? If there are conflicts with custom rules, consider using the recommended config as a base and overriding specific rules instead.


452-452: LGTM! Exact match pattern for useQuery is more precise.

The change from "(useQuery)" to "(^useQuery$)" correctly anchors the pattern to match exactly "useQuery", preventing false positives with hooks that contain "useQuery" as a substring. This aligns with the learning that only useQuery should be added to the pattern.

Based on learnings.

packages/desktop-client/src/components/budget/BudgetTable.tsx (1)

86-86: LGTM! Default fallback safely removed.

The removal of the default empty array (= []) is safe because useCategories returns query.data! with a non-null assertion, and categoryQueries.list() provides placeholderData: { grouped: [], list: [] }, ensuring categoryGroups is always defined.

packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx (1)

230-230: LGTM! Consistent with placeholderData guarantee.

Similar to BudgetTable.tsx, the removal of the default empty array is safe because useCategories leverages placeholderData to ensure defaultCategoryGroups is always defined. The fallback logic at line 232 (categoryGroups || defaultCategoryGroups) will work correctly.

packages/desktop-client/src/hooks/useCategoriesQuery.ts (1)

1-7: LGTM! Clean React Query wrapper hook.

The useCategoriesQuery hook provides a clean abstraction over categoryQueries.list(), following React Query best practices. This serves as the foundation for the useCategories hook and enables other components to access the full query state (loading, error, etc.) when needed.

packages/desktop-client/src/sync-events.ts (2)

24-24: LGTM! Function signature updated for React Query integration.

The function signature correctly accepts the QueryClient parameter needed for cache invalidation.


76-78: LGTM! Cache invalidation replaces Redux dispatch.

The React Query cache invalidation correctly targets category lists when category-related tables change, replacing the previous Redux reload pattern.

packages/desktop-client/src/hooks/useCategoryGroup.ts (1)

6-10: Verify that query.data is always defined.

The hook returns query.data directly, which could be undefined if the query hasn't loaded yet. However, since categoryQueries.list() provides placeholderData: { grouped: [], list: [] }, this should be safe. The select function will always receive data.

packages/desktop-client/src/components/App.tsx (1)

175-177: LGTM! QueryClient correctly wired into global events.

The queryClient is properly retrieved and passed to handleGlobalEvents, enabling React Query cache invalidation throughout the app.

packages/desktop-client/src/hooks/useCategories.ts (1)

3-6: LGTM! Simplified implementation with React Query.

The hook correctly delegates to useCategoriesQuery() and the non-null assertion is safe due to placeholderData in the query definition.

packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (1)

39-39: LGTM! Mutation-based API correctly replaces Redux dispatch.

The component correctly uses useCategoryMutations() to obtain the moveCategory mutation and calls moveCategory.mutate(...) for drag-and-drop reordering. Error handling and cache invalidation are centralized in the hook.

Also applies to: 84-88, 102-111

packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx (2)

170-170: LGTM! Category data structure updated.

The destructuring correctly extracts the flat list array from the new useCategories() return structure.


278-278: LGTM! All category references updated consistently.

All usages of the categories array have been updated to work with the flat array structure, including:

  • parseCategoryFields calls
  • Array find operations
  • Dependency arrays
  • Props passed to child components

The changes are consistent throughout the file.

Also applies to: 339-341, 354-354, 617-617, 862-862

packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx (1)

28-28: LGTM! Consistent mutation-based API usage.

The component correctly adopts the mutation-based pattern for category reordering, consistent with the ExpenseCategoryList implementation.

Also applies to: 73-77, 91-100

packages/desktop-client/src/global-events.ts (1)

61-65: LGTM: React Query invalidation replaces Redux reload correctly.

Invalidating categoryQueries.lists() on undo matches the new cache strategy.

packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (3)

188-197: Nice migration: multi-template action now uses mutation hook.

Reads well and aligns with React Query invalidation elsewhere.


256-260: Category mutations wired correctly with cache invalidation via hooks.

The switch to hook mutations looks consistent.

Also applies to: 280-283, 292-293


101-106: No changes needed; fire-and-forget pattern is appropriate for all call sites.

Verification confirms that no callers of onBudgetAction() use await, .then(), or .catch(). All 14 call sites are UI event handler callbacks (e.g., onSubmit, onUpdateBudget, onCopyLastMonthAverage) where fire-and-forget semantics with .mutate() are correct. No upstream code depends on mutation completion or error handling from these calls.

packages/desktop-client/src/components/budget/index.tsx (1)

18-21: LGTM: hook-based mutations replace Redux actions cleanly.

Imports and usage of useBudgetActions and useCategoryMutations are consistent with the new data layer.

Also applies to: 62-72

packages/desktop-client/src/hooks/useBudgetActions.ts (1)

301-315: The review comment is incorrect and should be dismissed.

The logger is server-side only (available in loot-core/src/server), not in desktop-client. Per the ESLint rule's implementation, console-to-logger enforcement applies exclusively to files matching packages/loot-core/src/server, and desktop-client code is client-side without access to the logger.

This is confirmed by recent guidance: console methods (console.error, console.log) are acceptable in desktop-client code.

Likely an incorrect or invalid review comment.

packages/desktop-client/src/hooks/useCategoryMutations.ts (1)

82-105: The review comment assumes infrastructure (logger) that doesn't exist in desktop-client and misapplies the error.cause pattern.

The codebase has no client-side logger—the logger found exists only in loot-core (server-side). Additionally, the suggested getErrorCause guard pattern only applies to deleteCategory, which uniquely throws errors with a cause property and checks it via switch statement. The other 7 mutations don't use structured error.cause and simply dispatch generic error notifications.

While adding useMutation generics is a valid suggestion, the core guidance (logger replacement and error.cause guard) doesn't match the actual error handling across these mutations. The console.error statements here serve as debug output only; the real error handling is done via dispatchErrorNotification.

Likely an incorrect or invalid review comment.

packages/desktop-client/src/budget/index.ts (3)

1-13: LGTM! Clean imports and type definitions.

Import order follows guidelines, inline type imports are correct, and using type over interface aligns with TypeScript best practices per coding guidelines.


15-32: Well-structured query configuration.

The hierarchical query key pattern enables targeted cache invalidation, and the staleTime: Infinity approach with manual invalidation (as noted in the comment) is appropriate for category data that changes only through explicit user actions. The placeholder data prevents undefined states during initial loads.


34-53: Solid transformation logic.

The functions correctly handle both the flat category list and nested categories within groups, maintaining immutability through spread operators. The defensive null coalescing on line 39 provides extra safety even though the type signature guarantees list is defined.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/desktop-client/src/hooks/useBudgetActions.ts (1)

12-164: Past review feedback has been addressed.

The discriminated union now correctly uses optional properties (args?: never, month?: never) instead of required never properties, making all variants satisfiable while maintaining type narrowing.

🧹 Nitpick comments (1)
packages/desktop-client/src/hooks/useBudgetActions.ts (1)

1-4: Group external imports together.

The blank line on Line 2 incorrectly separates external imports. Per coding guidelines, all external imports should be grouped together, followed by a single blank line before Actual package imports.

Apply this diff:

 import { useTranslation } from 'react-i18next';
-
 import { useMutation } from '@tanstack/react-query';
 import { v4 as uuidv4 } from 'uuid';
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d16fa2 and 51eaabc.

📒 Files selected for processing (1)
  • packages/desktop-client/src/hooks/useBudgetActions.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Prefer type over interface in TypeScript
Avoid enum; use objects or maps instead
Avoid any and unknown unless absolutely necessary
Avoid type assertions (as, non-null !); prefer satisfies for narrowing
Use inline type imports: import { type X } from '...'
Favor functional/declarative patterns; avoid classes
Use the function keyword for pure functions
Use named exports for components and utilities (avoid default exports except specific cases)
Maintain import order groups (React, Node built-ins, externals, Actual packages, parent, sibling, index) with newlines between groups
Do not directly reference platform-specific imports by extension (.api, .web, .electron)

Files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Do not use console.*; use the logger instead
Import uuid with destructuring: import { v4 as uuidv4 } from 'uuid'

Files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
packages/{desktop-client,component-library}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/{desktop-client,component-library}/src/**/*.{ts,tsx}: All user-facing strings must be translated
Prefer <Trans> component over t() when possible
Do not use React.* namespace imports; use named imports
Use theme tokens; do not import colors directly

Files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
packages/desktop-client/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/desktop-client/src/**/*.{ts,tsx}: Use custom navigation hook from src/hooks instead of react-router directly
Use useDispatch, useSelector, useStore from src/redux (not react-redux)
Use absolute imports in desktop-client

Files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
🧬 Code graph analysis (1)
packages/desktop-client/src/hooks/useBudgetActions.ts (3)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/desktop-client/src/redux/index.ts (1)
  • useDispatch (18-18)
packages/desktop-client/src/notifications/notificationsSlice.ts (1)
  • addNotification (58-68)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: web
  • GitHub Check: build (macos-latest)
  • GitHub Check: Analyze
  • GitHub Check: Wait for Netlify build to finish
  • GitHub Check: Functional Desktop App
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: Generate VRT Updates
  • GitHub Check: validate-cli
  • GitHub Check: test
  • GitHub Check: compare
🔇 Additional comments (1)
packages/desktop-client/src/hooks/useBudgetActions.ts (1)

171-291: Well-structured mutation function with proper type narrowing.

The switch statement comprehensively covers all budget action types with correct type narrowing and appropriate backend calls. The default case provides runtime safety.

@joel-jeremy
joel-jeremy force-pushed the react-query-categories branch from 51eaabc to 858a887 Compare November 6, 2025 17:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx (1)

148-159: Consider refactoring for clarity and efficiency.

The return null on line 152 inside the forEach callback doesn't exit the loop—it only returns from the callback. While the logic produces correct results, it's unclear and inefficient (continues looping even after finding an ID match, and the return null serves no purpose).

Apply this refactor for better clarity:

 function parseCategoryFields(trans, categories) {
+  if (!trans.category) return null;
+  
+  // If already a valid category ID, leave as-is
+  if (categories.some(cat => cat.id === trans.category)) {
+    return null;
+  }
+  
+  // Try to find category by name
+  const match = categories.find(cat => cat.name === trans.category);
+  return match?.id ?? null;
-  let match = null;
-  categories.forEach(category => {
-    if (category.id === trans.category) {
-      return null;
-    }
-    if (category.name === trans.category) {
-      match = category.id;
-    }
-  });
-  return match;
 }
packages/desktop-client/package.json (1)

23-23: LGTM! Consider using a less specific version range.

The addition of @tanstack/react-query aligns with the PR's migration goal. The version ^5.90.5 is quite specific—consider whether ^5.0.0 would be more appropriate to automatically receive patch and minor updates within the v5 range, unless there's a specific reason to pin to 5.90.x.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51eaabc and 858a887.

📒 Files selected for processing (25)
  • eslint.config.mjs (2 hunks)
  • packages/desktop-client/package.json (1 hunks)
  • packages/desktop-client/src/budget/budgetSlice.ts (0 hunks)
  • packages/desktop-client/src/budget/index.ts (1 hunks)
  • packages/desktop-client/src/components/App.tsx (2 hunks)
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/BudgetTable.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/index.tsx (6 hunks)
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (9 hunks)
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (4 hunks)
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx (4 hunks)
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx (6 hunks)
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx (2 hunks)
  • packages/desktop-client/src/global-events.ts (4 hunks)
  • packages/desktop-client/src/hooks/useBudgetActions.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategories.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategory.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoryGroup.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoryMutations.ts (1 hunks)
  • packages/desktop-client/src/index.tsx (3 hunks)
  • packages/desktop-client/src/redux/mock.tsx (0 hunks)
  • packages/desktop-client/src/redux/store.ts (0 hunks)
  • packages/desktop-client/src/sync-events.ts (3 hunks)
💤 Files with no reviewable changes (3)
  • packages/desktop-client/src/redux/store.ts
  • packages/desktop-client/src/redux/mock.tsx
  • packages/desktop-client/src/budget/budgetSlice.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • eslint.config.mjs
  • packages/desktop-client/src/hooks/useCategory.ts
  • packages/desktop-client/src/hooks/useCategoryMutations.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategories.ts
  • packages/desktop-client/src/global-events.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Prefer type over interface in TypeScript
Avoid enum; use objects or maps instead
Avoid any and unknown unless absolutely necessary
Avoid type assertions (as, non-null !); prefer satisfies for narrowing
Use inline type imports: import { type X } from '...'
Favor functional/declarative patterns; avoid classes
Use the function keyword for pure functions
Use named exports for components and utilities (avoid default exports except specific cases)
Maintain import order groups (React, Node built-ins, externals, Actual packages, parent, sibling, index) with newlines between groups
Do not directly reference platform-specific imports by extension (.api, .web, .electron)

Files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/budget/index.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Do not use console.*; use the logger instead
Import uuid with destructuring: import { v4 as uuidv4 } from 'uuid'

Files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/budget/index.tsx
packages/{desktop-client,component-library}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/{desktop-client,component-library}/src/**/*.{ts,tsx}: All user-facing strings must be translated
Prefer <Trans> component over t() when possible
Do not use React.* namespace imports; use named imports
Use theme tokens; do not import colors directly

Files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/budget/index.tsx
packages/{desktop-client,component-library}/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

packages/{desktop-client,component-library}/src/**/*.tsx: Do not use React.FC/React.FunctionComponent; type props directly
Avoid unstable nested components in JSX
Prefer declarative, minimal JSX; avoid unnecessary curly braces and prefer concise conditional expressions (condition && <Component />)

Files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/budget/index.tsx
packages/desktop-client/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use <Link> instead of <a> tags

Files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/budget/index.tsx
packages/desktop-client/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/desktop-client/src/**/*.{ts,tsx}: Use custom navigation hook from src/hooks instead of react-router directly
Use useDispatch, useSelector, useStore from src/redux (not react-redux)
Use absolute imports in desktop-client

Files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/budget/index.tsx
🧠 Learnings (63)
📓 Common learnings
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget mobile app, the callback functions `onEditCategory` (implemented as `onOpenCategoryMenuModal`) and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget app, the callback functions `onEditCategory` and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use `useDispatch`, `useSelector`, `useStore` from `src/redux` (not react-redux)
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/loot-core/src/client/data-hooks/transactions.ts:32-88
Timestamp: 2024-10-22T02:08:48.162Z
Learning: In the React `useTransactions` hook defined in `packages/loot-core/src/client/data-hooks/transactions.ts`, changes to `options` (e.g., `options.pageCount`) should be applied on the next query without adding them to the `useEffect` dependency array, to avoid unnecessary rerenders when options change.
Learnt from: jfdoming
Repo: actualbudget/actual PR: 3402
File: packages/desktop-client/src/components/accounts/Account.tsx:8-8
Timestamp: 2024-09-27T14:15:46.637Z
Learning: In the `AllTransactions` component of `Account.tsx`, the `useLayoutEffect` hook is appropriately used to dispatch an action that closes splits for parent transactions when `prependTransactions` changes, ensuring this occurs synchronously before the component is painted.
📚 Learning: 2024-10-16T03:51:04.683Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3593
File: packages/desktop-client/src/components/sidebar/BudgetName.tsx:114-136
Timestamp: 2024-10-16T03:51:04.683Z
Learning: In 'packages/desktop-client/src/components/sidebar/BudgetName.tsx', empty budget names are handled elsewhere, so additional error handling within the 'EditableBudgetName' component is unnecessary.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-07T11:45:10.127Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3593
File: packages/desktop-client/src/components/sidebar/BudgetName.tsx:64-64
Timestamp: 2024-10-07T11:45:10.127Z
Learning: In `packages/desktop-client/src/components/sidebar/BudgetName.tsx`, when `useMetadataPref('budgetName')` returns `undefined`, the code handles it appropriately without the need to assign a default value to `budgetName`.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
📚 Learning: 2025-03-14T15:11:36.220Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget mobile app, the callback functions `onEditCategory` (implemented as `onOpenCategoryMenuModal`) and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-03-14T15:11:36.220Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget app, the callback functions `onEditCategory` and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-10T02:29:05.655Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3593
File: packages/desktop-client/src/components/sidebar/Sidebar.tsx:112-116
Timestamp: 2024-10-10T02:29:05.655Z
Learning: In `packages/desktop-client/src/components/sidebar/BudgetName.tsx`, the `BudgetName` component consists of three parts: `BudgetName`, `EditBudgetName`, and the Menu. Keeping `EditBudgetName` as a separate component helps maintain cleaner code by separating concerns.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-09-26T19:32:57.858Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 3507
File: packages/desktop-client/src/components/table.tsx:1220-1220
Timestamp: 2024-09-26T19:32:57.858Z
Learning: The `TableNavigator` type in `packages/desktop-client/src/components/table.tsx` is not used outside of this file and can safely be made private by removing the `export` keyword.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
📚 Learning: 2025-06-03T23:19:44.814Z
Learnt from: elijaholmos
Repo: actualbudget/actual PR: 5076
File: packages/desktop-client/src/components/CommandBar.tsx:70-70
Timestamp: 2025-06-03T23:19:44.814Z
Learning: The useReports hook in packages/desktop-client/src/hooks/useReports.ts always returns an array for the data property due to initialData: [] and default value fallback (data: customReports = []), so it never returns undefined and doesn't need additional undefined checks when used.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
📚 Learning: 2025-08-16T16:42:08.306Z
Learnt from: sjones512
Repo: actualbudget/actual PR: 5554
File: packages/desktop-client/src/components/reports/spreadsheets/crossover-spreadsheet.ts:7-8
Timestamp: 2025-08-16T16:42:08.306Z
Learning: In the Actual Budget codebase, it's the established pattern and acceptable to import useSpreadsheet as a type-only import and then use ReturnType<typeof useSpreadsheet> in type annotations. This pattern is used consistently across all spreadsheet files including custom-spreadsheet.ts, grouped-spreadsheet.ts, spending-spreadsheet.ts, net-worth-spreadsheet.ts, cash-flow-spreadsheet.tsx, calendar-spreadsheet.ts, summary-spreadsheet.ts, and crossover-spreadsheet.ts.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-13T11:17:59.711Z
Learnt from: UnderKoen
Repo: actualbudget/actual PR: 3381
File: packages/desktop-client/src/components/budget/SidebarGroup.tsx:69-76
Timestamp: 2024-10-13T11:17:59.711Z
Learning: In the `SidebarGroup` component (`packages/desktop-client/src/components/budget/SidebarGroup.tsx`), context menu state management is handled in another file, ensuring that only one context menu is open at a time.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-05T10:58:55.008Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 3570
File: packages/desktop-client/src/components/modals/ImportTransactionsModal/utils.ts:16-24
Timestamp: 2024-10-05T10:58:55.008Z
Learning: In `packages/desktop-client/src/components/modals/ImportTransactionsModal/utils.ts`, the `parseDate` function's `str` parameter should maintain its current type `string | number | null | Array<unknown> | object`, as narrowing it to `string | null` is not suitable.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/{desktop-client,component-library}/src/**/*.{ts,tsx} : Prefer `<Trans>` component over `t()` when possible

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/App.tsx
📚 Learning: 2024-11-09T20:18:28.468Z
Learnt from: csenel
Repo: actualbudget/actual PR: 3810
File: packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx:150-161
Timestamp: 2024-11-09T20:18:28.468Z
Learning: In `packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx`, prefer to keep the implementation of checks consistent with similar patterns elsewhere in the codebase, even if alternative implementations are more concise.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/{desktop-client,component-library}/src/**/*.{ts,tsx} : Do not use `React.*` namespace imports; use named imports

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-11-04T00:47:00.968Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 6065
File: packages/desktop-client/src/components/transactions/TransactionList.tsx:197-205
Timestamp: 2025-11-04T00:47:00.968Z
Learning: In packages/desktop-client/src/components/transactions/TransactionList.tsx and similar schedule creation code, when using schedule/create with conditions and then updating the rule's actions, it's correct to filter rule.actions to keep only 'link-schedule' and append custom actions. Transactions created by schedules are defined by a mix of conditions (which create the base transaction with date, amount, payee, account) and actions (which apply additional modifications like category, notes, splits). The filtering pattern replaces any auto-generated actions with the desired custom actions.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-22T02:08:48.162Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/loot-core/src/client/data-hooks/transactions.ts:32-88
Timestamp: 2024-10-22T02:08:48.162Z
Learning: In the React `useTransactions` hook defined in `packages/loot-core/src/client/data-hooks/transactions.ts`, changes to `options` (e.g., `options.pageCount`) should be applied on the next query without adding them to the `useEffect` dependency array, to avoid unnecessary rerenders when options change.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
📚 Learning: 2025-09-22T16:56:19.716Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 5770
File: packages/loot-core/src/server/transactions/import/parse-file.ts:58-59
Timestamp: 2025-09-22T16:56:19.716Z
Learning: In the ImportTransactionsModal system, ParseFileResult.transactions?: Transaction[] is correct because the Transaction type includes `& Record<string, string | number | boolean>` which allows CSV raw data to conform to the type, and field mappings (applyFieldMappings) handle transformation from raw CSV columns to transaction fields later in the process.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
📚 Learning: 2024-10-05T10:58:13.598Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 3570
File: packages/desktop-client/src/components/modals/ImportTransactionsModal/Transaction.tsx:83-90
Timestamp: 2024-10-05T10:58:13.598Z
Learning: In the `Transaction` component in `Transaction.tsx`, both `rawTransaction` and `transaction` should be included in the dependency arrays of `useMemo` hooks, even though `transaction` derives from `rawTransaction`.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
📚 Learning: 2024-10-13T23:24:09.179Z
Learnt from: tim-smart
Repo: actualbudget/actual PR: 3343
File: packages/desktop-client/src/components/common/Modal.tsx:86-86
Timestamp: 2024-10-13T23:24:09.179Z
Learning: In `packages/desktop-client/src/components/common/Modal.tsx`, setting `willChange: 'transform'` forces the browser to render the layer with GPU acceleration, improving performance.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
📚 Learning: 2025-06-21T04:15:23.727Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 5207
File: packages/desktop-client/src/components/transactions/TransactionsTable.tsx:2194-2201
Timestamp: 2025-06-21T04:15:23.727Z
Learning: In TransactionsTable.tsx, the balance calculation using find() to locate the first non-scheduled transaction is acceptable for performance because: 1) the component only renders when adding transactions (limited usage), 2) find() short-circuits on first match, and 3) scheduled transactions are typically sparse in the transaction list.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
📚 Learning: 2025-01-17T12:00:27.629Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 4170
File: packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx:570-581
Timestamp: 2025-01-17T12:00:27.629Z
Learning: The transaction amount conversion for income categories in TransactionEdit.jsx is intended as a quality-of-life feature to help users who forget to set the correct direction, not as a preventative measure. Users should still be able to manually enter negative amounts even for income categories.

Applied to files:

  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use `useDispatch`, `useSelector`, `useStore` from `src/redux` (not react-redux)

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-04T05:13:58.322Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3554
File: packages/desktop-client/src/components/sidebar/Accounts.tsx:60-64
Timestamp: 2024-10-04T05:13:58.322Z
Learning: The `onReorder` function in `Accounts.tsx` was moved from `Sidebar.tsx`, and the `targetId` parameter remains typed as `unknown` intentionally.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-10-12T04:07:06.002Z
Learnt from: lelemm
Repo: actualbudget/actual PR: 5786
File: packages/api/tsconfig.dist.json:14-14
Timestamp: 2025-10-12T04:07:06.002Z
Learning: In the Actual Budget codebase, when rootDir is removed from packages/loot-core/tsconfig.api.json to allow referencing files outside the loot-core directory, the declaration output structure changes. The path alias for loot-core in packages/api/tsconfig.dist.json must be updated from "./types/loot-core/src/*" to "./types/loot-core/loot-core/src/*" to match the new emitted declaration paths, as TypeScript preserves the full directory structure from the project root when rootDir is not specified.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use custom navigation hook from `src/hooks` instead of react-router directly

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-09-27T14:15:46.637Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 3402
File: packages/desktop-client/src/components/accounts/Account.tsx:8-8
Timestamp: 2024-09-27T14:15:46.637Z
Learning: In the `AllTransactions` component of `Account.tsx`, the `useLayoutEffect` hook is appropriately used to dispatch an action that closes splits for parent transactions when `prependTransactions` changes, ensuring this occurs synchronously before the component is painted.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-22T05:32:30.530Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/schedules/index.tsx:37-39
Timestamp: 2024-10-22T05:32:30.530Z
Learning: In our React function components, we should include `dispatch` in the dependency array of `useCallback` hooks to comply with ESLint rules, even though `dispatch` is a stable function.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
📚 Learning: 2024-10-22T05:32:57.033Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/schedules/index.tsx:33-35
Timestamp: 2024-10-22T05:32:57.033Z
Learning: In the project's React components, when using `dispatch` from `useDispatch` in `useCallback` or `useEffect` hooks, `dispatch` must be included in the dependency array due to the `react-hooks/exhaustive-deps` ESLint rule.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
📚 Learning: 2024-10-22T05:32:55.520Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/schedules/index.tsx:26-31
Timestamp: 2024-10-22T05:32:55.520Z
Learning: In this codebase, ESLint requires `dispatch` from `useDispatch` to be included in the dependency array of `useCallback` hooks, even though `dispatch` is stable.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
📚 Learning: 2024-10-18T15:33:24.453Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: .eslintrc.js:164-169
Timestamp: 2024-10-18T15:33:24.453Z
Learning: When updating the `additionalHooks` pattern for `react-hooks/exhaustive-deps`, only `useQuery` should be added, not generalized patterns.

Applied to files:

  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/App.tsx
📚 Learning: 2025-06-03T23:19:44.814Z
Learnt from: elijaholmos
Repo: actualbudget/actual PR: 5076
File: packages/desktop-client/src/components/CommandBar.tsx:70-70
Timestamp: 2025-06-03T23:19:44.814Z
Learning: The useReports hook in packages/desktop-client/src/hooks/useReports.ts always returns an array for the data property due to the ternary operator at line 62: `queryData ? [...queryData] : []`, ensuring data is never undefined even if the underlying query returns undefined.

Applied to files:

  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
📚 Learning: 2024-10-18T15:37:01.917Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/loot-core/src/client/data-hooks/reports.ts:8-8
Timestamp: 2024-10-18T15:37:01.917Z
Learning: Within the codebase, `useLiveQuery` is a wrapper around `useQuery` that only returns the data, omitting other properties from `useQuery`.

Applied to files:

  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use absolute imports in desktop-client

Applied to files:

  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/sync-events.ts
📚 Learning: 2024-10-24T17:05:41.415Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/accounts/Account.tsx:655-665
Timestamp: 2024-10-24T17:05:41.415Z
Learning: The Account component in 'packages/desktop-client/src/components/accounts/Account.tsx' is being rewritten in a separate PR.

Applied to files:

  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/sync-events.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/{desktop-client,component-library}/src/**/*.tsx : Do not use `React.FC`/`React.FunctionComponent`; type props directly

Applied to files:

  • packages/desktop-client/src/components/App.tsx
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/{desktop-client,component-library}/src/**/*.tsx : Avoid unstable nested components in JSX

Applied to files:

  • packages/desktop-client/src/components/App.tsx
📚 Learning: 2024-10-16T03:46:34.277Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3593
File: packages/desktop-client/src/components/sidebar/BudgetName.tsx:151-165
Timestamp: 2024-10-16T03:46:34.277Z
Learning: In `packages/desktop-client/src/components/sidebar/BudgetName.tsx`, `media` is not implemented on `<Button>` components at this time.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
📚 Learning: 2025-10-24T21:29:26.090Z
Learnt from: csenel
Repo: actualbudget/actual PR: 5991
File: packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx:82-89
Timestamp: 2025-10-24T21:29:26.090Z
Learning: Notification messages in BudgetCell.tsx will be translated in a separate PR to handle all translations together, as there are multiple messages to go through.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-01-18T20:08:55.203Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 4181
File: packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx:252-254
Timestamp: 2025-01-18T20:08:55.203Z
Learning: Notification messages in BudgetTable.jsx will be translated in a separate PR to handle all translations together, as there are multiple messages to go through.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
📚 Learning: 2024-11-12T18:18:07.282Z
Learnt from: lelemm
Repo: actualbudget/actual PR: 3828
File: packages/desktop-client/src/components/reports/reports/Calendar.tsx:575-631
Timestamp: 2024-11-12T18:18:07.282Z
Learning: In `Calendar.tsx`, transaction-related callbacks such as `onBatchDelete`, `onBatchDuplicate`, `onCreateRule`, and `onScheduleAction` are intentionally left as empty functions because these operations should not be usable on that page.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-01-17T18:05:12.337Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 4180
File: packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx:312-318
Timestamp: 2025-01-17T18:05:12.337Z
Learning: In the Actual Budget codebase, the schedule action handlers (onPost, onSkip, onComplete) in AccountTransactions.tsx follow a consistent pattern without explicit try-catch blocks, letting errors propagate up the call stack.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-05-25T19:03:39.815Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 5060
File: packages/loot-core/typings/window.ts:1-1
Timestamp: 2025-05-25T19:03:39.815Z
Learning: The project follows an incremental approach to TypeScript strict mode migration. During the conversion from .d.ts to .ts files, temporary `// ts-strict-ignore` directives are acceptable to keep PRs manageable in size, with the intention to address strict mode violations in future PRs.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to **/*.{ts,tsx} : Avoid `any` and `unknown` unless absolutely necessary

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-06-16T17:45:40.807Z
Learnt from: misu-dev
Repo: actualbudget/actual PR: 5167
File: packages/desktop-client/src/components/spreadsheet/useFormat.ts:64-72
Timestamp: 2025-06-16T17:45:40.807Z
Learning: The user misu-dev prefers strict type checking for financial format types in useFormat.ts as a long-term goal, but acknowledges that creating follow-up issues for cleanup should wait until after the current PR is merged, not during the development phase.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to **/*.{ts,tsx} : Avoid type assertions (`as`, non-null `!`); prefer `satisfies` for narrowing

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-10-23T16:53:06.163Z
Learnt from: youngcw
Repo: actualbudget/actual PR: 3714
File: packages/loot-core/src/server/budget/goaltemplates.ts:684-688
Timestamp: 2024-10-23T16:53:06.163Z
Learning: In `packages/loot-core/src/server/budget/goaltemplates.ts`, when calculating the number of days in a month for daily limits, using `monthUtils.differenceInCalendarDays(monthUtils.addMonths(month, 1), month)` is correct and adding 1 is not required.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-09-22T20:22:12.747Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 5770
File: packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx:229-230
Timestamp: 2025-09-22T20:22:12.747Z
Learning: MatissJanis prefers to keep TypeScript conversion PRs focused on just the TS upgrade without additional patches/improvements to maintain manageable PR scope.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-12-18T20:24:07.779Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 3958
File: packages/loot-core/src/shared/schedules.ts:279-280
Timestamp: 2024-12-18T20:24:07.779Z
Learning: User states the `amount` is not intended to be null or undefined, and the current type signature should remain unchanged, as the null checks are just a stop-gap measure to prevent crashes.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-10-22T00:50:31.002Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 5978
File: packages/desktop-client/src/components/mobile/banksync/MobileBankSyncAccountEditPage.tsx:54-57
Timestamp: 2025-10-22T00:50:31.002Z
Learning: The logger should only be used in loot-core code. In desktop-client code, using console methods (console.error, console.log, etc.) is acceptable.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Do not use `console.*`; use the logger instead

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-10-24T05:09:44.115Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3689
File: packages/loot-core/src/server/backups.web.ts:203-207
Timestamp: 2024-10-24T05:09:44.115Z
Learning: In `packages/loot-core/src/server/backups.web.ts`, developers prefer to keep the error handling for cloud storage uploads inline rather than extracting it into a separate function. Avoid suggesting this refactoring in future reviews.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2025-10-27T17:06:08.172Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 6010
File: packages/sync-server/src/app-sync.ts:331-331
Timestamp: 2025-10-27T17:06:08.172Z
Learning: The logger should only be used in loot-core code. In sync-server code (packages/sync-server), using console methods (console.error, console.log, etc.) is acceptable.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-10-23T07:39:50.053Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3689
File: packages/loot-core/src/server/main.ts:1873-1877
Timestamp: 2024-10-23T07:39:50.053Z
Learning: In the `duplicate-budget` function in `packages/loot-core/src/server/main.ts`, when `loadBudget` returns an object with an `error` property where `error` is a string, returning `error` directly is consistent with the function's declared return type `Promise<string>`.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-11-04T00:34:13.035Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 3581
File: packages/loot-core/src/client/actions/account.ts:180-194
Timestamp: 2024-11-04T00:34:13.035Z
Learning: In `packages/loot-core/src/client/actions/account.ts`, within the `syncAccounts` function, the batch sync request for SimpleFin accounts handles errors by returning error objects instead of throwing exceptions. Therefore, wrapping this block in a try-catch is unnecessary.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-10-23T07:38:25.699Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3689
File: packages/loot-core/src/server/main.ts:1807-1809
Timestamp: 2024-10-23T07:38:25.699Z
Learning: In the function `delete-budget` in `packages/loot-core/src/server/main.ts`, the function `removeAllBackups(id)` handles its own errors internally, so additional error handling when calling it is unnecessary.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-10-12T19:13:25.005Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 3641
File: packages/loot-core/src/server/accounts/rules.test.ts:524-536
Timestamp: 2024-10-12T19:13:25.005Z
Learning: In `packages/loot-core/src/server/accounts/rules.test.ts`, prefer explicit action definitions over refactoring similar actions into loops or helper functions, even when actions are similar.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-11-26T13:07:02.794Z
Learnt from: lelemm
Repo: actualbudget/actual PR: 3891
File: packages/loot-core/src/shared/rules.ts:209-212
Timestamp: 2024-11-26T13:07:02.794Z
Learning: The file `packages/loot-core/src/shared/rules.ts` is not yet translated, so internationalization using the `t()` function is not required here.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
📚 Learning: 2024-10-08T15:46:15.739Z
Learnt from: qedi-r
Repo: actualbudget/actual PR: 3527
File: packages/desktop-client/src/components/accounts/Header.jsx:0-0
Timestamp: 2024-10-08T15:46:15.739Z
Learning: In the Actual Budget project, importing `t` directly from 'i18next' is best avoided, and we should almost always prefer using the useTranslation hook if possible.

Applied to files:

  • packages/desktop-client/src/hooks/useBudgetActions.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-01-18T03:51:56.741Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 4147
File: packages/loot-core/src/platform/client/fetch/index.d.ts:44-45
Timestamp: 2025-01-18T03:51:56.741Z
Learning: Query results in `packages/loot-core/src/platform/client/fetch/index.d.ts` are intentionally typed as `any` due to their complex and varied nature (could be numbers, strings, or other types). While this could be improved with stricter types in the future, it requires significant work to properly type all possible Query results.

Applied to files:

  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/budget/index.ts
📚 Learning: 2025-10-12T04:00:51.978Z
Learnt from: lelemm
Repo: actualbudget/actual PR: 5786
File: packages/plugins-core/vite.config.mts:27-35
Timestamp: 2025-10-12T04:00:51.978Z
Learning: In the Actual Budget plugins architecture, the actual-app/plugins-core package is designed to be self-contained. Plugin authors should only need to install actual-app/plugins-core, which bundles the internal monorepo packages (actual-app/shared-types, actual-app/query, actual-app/components) at build time. Only common dependencies like React, React-DOM, and i18next are kept as peerDependencies/externals to avoid duplication with the host application.

Applied to files:

  • packages/desktop-client/package.json
📚 Learning: 2025-09-30T19:23:01.635Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 5821
File: packages/desktop-client/src/components/accounts/BalanceHistoryGraph.tsx:76-91
Timestamp: 2025-09-30T19:23:01.635Z
Learning: In the Actual Budget codebase, `query.transactions(undefined)` correctly handles the "all accounts" view and is the proper way to query all transactions, as opposed to using `q('transactions')` with filters directly.

Applied to files:

  • packages/desktop-client/src/budget/index.ts
📚 Learning: 2025-08-16T16:42:08.306Z
Learnt from: sjones512
Repo: actualbudget/actual PR: 5554
File: packages/desktop-client/src/components/reports/spreadsheets/crossover-spreadsheet.ts:7-8
Timestamp: 2025-08-16T16:42:08.306Z
Learning: In the Actual Budget codebase, it's acceptable and consistent to import useSpreadsheet as a type-only import and then use ReturnType<typeof useSpreadsheet> in type annotations. This pattern is used consistently across spreadsheet files like custom-spreadsheet.ts and crossover-spreadsheet.ts.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-08-17T13:48:35.570Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 5533
File: packages/desktop-client/src/components/modals/BudgetAutomationsModal.tsx:116-131
Timestamp: 2025-08-17T13:48:35.570Z
Learning: In the Actual Budget app, the BudgetAutomationsModal's send() calls for 'budget/set-category-automations' have adequate error handling through the global error handling system that shows toast notifications, as confirmed by direct testing where manually injected errors resulted in appropriate toast notifications to the user.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
🧬 Code graph analysis (11)
packages/desktop-client/src/components/budget/BudgetTable.tsx (1)
packages/desktop-client/src/hooks/useCategories.ts (1)
  • useCategories (3-7)
packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx (1)
packages/desktop-client/src/hooks/useCategories.ts (1)
  • useCategories (3-7)
packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (2)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
packages/loot-core/src/server/db/index.ts (1)
  • moveCategory (491-510)
packages/desktop-client/src/hooks/useCategoriesQuery.ts (2)
packages/desktop-client/src/hooks/useQuery.ts (1)
  • useQuery (13-58)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/hooks/useCategoryGroup.ts (1)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/components/App.tsx (1)
packages/desktop-client/src/global-events.ts (1)
  • handleGlobalEvents (21-174)
packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (2)
packages/desktop-client/src/hooks/useBudgetActions.ts (1)
  • useBudgetActions (169-322)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
packages/desktop-client/src/hooks/useBudgetActions.ts (4)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/loot-core/src/shared/util.ts (1)
  • IntegerAmount (396-396)
packages/desktop-client/src/redux/index.ts (1)
  • useDispatch (18-18)
packages/desktop-client/src/notifications/notificationsSlice.ts (1)
  • addNotification (58-68)
packages/desktop-client/src/sync-events.ts (2)
packages/desktop-client/src/redux/store.ts (2)
  • store (80-87)
  • AppStore (89-89)
packages/desktop-client/src/budget/index.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/budget/index.ts (2)
packages/loot-core/src/types/models/category-group.ts (1)
  • CategoryGroupEntity (3-11)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/desktop-client/src/components/budget/index.tsx (2)
packages/desktop-client/src/hooks/useBudgetActions.ts (1)
  • useBudgetActions (169-322)
packages/desktop-client/src/hooks/useCategoryMutations.ts (1)
  • useCategoryMutations (59-234)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: server
  • GitHub Check: crdt
  • GitHub Check: web
  • GitHub Check: Analyze
  • GitHub Check: api
  • GitHub Check: Generate VRT Updates
  • GitHub Check: autofix
  • GitHub Check: test
  • GitHub Check: validate-cli
  • GitHub Check: lint
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (windows-latest)
  • GitHub Check: typecheck
  • GitHub Check: Functional Desktop App
  • GitHub Check: Wait for Netlify build to finish
  • GitHub Check: compare

jfdoming
jfdoming previously approved these changes Nov 8, 2025

@jfdoming jfdoming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that this seems a lot better, less state to manage! Suggest getting a few others to look as well, I tested most budget-related actions and all seemed good but would be good to get more eyes

Comment thread eslint.config.mjs Resolved
transferId?: CategoryGroupEntity['id'] | null;
};

export function useCategoryMutations() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason to declare these all in one hook rather than provide individual hooks for each mutation? Seems like a lot of extra code run in components that don't use all mutations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I have split the mutations into their own hooks.

@jfdoming

jfdoming commented Nov 8, 2025 •

Copy link
Copy Markdown
Member

One thing, have you had a chance to compare this to RTK Query?

@netlify

netlify Bot commented Nov 10, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for actual-docs-new canceled.

Name Link
🔨 Latest commit 9661c0d
🔍 Latest deploy log https://app.netlify.com/projects/actual-docs-new/deploys/691257b40531e800085efb10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/desktop-client/src/components/budget/BudgetTable.tsx (1)

87-87: Consider keeping the default value for defensive programming.

While the useCategories hook uses placeholderData to ensure grouped is always defined, removing the fallback = [] makes the code more fragile. If the query ever returns unexpected data, this will cause runtime errors at lines 112, 120, 136, 156, 164, and 230 where categoryGroups is accessed without null checks.

Restore the default value:

-  const { grouped: categoryGroups } = useCategories();
+  const { grouped: categoryGroups = [] } = useCategories();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 858a887 and b90706c.

📒 Files selected for processing (25)
  • eslint.config.mjs (1 hunks)
  • packages/desktop-client/package.json (1 hunks)
  • packages/desktop-client/src/budget/budgetSlice.ts (0 hunks)
  • packages/desktop-client/src/budget/index.ts (1 hunks)
  • packages/desktop-client/src/budget/mutations.ts (1 hunks)
  • packages/desktop-client/src/budget/queries.ts (1 hunks)
  • packages/desktop-client/src/components/App.tsx (2 hunks)
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/BudgetTable.tsx (1 hunks)
  • packages/desktop-client/src/components/budget/index.tsx (6 hunks)
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx (9 hunks)
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (4 hunks)
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx (4 hunks)
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx (4 hunks)
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx (6 hunks)
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx (2 hunks)
  • packages/desktop-client/src/global-events.ts (4 hunks)
  • packages/desktop-client/src/hooks/useCategories.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategory.ts (1 hunks)
  • packages/desktop-client/src/hooks/useCategoryGroup.ts (1 hunks)
  • packages/desktop-client/src/index.tsx (3 hunks)
  • packages/desktop-client/src/redux/mock.tsx (0 hunks)
  • packages/desktop-client/src/redux/store.ts (0 hunks)
  • packages/desktop-client/src/sync-events.ts (3 hunks)
💤 Files with no reviewable changes (3)
  • packages/desktop-client/src/budget/budgetSlice.ts
  • packages/desktop-client/src/redux/mock.tsx
  • packages/desktop-client/src/redux/store.ts
🚧 Files skipped from review as they are similar to previous changes (12)
  • packages/desktop-client/src/hooks/useCategory.ts
  • packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.tsx
  • packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
  • packages/desktop-client/src/components/App.tsx
  • packages/desktop-client/src/budget/index.ts
  • packages/desktop-client/src/components/transactions/TransactionsTable.tsx
  • packages/desktop-client/src/global-events.ts
  • packages/desktop-client/src/hooks/useCategories.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseGroupList.tsx
  • packages/desktop-client/src/sync-events.ts
  • packages/desktop-client/src/index.tsx
  • packages/desktop-client/src/components/mobile/budget/BudgetPage.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Prefer type over interface in TypeScript
Avoid enum; use objects or maps instead
Avoid any and unknown unless absolutely necessary
Avoid type assertions (as, non-null !); prefer satisfies for narrowing
Use inline type imports: import { type X } from '...'
Favor functional/declarative patterns; avoid classes
Use the function keyword for pure functions
Use named exports for components and utilities (avoid default exports except specific cases)
Maintain import order groups (React, Node built-ins, externals, Actual packages, parent, sibling, index) with newlines between groups
Do not directly reference platform-specific imports by extension (.api, .web, .electron)

Files:

  • packages/desktop-client/src/budget/queries.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Do not use console.*; use the logger instead
Import uuid with destructuring: import { v4 as uuidv4 } from 'uuid'

Files:

  • packages/desktop-client/src/budget/queries.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
packages/{desktop-client,component-library}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/{desktop-client,component-library}/src/**/*.{ts,tsx}: All user-facing strings must be translated
Prefer <Trans> component over t() when possible
Do not use React.* namespace imports; use named imports
Use theme tokens; do not import colors directly

Files:

  • packages/desktop-client/src/budget/queries.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
packages/desktop-client/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/desktop-client/src/**/*.{ts,tsx}: Use custom navigation hook from src/hooks instead of react-router directly
Use useDispatch, useSelector, useStore from src/redux (not react-redux)
Use absolute imports in desktop-client

Files:

  • packages/desktop-client/src/budget/queries.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
packages/{desktop-client,component-library}/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

packages/{desktop-client,component-library}/src/**/*.tsx: Do not use React.FC/React.FunctionComponent; type props directly
Avoid unstable nested components in JSX
Prefer declarative, minimal JSX; avoid unnecessary curly braces and prefer concise conditional expressions (condition && <Component />)

Files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
packages/desktop-client/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use <Link> instead of <a> tags

Files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
🧠 Learnings (35)
📓 Common learnings
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget mobile app, the callback functions `onEditCategory` (implemented as `onOpenCategoryMenuModal`) and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget app, the callback functions `onEditCategory` and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/loot-core/src/client/data-hooks/transactions.ts:32-88
Timestamp: 2024-10-22T02:08:48.162Z
Learning: In the React `useTransactions` hook defined in `packages/loot-core/src/client/data-hooks/transactions.ts`, changes to `options` (e.g., `options.pageCount`) should be applied on the next query without adding them to the `useEffect` dependency array, to avoid unnecessary rerenders when options change.
📚 Learning: 2024-10-10T02:29:05.655Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3593
File: packages/desktop-client/src/components/sidebar/Sidebar.tsx:112-116
Timestamp: 2024-10-10T02:29:05.655Z
Learning: In `packages/desktop-client/src/components/sidebar/BudgetName.tsx`, the `BudgetName` component consists of three parts: `BudgetName`, `EditBudgetName`, and the Menu. Keeping `EditBudgetName` as a separate component helps maintain cleaner code by separating concerns.

Applied to files:

  • packages/desktop-client/src/budget/queries.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
📚 Learning: 2025-01-18T03:51:56.741Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 4147
File: packages/loot-core/src/platform/client/fetch/index.d.ts:44-45
Timestamp: 2025-01-18T03:51:56.741Z
Learning: Query results in `packages/loot-core/src/platform/client/fetch/index.d.ts` are intentionally typed as `any` due to their complex and varied nature (could be numbers, strings, or other types). While this could be improved with stricter types in the future, it requires significant work to properly type all possible Query results.

Applied to files:

  • packages/desktop-client/src/budget/queries.ts
📚 Learning: 2024-10-22T02:08:48.162Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/loot-core/src/client/data-hooks/transactions.ts:32-88
Timestamp: 2024-10-22T02:08:48.162Z
Learning: In the React `useTransactions` hook defined in `packages/loot-core/src/client/data-hooks/transactions.ts`, changes to `options` (e.g., `options.pageCount`) should be applied on the next query without adding them to the `useEffect` dependency array, to avoid unnecessary rerenders when options change.

Applied to files:

  • packages/desktop-client/src/budget/queries.ts
  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • eslint.config.mjs
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/budget/mutations.ts
📚 Learning: 2025-09-30T19:23:01.635Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 5821
File: packages/desktop-client/src/components/accounts/BalanceHistoryGraph.tsx:76-91
Timestamp: 2025-09-30T19:23:01.635Z
Learning: In the Actual Budget codebase, `query.transactions(undefined)` correctly handles the "all accounts" view and is the proper way to query all transactions, as opposed to using `q('transactions')` with filters directly.

Applied to files:

  • packages/desktop-client/src/budget/queries.ts
📚 Learning: 2025-10-12T04:00:51.978Z
Learnt from: lelemm
Repo: actualbudget/actual PR: 5786
File: packages/plugins-core/vite.config.mts:27-35
Timestamp: 2025-10-12T04:00:51.978Z
Learning: In the Actual Budget plugins architecture, the actual-app/plugins-core package is designed to be self-contained. Plugin authors should only need to install actual-app/plugins-core, which bundles the internal monorepo packages (actual-app/shared-types, actual-app/query, actual-app/components) at build time. Only common dependencies like React, React-DOM, and i18next are kept as peerDependencies/externals to avoid duplication with the host application.

Applied to files:

  • packages/desktop-client/package.json
📚 Learning: 2025-03-14T15:11:36.220Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget app, the callback functions `onEditCategory` and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).

Applied to files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
📚 Learning: 2025-03-14T15:11:36.220Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 4484
File: packages/desktop-client/src/components/mobile/budget/ExpenseGroup.tsx:0-0
Timestamp: 2025-03-14T15:11:36.220Z
Learning: In the Actual Budget mobile app, the callback functions `onEditCategory` (implemented as `onOpenCategoryMenuModal`) and `onBudgetAction` are already properly memoized with useCallback in the Budget component (packages/desktop-client/src/components/mobile/budget/index.tsx).

Applied to files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use custom navigation hook from `src/hooks` instead of react-router directly

Applied to files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-18T15:33:24.453Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: .eslintrc.js:164-169
Timestamp: 2024-10-18T15:33:24.453Z
Learning: When updating the `additionalHooks` pattern for `react-hooks/exhaustive-deps`, only `useQuery` should be added, not generalized patterns.

Applied to files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • eslint.config.mjs
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use `useDispatch`, `useSelector`, `useStore` from `src/redux` (not react-redux)

Applied to files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-18T15:37:01.917Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/loot-core/src/client/data-hooks/reports.ts:8-8
Timestamp: 2024-10-18T15:37:01.917Z
Learning: Within the codebase, `useLiveQuery` is a wrapper around `useQuery` that only returns the data, omitting other properties from `useQuery`.

Applied to files:

  • packages/desktop-client/src/hooks/useCategoryGroup.ts
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
📚 Learning: 2025-01-16T14:28:00.133Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 4166
File: packages/loot-core/src/client/data-hooks/transactions.ts:258-258
Timestamp: 2025-01-16T14:28:00.133Z
Learning: Variables defined within React hooks like `useMemo` or `useEffect` are not dependencies of other hooks. Only external variables and values from the component scope need to be included in the dependency arrays.

Applied to files:

  • eslint.config.mjs
📚 Learning: 2024-10-22T05:32:55.520Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/schedules/index.tsx:26-31
Timestamp: 2024-10-22T05:32:55.520Z
Learning: In this codebase, ESLint requires `dispatch` from `useDispatch` to be included in the dependency array of `useCallback` hooks, even though `dispatch` is stable.

Applied to files:

  • eslint.config.mjs
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
📚 Learning: 2024-10-22T05:32:57.033Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/schedules/index.tsx:33-35
Timestamp: 2024-10-22T05:32:57.033Z
Learning: In the project's React components, when using `dispatch` from `useDispatch` in `useCallback` or `useEffect` hooks, `dispatch` must be included in the dependency array due to the `react-hooks/exhaustive-deps` ESLint rule.

Applied to files:

  • eslint.config.mjs
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
📚 Learning: 2024-10-22T05:34:56.976Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx:261-277
Timestamp: 2024-10-22T05:34:56.976Z
Learning: In React components (TypeScript), avoid using hooks like `useCallback` inside callbacks or nested functions. Hooks must be called at the top level of functional components.

Applied to files:

  • eslint.config.mjs
📚 Learning: 2024-10-22T05:32:30.530Z
Learnt from: joel-jeremy
Repo: actualbudget/actual PR: 3685
File: packages/desktop-client/src/components/schedules/index.tsx:37-39
Timestamp: 2024-10-22T05:32:30.530Z
Learning: In our React function components, we should include `dispatch` in the dependency array of `useCallback` hooks to comply with ESLint rules, even though `dispatch` is a stable function.

Applied to files:

  • eslint.config.mjs
  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
📚 Learning: 2024-10-16T03:51:04.683Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3593
File: packages/desktop-client/src/components/sidebar/BudgetName.tsx:114-136
Timestamp: 2024-10-16T03:51:04.683Z
Learning: In 'packages/desktop-client/src/components/sidebar/BudgetName.tsx', empty budget names are handled elsewhere, so additional error handling within the 'EditableBudgetName' component is unnecessary.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
  • packages/desktop-client/src/budget/mutations.ts
📚 Learning: 2024-10-04T05:13:58.322Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3554
File: packages/desktop-client/src/components/sidebar/Accounts.tsx:60-64
Timestamp: 2024-10-04T05:13:58.322Z
Learning: The `onReorder` function in `Accounts.tsx` was moved from `Sidebar.tsx`, and the `targetId` parameter remains typed as `unknown` intentionally.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-10-12T04:07:06.002Z
Learnt from: lelemm
Repo: actualbudget/actual PR: 5786
File: packages/api/tsconfig.dist.json:14-14
Timestamp: 2025-10-12T04:07:06.002Z
Learning: In the Actual Budget codebase, when rootDir is removed from packages/loot-core/tsconfig.api.json to allow referencing files outside the loot-core directory, the declaration output structure changes. The path alias for loot-core in packages/api/tsconfig.dist.json must be updated from "./types/loot-core/src/*" to "./types/loot-core/loot-core/src/*" to match the new emitted declaration paths, as TypeScript preserves the full directory structure from the project root when rootDir is not specified.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/{desktop-client,component-library}/src/**/*.{ts,tsx} : Do not use `React.*` namespace imports; use named imports

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-10-21T06:59:54.870Z
Learnt from: CR
Repo: actualbudget/actual PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T06:59:54.870Z
Learning: Applies to packages/desktop-client/src/**/*.{ts,tsx} : Use absolute imports in desktop-client

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-09-27T14:15:46.637Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 3402
File: packages/desktop-client/src/components/accounts/Account.tsx:8-8
Timestamp: 2024-09-27T14:15:46.637Z
Learning: In the `AllTransactions` component of `Account.tsx`, the `useLayoutEffect` hook is appropriately used to dispatch an action that closes splits for parent transactions when `prependTransactions` changes, ensuring this occurs synchronously before the component is painted.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx
  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-06-03T23:19:44.814Z
Learnt from: elijaholmos
Repo: actualbudget/actual PR: 5076
File: packages/desktop-client/src/components/CommandBar.tsx:70-70
Timestamp: 2025-06-03T23:19:44.814Z
Learning: The useReports hook in packages/desktop-client/src/hooks/useReports.ts always returns an array for the data property due to the ternary operator at line 62: `queryData ? [...queryData] : []`, ensuring data is never undefined even if the underlying query returns undefined.

Applied to files:

  • packages/desktop-client/src/hooks/useCategoriesQuery.ts
📚 Learning: 2025-11-04T00:47:00.968Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 6065
File: packages/desktop-client/src/components/transactions/TransactionList.tsx:197-205
Timestamp: 2025-11-04T00:47:00.968Z
Learning: In packages/desktop-client/src/components/transactions/TransactionList.tsx and similar schedule creation code, when using schedule/create with conditions and then updating the rule's actions, it's correct to filter rule.actions to keep only 'link-schedule' and append custom actions. Transactions created by schedules are defined by a mix of conditions (which create the base transaction with date, amount, payee, account) and actions (which apply additional modifications like category, notes, splits). The filtering pattern replaces any auto-generated actions with the desired custom actions.

Applied to files:

  • packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx
  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/budget/mutations.ts
📚 Learning: 2025-08-16T16:42:08.306Z
Learnt from: sjones512
Repo: actualbudget/actual PR: 5554
File: packages/desktop-client/src/components/reports/spreadsheets/crossover-spreadsheet.ts:7-8
Timestamp: 2025-08-16T16:42:08.306Z
Learning: In the Actual Budget codebase, it's the established pattern and acceptable to import useSpreadsheet as a type-only import and then use ReturnType<typeof useSpreadsheet> in type annotations. This pattern is used consistently across all spreadsheet files including custom-spreadsheet.ts, grouped-spreadsheet.ts, spending-spreadsheet.ts, net-worth-spreadsheet.ts, cash-flow-spreadsheet.tsx, calendar-spreadsheet.ts, summary-spreadsheet.ts, and crossover-spreadsheet.ts.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-13T11:17:59.711Z
Learnt from: UnderKoen
Repo: actualbudget/actual PR: 3381
File: packages/desktop-client/src/components/budget/SidebarGroup.tsx:69-76
Timestamp: 2024-10-13T11:17:59.711Z
Learning: In the `SidebarGroup` component (`packages/desktop-client/src/components/budget/SidebarGroup.tsx`), context menu state management is handled in another file, ensuring that only one context menu is open at a time.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
📚 Learning: 2024-10-08T15:46:15.739Z
Learnt from: qedi-r
Repo: actualbudget/actual PR: 3527
File: packages/desktop-client/src/components/accounts/Header.jsx:0-0
Timestamp: 2024-10-08T15:46:15.739Z
Learning: In the Actual Budget project, importing `t` directly from 'i18next' is best avoided, and we should almost always prefer using the useTranslation hook if possible.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-10-07T11:45:10.127Z
Learnt from: tlesicka
Repo: actualbudget/actual PR: 3593
File: packages/desktop-client/src/components/sidebar/BudgetName.tsx:64-64
Timestamp: 2024-10-07T11:45:10.127Z
Learning: In `packages/desktop-client/src/components/sidebar/BudgetName.tsx`, when `useMetadataPref('budgetName')` returns `undefined`, the code handles it appropriately without the need to assign a default value to `budgetName`.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
  • packages/desktop-client/src/components/budget/BudgetTable.tsx
📚 Learning: 2025-08-16T16:42:08.306Z
Learnt from: sjones512
Repo: actualbudget/actual PR: 5554
File: packages/desktop-client/src/components/reports/spreadsheets/crossover-spreadsheet.ts:7-8
Timestamp: 2025-08-16T16:42:08.306Z
Learning: In the Actual Budget codebase, it's acceptable and consistent to import useSpreadsheet as a type-only import and then use ReturnType<typeof useSpreadsheet> in type annotations. This pattern is used consistently across spreadsheet files like custom-spreadsheet.ts and crossover-spreadsheet.ts.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-11-12T18:18:07.282Z
Learnt from: lelemm
Repo: actualbudget/actual PR: 3828
File: packages/desktop-client/src/components/reports/reports/Calendar.tsx:575-631
Timestamp: 2024-11-12T18:18:07.282Z
Learning: In `Calendar.tsx`, transaction-related callbacks such as `onBatchDelete`, `onBatchDuplicate`, `onCreateRule`, and `onScheduleAction` are intentionally left as empty functions because these operations should not be usable on that page.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-08-17T13:48:35.570Z
Learnt from: jfdoming
Repo: actualbudget/actual PR: 5533
File: packages/desktop-client/src/components/modals/BudgetAutomationsModal.tsx:116-131
Timestamp: 2025-08-17T13:48:35.570Z
Learning: In the Actual Budget app, the BudgetAutomationsModal's send() calls for 'budget/set-category-automations' have adequate error handling through the global error handling system that shows toast notifications, as confirmed by direct testing where manually injected errors resulted in appropriate toast notifications to the user.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2025-01-17T18:05:12.337Z
Learnt from: matt-fidd
Repo: actualbudget/actual PR: 4180
File: packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx:312-318
Timestamp: 2025-01-17T18:05:12.337Z
Learning: In the Actual Budget codebase, the schedule action handlers (onPost, onSkip, onComplete) in AccountTransactions.tsx follow a consistent pattern without explicit try-catch blocks, letting errors propagate up the call stack.

Applied to files:

  • packages/desktop-client/src/components/budget/index.tsx
📚 Learning: 2024-09-26T19:32:57.858Z
Learnt from: MatissJanis
Repo: actualbudget/actual PR: 3507
File: packages/desktop-client/src/components/table.tsx:1220-1220
Timestamp: 2024-09-26T19:32:57.858Z
Learning: The `TableNavigator` type in `packages/desktop-client/src/components/table.tsx` is not used outside of this file and can safely be made private by removing the `export` keyword.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
📚 Learning: 2025-06-03T23:19:44.814Z
Learnt from: elijaholmos
Repo: actualbudget/actual PR: 5076
File: packages/desktop-client/src/components/CommandBar.tsx:70-70
Timestamp: 2025-06-03T23:19:44.814Z
Learning: The useReports hook in packages/desktop-client/src/hooks/useReports.ts always returns an array for the data property due to initialData: [] and default value fallback (data: customReports = []), so it never returns undefined and doesn't need additional undefined checks when used.

Applied to files:

  • packages/desktop-client/src/components/budget/BudgetTable.tsx
🧬 Code graph analysis (8)
packages/desktop-client/src/budget/queries.ts (2)
packages/loot-core/src/types/models/category-group.ts (1)
  • CategoryGroupEntity (3-11)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/desktop-client/src/hooks/useCategoryGroup.ts (1)
packages/desktop-client/src/budget/queries.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (2)
packages/loot-core/src/server/db/index.ts (1)
  • moveCategory (491-510)
packages/desktop-client/src/budget/mutations.ts (1)
  • useMoveCategoryMutation (183-219)
packages/desktop-client/src/hooks/useCategoriesQuery.ts (1)
packages/desktop-client/src/budget/queries.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx (2)
packages/loot-core/src/server/db/index.ts (1)
  • moveCategory (491-510)
packages/desktop-client/src/budget/mutations.ts (1)
  • useMoveCategoryMutation (183-219)
packages/desktop-client/src/components/budget/index.tsx (1)
packages/desktop-client/src/budget/mutations.ts (8)
  • useBudgetActions (551-704)
  • useCreateCategoryMutation (28-75)
  • useUpdateCategoryMutation (81-117)
  • useDeleteCategoryMutation (124-175)
  • useMoveCategoryMutation (183-219)
  • useCreateCategoryGroupMutation (225-262)
  • useUpdateCategoryGroupMutation (268-307)
  • useMoveCategoryGroupMutation (357-393)
packages/desktop-client/src/components/budget/BudgetTable.tsx (1)
packages/desktop-client/src/hooks/useCategories.ts (1)
  • useCategories (3-7)
packages/desktop-client/src/budget/mutations.ts (6)
packages/loot-core/src/types/models/category.ts (1)
  • CategoryEntity (3-13)
packages/loot-core/src/types/models/category-group.ts (1)
  • CategoryGroupEntity (3-11)
packages/desktop-client/src/redux/index.ts (1)
  • useDispatch (18-18)
packages/desktop-client/src/budget/queries.ts (1)
  • categoryQueries (15-32)
packages/desktop-client/src/notifications/notificationsSlice.ts (2)
  • addNotification (58-68)
  • addGenericErrorNotification (69-79)
packages/loot-core/src/shared/util.ts (1)
  • IntegerAmount (396-396)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
  • GitHub Check: build (windows-latest)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-22.04)
  • GitHub Check: validate-cli
  • GitHub Check: compare
  • GitHub Check: typecheck
  • GitHub Check: Analyze
  • GitHub Check: Generate VRT Updates
  • GitHub Check: lint
  • GitHub Check: test
  • GitHub Check: autofix
  • GitHub Check: Functional Desktop App
  • GitHub Check: server
  • GitHub Check: Wait for Netlify build to finish
  • GitHub Check: crdt
  • GitHub Check: web
  • GitHub Check: api
🔇 Additional comments (10)
eslint.config.mjs (1)

457-457: LGTM! More precise pattern matching.

The anchored regex (^useQuery$|^useEffectAfterMount$) correctly narrows the rule to exact hook names only. This prevents false positives where hooks like useCategoriesQuery or useQuerySomething would be incorrectly treated as having dependency arrays that need exhaustive-deps checking.

Based on learnings.

packages/desktop-client/src/hooks/useCategoriesQuery.ts (1)

1-7: LGTM!

Clean wrapper hook that follows React Query conventions.

packages/desktop-client/src/hooks/useCategoryGroup.ts (1)

5-11: LGTM!

The migration to React Query with a select function is well-implemented. The return type correctly allows undefined when the group is not found, which is appropriate behavior.

packages/desktop-client/src/components/mobile/budget/IncomeCategoryList.tsx (1)

12-12: LGTM!

Clean migration from Redux dispatch to React Query mutation hook. The mutation usage is consistent and the payload structure correctly matches the mutation function signature.

Also applies to: 28-28, 73-100

packages/desktop-client/src/components/mobile/budget/ExpenseCategoryList.tsx (1)

15-15: LGTM!

Consistent migration from Redux dispatch to React Query mutation hook, matching the pattern in IncomeCategoryList.tsx.

Also applies to: 39-39, 84-111

packages/desktop-client/src/budget/queries.ts (2)

15-32: LGTM!

The categoryQueries implementation follows React Query best practices. The use of placeholderData ensures data is always available, and staleTime: Infinity with manual invalidation is the correct pattern for data that changes only through explicit mutations.


34-65: Translation implementation is appropriate.

The use of i18n.t() directly is acceptable here since these are pure query functions called outside React component context. The useTranslation hook would not be available in this context.

packages/desktop-client/src/components/budget/index.tsx (3)

184-192: LGTM!

Clean migration from Redux action to React Query mutation for category creation and updates.


260-268: LGTM!

Proper use of the useBudgetActions mutation for applying budget templates.


270-272: LGTM!

Consistent pattern for handling budget actions through the mutation hook.

@joel-jeremy

Copy link
Copy Markdown
Contributor Author

One thing, have you had a chance to compare this to RTK Query?

I initially experimented with RTK Query but IMO react query is easier to manage because it has less boilerplate.

jfdoming
jfdoming previously approved these changes Nov 10, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/desktop-client/src/components/budget/BudgetTable.tsx`:
- Around line 121-131: findSortDown is declared to accept CategoryGroupEntity[]
but is being passed group.categories (CategoryEntity[]), causing a type
mismatch; update the code by making findSortDown generic (e.g., accept Item
extends { id: string }[]) or change its parameter type to a union/looser
interface so it accepts any array of items with an id property, then update its
signature and usage sites (including the call in BudgetTable where
categoryGroups and group.categories are used) so TypeScript recognizes
group.categories as a valid argument for findSortDown; alternatively, if you
prefer separation, implement a small helper (e.g., findSortDownForItems) that
mirrors findSortDown logic but types its parameter as Item[] where Item has id:
string and call that from the onReorderCategory branch.
🧹 Nitpick comments (1)
packages/desktop-client/src/components/budget/index.tsx (1)

123-125: Prefer functional update for the collapse toggle.

If useLocalPref supports functional setters, this avoids stale toggles under rapid updates.

♻️ Suggested tweak
-  const onToggleCollapse = () => {
-    setSummaryCollapsedPref(!summaryCollapsed);
-  };
+  const onToggleCollapse = () => {
+    setSummaryCollapsedPref(prev => !prev);
+  };

@joel-jeremy
joel-jeremy added this pull request to the merge queue Feb 5, 2026
@joel-jeremy
joel-jeremy removed this pull request from the merge queue due to a manual request Feb 5, 2026
@joel-jeremy
joel-jeremy enabled auto-merge February 5, 2026 00:41
@joel-jeremy
joel-jeremy added this pull request to the merge queue Feb 5, 2026
Merged via the queue into master with commit 7f6f4d5 Feb 5, 2026
33 of 34 checks passed
@joel-jeremy
joel-jeremy deleted the react-query-categories branch February 5, 2026 00:55
@youngcw

youngcw commented Feb 12, 2026

Copy link
Copy Markdown
Member

This caused #6886 and #6949

shawalli added a commit to shawalli/actual that referenced this pull request Mar 10, 2026
* Typescript: make arithmetic.ts strict (#6801)

* Make arithmetic.ts strict TypeScript compliant

- Add type definitions for ParserState, Operator, OperatorNode, and AstNode
- Add explicit type annotations to all function parameters
- Fix null/undefined handling in parsePrimary function
- Remove type assertion in makeOperatorParser by using explicit Operator type
- Handle null return from currencyToAmount function
- All functions now have proper return type annotations

* Add test for ignoring leftover characters in evalArithmetic function

* Add oxlint rule against direct theme imports; fix Login OpenID button styles (#6796)

Co-authored-by: Michael Clark <[email protected]>

* Improve bug report template with better structure and requirements (#6784)

* Improve bug report template with better structure and requirements

* Fix: Remove empty value fields from textarea inputs in bug report template

* Add release notes for PR #6784

* Update 6784.md

* Update bug report template to request a screenshot of the import screen along with a redacted file version for better issue resolution.

* Update bug report template for import issues

Clarified instructions for reporting import issues.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix translation issue #6828 (#6845)

* Fix translation issue #6828

* Add release note

* [autofix.ci] apply automated fixes

* update release number

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Avoid negative zero in budget summary amounts (#6843)

* fix: report widget tooltip z-index (#6849)

* Fix sync server migrations (#6346)

* Fix sync-server migrations to use ESM loader

* Add release notes

* Apply CodeRabbit suggestions

* [autofix.ci] apply automated fixes

* Add file extension filter to sync-server migrations import

* [autofix.ci] apply automated fixes

* Ensure migrations occur synchronously

* [autofix.ci] apply automated fixes

* Minor cleanup

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Matt Fiddaman <[email protected]>

* fix(i18n): respect browser preferred languages when supported (#6812)

* fix(i18n): respect browser preferred languages when supported

Instead of relying on the first browser language, the application now
iterates through navigator.languages and selects the first supported
locale, with a fallback to English.

* chore: add the release notes related file

* fix(i18n): check region locales support before falling back to base locale

* fix(i18n): make the unit test aligned with the region locales checking

* switch to node alpine docker image (#6840)

* switch to node alpine image

* note

* Include scheduled transactions in nYNAB imports (#6844)

* Include scheduled transactions in nYNAB imports

* Remove logs and restore schedule name from transaction memo

* Simplify rule actions

* Create schedules with unique names

* Set the note rather than append

* Update ynab5 demo budget and e2e test

* Update findSortUp and findSortDown parameter to be more generic (#6861)

* findSortUp and findSortDown is also used for CategoryEntity. Updating type to be more generic.

* Generics

* Add release notes for PR #6861

* Adjust category to Maintenance based on review feedback (#6865)

* Initial plan

* Change release notes category to Maintenance

Co-authored-by: joel-jeremy <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* Use consistent color variables on Budget Page. (#6820)

* Change color of budget table scrollbar.

* Update budget sidebar to use budget colors.

* Update fontWeight for 'Category' to match rest of table

* Update to use budget background

* Update ExpenseGroup to use budget color

* Update IncomeGroup to use budget color

* Update SidebarCategory colors

Change drag/drop to buttonPrimaryBackground so it will always be visible in any custom theme.

Background to budget color.

* Update SidebarGroup background to budget color

* Update EnvelopeBudgetComponents

Add 'budgetNumberNeutral' to cheveronDown in budgeted field instead of using default bare button text incases where bare button is set to normal button text and normal button is inverted. remove mobile color variable for shadow

* Update BudgetTotals.tsx

Use tableHeaderText for header.

* Update BudgetSummary.tsx

Use budget colors

* Update MonthPicker.tsx

change selected months at top from tableBorderHover color to buttonPrimaryBackground.

* [autofix.ci] apply automated fixes

* Update EnvelopeBudgetComponents.tsx

* Update BudgetTotals.tsx

revert

* Update SidebarCategory.tsx

* Update TrackingBudgetComponents to use budget colors

* [autofix.ci] apply automated fixes

* Update BudgetSummary to use budget colors

* Update BudgetTotal.tsx

* Update ExpenseProgress.tsx

* Update IncomeProgress.tsx

* Update Saved.tsx

* Use consistent color variables on budget pages.

* Update IncomeProgress.tsx

* Update ExpenseProgress.tsx

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6820

* Update EnvelopeBudgetComponents

Budget total header to follow current/other month style.

* Update EnvelopeBudgetComponents.tsx

* [autofix.ci] apply automated fixes

* Update EnvelopeBudgetComponents.tsx

* Update EnvelopeBudgetComponents.tsx

* [autofix.ci] apply automated fixes

* Update EnvelopeBudgetComponents.tsx

* Revert EnvelopeBudgetComponents.tsx

* [autofix.ci] apply automated fixes

* Update EnvelopeBudgetComponents.tsx

* Update EnvelopeBudgetComponents.tsx

* Update EnvelopeBudgetComponents.tsx

* Revert again :) EnvelopeBudgetComponents.tsx

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: isConcise state handling for CashFlow report (#6765)

* changes token expiry handling to be automatic sign out (#6798)

* changes token expiry handling to be automatic sign out

* add release notes

---------

Co-authored-by: Matt Fiddaman <[email protected]>

* Remove comma from all instances of month-year strings (#6748)

* Remove comma from all instances of month-year strings, e.g., "January 2026" rather than "January, 2026"

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6748

* All updated calls now include `locale` as an argument

* Update dependencies in `useEffect` to include `locale`

* Reorganized new import

* Remove double colon

* Consistent trailing commas

* Include locale in other dependency arrays

* Reorder imports

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6748

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Fiddaman <[email protected]>

* Move redux state to react-query - category states (#5977)

* Move redux state to react query - category states

* Fix typecheck errors

* Fix typecheck errors

* Fix typecheck errors

* Remove t argument

* [autofix.ci] apply automated fixes

* Coderabbot suggestion

* Code review feedback

* Fix type

* Coderabbit

* Delete useCategoryActions

* Fix lint

* Use categories from react query cache

* Fix typecheck error

* Update to use useDeleteCategoryGroupMutation

* Coderabbit feedback

* Break up useCategoryActions

* [autofix.ci] apply automated fixes

* Fix typecheck errors

* Fix typecheck error

* Fix typecheck error

* await nested mutations

* Await deleteCategory

* Rename to sendThrow

* Fix lint errors

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Fix react/exhaustive-deps in Modals (#6862)

* Fix react/exhaustive-deps in Modals

* Add release notes for PR #6862

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix react/exhaustive-deps in PayeeTable (#6863)

* Fix react/exhaustive-deps in Modals

* Fix react/exhaustive-deps in PayeeTable

* Add release notes for PR #6863

* Change category and fix dependency management in PayeeTable

Updated category from 'Enhancements' to 'Maintenance' and fixed dependency management in PayeeTable.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix react-hooks/exhaustive-deps in CustomReport (#6867)

* Fix react-hooks/exhaustive-deps in CustomReport

* Add release notes for PR #6867

* Fix typecheck errors

* [autofix.ci] apply automated fixes

* Change category to Maintenance and update description

* [autofix.ci] apply automated fixes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Fix react-hooks/exhaustive-deps in ImportTransactionsModal (#6868)

* Fix react-hooks/exhaustive-deps in ImportTransactionsModal

* [autofix.ci] apply automated fixes

* Add release notes for PR #6868

* Update category to Maintenance and fix warnings

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Apply tag colors to YNAB flag tags (#6866)

* Apply tag colors to match YNAB flags

* Update tag colors to match YNAB, add description on import

* Tighten types

* Use custom colors

* Use Actual palette equivalents for tag colors

* Nitpick fixes

* Fix nitpick 'fix'

* Handle YNAB flag tag conflicts

* Handle YNAB flag tag conflicts without creating separate color tags

* Simplify

* Reorganize

* Fix date range calculation in BudgetAnalysisCard (#6875)

* fix: corrected date range calculation in BudgetAnalysisCard using calculateTimeRange

* add release note

* fix: ensure correct date formatting in BudgetAnalysisCard for start and end dates

* fix: rename release note file

* Add Catppuccin Themes to custom theme catalog (#6857)

* Add Catppuccin Themes to theme catalog

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Avoid duplicate category import errors in YNAB5 importer (#6878)

* avoid duplicate category import errors

Add normalizeError helper function

* Add release notes file

* Fix react-hooks/exhaustive-deps in DateSelect (#6864)

* Fix react-hooks/exhaustive-deps in DateSelect

* Add release notes for PR #6864

* Fix remaining suppressions

* Change category to Maintenance and fix linting issues

Updated category from Enhancements to Maintenance and fixed linting issues related to react-hooks/exhaustive-deps in DateSelect.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Add build-electron to tsconfig excludes (#6883)

* Add build-electron to tsconfig excludes

* Add release notes for PR #6883

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Add bank sync option to update dates. (#6850)

Signed-off-by: Christian Speich <[email protected]>

* Add new theme 'You Need A Dark Mode' to catalog (#6891)

* Add new theme 'You Need A Dark Mode' to catalog

* Add 'You Need A Dark Mode' theme to catalog

* Update the Create Linked Account workflow to prompt for Starting Date and Balance (#6629)

* feat: Add optional starting date and balance for bank sync accounts

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

Addresses: https://discord.com/channels/937901803608096828/1402270361625563186

Changes:
- Frontend: Added inline date and amount input fields in the account
  linking table for new accounts
- Redux: Extended link account actions to accept startingDate and
  startingBalance parameters
- Backend: Updated account linking handlers to pass custom values to
  sync logic
- Sync: Modified syncAccount and processBankSyncDownload to use custom
  starting date/balance for initial sync transactions

Features:
- Only displays starting options when creating new accounts (not upgrades)
- AmountInput with smart sign detection based on account balance
  (negative for credit cards/loans)
- Defaults to 90 days ago for date and 0 for balance
- Mobile-responsive with separate AccountCard layout
- Works across all sync providers: GoCardless, SimpleFIN, Pluggy.ai

The custom starting balance is used directly for the starting balance
transaction, and the custom starting date determines both the sync
start date and the transaction date for the starting balance entry.

* refactor: Extract shared types and components for starting balance inputs

- Create CustomStartingSettings type to replace repeated inline type definitions
- Extract StartingOptionsInput component to consolidate duplicate UI between mobile/desktop views
- Create LinkAccountBasePayload type shared across GoCardless, SimpleFIN, and PluggyAI link functions
- Apply same base type pattern to server-side link account handlers

This simplifies the code introduced for custom starting date/balance when linking bank accounts.

[autofix.ci] apply automated fixes

* allow explicit zero values

* refactor: add type guard for BankSyncError to remove oxlint-disable

- Create isBankSyncError() type guard function with proper type narrowing
- Remove oxlint-disable-next-line comment that suppressed the no-explicit-any rule
- Add JSDoc comments for both isBankSyncError and handleSyncError functions
- Remove redundant type assertion now that type guard narrows correctly

* refactor: address code review nitpicks for SelectLinkedAccountsModal

- Use locale-aware date formatting instead of toISOString()
- Extract isNewAccountOption helper to reduce duplication
- Align AccountCardProps type definition pattern with TableRowProps

* Add placeholder date/balance for already linked accounts

* [autofix.ci] apply automated fixes

* Use StartingBalanceInfo only, and add mobile view

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* :art: Storybook docs for block, card, colorpicker, formerror (#6874)

* storybook docs for block, card, colorpicker, formerror

* release notes

* Fix Ctrl+Enter losing amount value when adding transaction (#6911)

* Fix Ctrl+Enter losing amount value when adding transaction

Fixes #6901

When using Ctrl+Enter to add a transaction immediately after typing
in the amount field, the value wasn't being committed before the
transaction was saved, resulting in a zero amount.

The fix wraps the add-and-close logic in an afterSave() callback
to ensure field values are committed before adding the transaction.

Added regression tests for both debit and credit fields to verify
the fix works correctly.

* Add release notes for PR #6911

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 4.5 <[email protected]>

* Fix feedback link for budget analysis report experimental flag (#6914)

* :electron: Flathub PR to be draft on release (#6910)

* make flathub pr draft so that we dont attract attention

* release notes

* grammar

* Points: pay for contributions (#6481)

* Add point totals display to all statistics sections in count-points script

* Update funding contributors documentation and add release notes for contributor point counting script

* Refactor contributor points calculation and enhance PR category determination

- Updated point values for PR contributions: reduced points for Features, Enhancements, Bugfix, and Maintenance, and added a new category for Unknown contributions.
- Introduced a new function to retrieve the last commit SHA before a specified date to improve accuracy in reading release notes.
- Modified the getPRCategoryAndPoints function to accept a monthEnd parameter for better context in point assignment.

* Update contributor points values in count-points script to reflect new scoring system

* Add new blog post on funding contributors' next steps

This post outlines plans to expand the contributor compensation system, including broader rewards for project involvement, targeted donations, and a points-based system for feature work. It emphasizes transparency and community feedback in shaping future funding strategies.

* Increase Bugfix points from 2 to 3

* Change points awarded for Features to 2

* Enforce consistent TypeScript type import style (#6805)

* Refactor: extract tooltip components and clean up lint suppressions (#6721)

* Refactor: extract tooltip components and clean up lint suppressions

Extract CustomTooltip components from CrossoverGraph and NetWorthGraph
to module level to fix unstable nested components lint warnings. Also
consolidate theme file lint rule into oxlintrc.json and add proper
typing to styles object.

* Add release notes for maintenance updates addressing lint violations

* Remove style prop from CustomTooltip to prevent container layout styles from affecting tooltip

Co-authored-by: matiss <[email protected]>

* Refactor NetWorthGraph component by extracting TrendTooltip and StackedTooltip into separate functions for improved readability and maintainability. Update tooltip props to include necessary parameters for rendering. Clean up unused code and enhance tooltip styling.

* Refactor NetWorthGraph component to streamline tooltip handling

- Removed unnecessary prop passing for translation function in TrendTooltip.
- Adjusted import statements for better clarity and consistency.
- Cleaned up code to enhance readability and maintainability.

---------

Co-authored-by: Cursor Agent <[email protected]>

* Remove duplication of CrossoverData type (#6928)

* Remove duplication of CrossoverData type

Move the CrossoverData type definition to crossover-spreadsheet.tsx and
import it from the Crossover and CrossoverCard files instead of having
duplicate definitions in each file.

Signed-off-by: Jonathon Jongsma <[email protected]>

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Signed-off-by: Jonathon Jongsma <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Add Tag API (#6746)

* Add Tag API

* Add Tag API tests

* Add Release Note for #6746

* Make release note more user-facing

* Remove unnecessary type coercion in tagModel.fromExternal

Since APITagEntity picks all properties from TagEntity, the types are
structurally identical and TypeScript can verify compatibility without
manual coercion.

Co-authored-by: Matiss Janis Aboltins <[email protected]>

---------

Co-authored-by: Matiss Janis Aboltins <[email protected]>

* [FIX] Update DesktopLinkedNotes so links stay inline (#6858)

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes so links stay inline

* Update TransactionsTable.tsx

make sure flexDirection is row.

* [autofix.ci] apply automated fixes

* Update DesktopLinkedNotes.tsx

* Update TransactionsTable.tsx

* Update DesktopLinkedNotes.tsx

* Update NotesTagFormatter.tsx trial

* Update DesktopLinkedNotes.tsx

* Update NotesTagFormatter.tsx

* Update NotesTagFormatter.tsx

* Update DesktopLinkedNotes.tsx

* [autofix.ci] apply automated fixes

* Update TransactionsTable.tsx

* Update DesktopLinkedNotes.tsx

Add role for accessibility

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

Revert to original

* Update DesktopLinkedNotes.tsx

Try to style the bare button to make it work.

* [autofix.ci] apply automated fixes

* Update DesktopLinkedNotes.tsx

Reverting to current master

* Update DesktopLinkedNotes.tsx

Add nowrap styling.

* Update DesktopLinkedNotes.tsx

* Update TransactionsTable.tsx

* Update TransactionsTable.tsx

* [autofix.ci] apply automated fixes

* Update DesktopLinkedNotes.tsx

* Update TransactionsTable.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* [autofix.ci] apply automated fixes

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* revert TransactionsTable.tsx

* Update TransactionsTable.tsx

* Update TransactionsTable.tsx

* Update TransactionsTable.tsx

* Update DesktopLinkedNotes.tsx

* Update TransactionsTable.tsx

* Update TransactionsTable.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Revert DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* [autofix.ci] apply automated fixes

* Update DesktopLinkedNotes.tsx

* [autofix.ci] apply automated fixes

* Update DesktopLinkedNotes.tsx

* Update DesktopLinkedNotes.tsx

* [autofix.ci] apply automated fixes

* Update DesktopLinkedNotes.tsx

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: youngcw <[email protected]>

* Add butterfly custom theme (#6900)

* Added butterfly custom theme

* Added release notes

* Fix/6885 crash when rule has empty date field (#6905)

* Fix crash when rule date field loses focus while empty

Fixes #6885

* Remove ts-strict-ignore and fix types in DateSelect

* Generate release note 6905

* fix(schedules): prevent past missed schedule dates from being marked as upcoming (#6925)

Fixes #6872

* [Goals] fix tracking budget balance carryover for templates (#6922)

* fix tracking budget balance carryover for templates

* Add release notes for PR #6922

* fix note

* fix tests

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* :art: Reorganising Storybook and more component stories (#6924)

* reorg of storybook docs and add some new components

* releaes notes

* Update meta tags for Actual Budget Design System

* Increase sidebar item font size from 14px to 16px

* Move redux state to react-query - category states [Part 2 - expose react-query states e.g. isPending, isSuccess, etc] (#6882)

* Move redux state to react-query - category states [Part 2 - expose react-query states]

* Add release notes for PR #6882

* Add default values to useCategories destructuring to prevent undefined crashes (#6884)

* Initial plan

* Add missing defaults to all useCategories usages

Co-authored-by: joel-jeremy <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* Fix lint errors

* Fix rebase mistake

* Change category from Enhancements to Maintenance

Migrate state management for category from Redux to React Query and update related hooks and components.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* Retrofit useTransactions to use react-query under the hood (#6757)

* Retrofit useTransactions to use react-query under the hood

* Add release notes for PR #6757

* Update packages/desktop-client/src/transactions/queries.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Disable when there is no query parameter

* Fix typecheck errors

* Remove space

* Update tests

* Coderabbit: Add pageSize to query key

* Use isPending instead of isFetching

* Unexport mockStore

* Revert variables

* Change category from Enhancements to Maintenance

Refactor the useTransactions hook to improve data fetching with react-query.

* Fix lint errors

* Fix lint errors

* Migrate setupTests.js to TypeScript with proper types (#6871)

* Initial plan

* Rename setupTests.js to setupTests.ts and add proper types

Co-authored-by: joel-jeremy <[email protected]>

* Extract Size type to avoid duplication

Co-authored-by: joel-jeremy <[email protected]>

* Add release note for setupTests TypeScript migration

Co-authored-by: joel-jeremy <[email protected]>

* Rename release note file to match PR number 6871

Co-authored-by: joel-jeremy <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* [autofix.ci] apply automated fixes

* Update transactionQueries

* Delete setupTests PR release note

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat(currency): Add South Korean Won (#6846)

* Add South Korean Won

* Update currencies.ts

* Add release notes

* feat(currency): Add Vietnamese Dong (VND) currency (#6902)

* feat(currency): add support for vietnamese dong currency

* release: add upcoming release note

* fix(currency): change the number format for vietnamese currency

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Add refetchOnSync option to useTransactions to refetch when a server sync event is emitted (#6936)

* Migrate setupTests.js to TypeScript with proper types (#6871)

* Initial plan

* Rename setupTests.js to setupTests.ts and add proper types

Co-authored-by: joel-jeremy <[email protected]>

* Extract Size type to avoid duplication

Co-authored-by: joel-jeremy <[email protected]>

* Add release note for setupTests TypeScript migration

Co-authored-by: joel-jeremy <[email protected]>

* Rename release note file to match PR number 6871

Co-authored-by: joel-jeremy <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* Delete setupTests PR release note

* Add refetchOnSync to useTransactions to refetch when a server sync event is emitted

* Add release note for useTransactions refetchOnSync feature (#6937)

* Initial plan

* Add release note for PR 6936

Co-authored-by: joel-jeremy <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* Coderabbit feedback

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* :art:  Add remaining component stories to storybook (#6940)

* final storybook stories

* release notes

* spelling mistake

* Fix react query cache not being cleared when switching budgets (#6953)

* Fix react query cache not being cleared when switching budgets

* React does not want to export function from src/index

* Release note

* Fix mobile budget amount inputs when hide decimal places is enabled (#6945)

* Upgrade oxfmt and oxlint, update .oxfmtrc.json import patterns (#6955)

Co-authored-by: Cursor <[email protected]>

* Retrofit useReports to use react-query under the hood (#6951)

* Retrofit useReports to use react-query under the hood

* Add release notes for PR #6951

* Update 6951.md

* Report mutations

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update `send` function to propagate any errors and fix `catchErrors` to return the error in result when an unknown command/method is sent to the browser server (#6942)

* Fix send not returning error when catchErrors option is enabled and an unknown method error is encountered

* Add release notes for PR #6942

* Fix send to properly propagate errors from the server

* Update release note

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* API Account Object (#6915)

* api change

* docs

* lint

* release notes

* spelling

* [autofix.ci] apply automated fixes

* spelling

* whoopsie, thanks rabbit

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: add back button to reports pages (#6702)

* feat: add back button to reports pages

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6702

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Rename loot-core/platform/client/fetch to connection to match server-side package (#6943)

* Rename loot-core/platform/client/fetch package to connection to match the server side package name. Also to avoid confusion with the native fetch package.

* Update connection/init method to not receive any parameter to so browser and default implementation have the same signature

* Add release notes for PR #6943

* Fix names

* Fix imports

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: show/hide reconciled transactions on mobile (#6896)

* feat: show/hide reconciled transactions on mobile

Resolves #2969

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Move redux state to react-query - tags states (#6941)

* Move redux state to react-query - tags states

* Add release notes for PR #6941

* Cleanup sendThrow

* Cleanup

* Update import

* Fix import

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: add Architecture Decision Records page with bank sync credential ADR (#6965)

* docs: add Architecture Decision Records page for controversial decisions

Co-authored-by: Cursor <[email protected]>

* Add release notes for PR #6965

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Docs: add Claude Code Pro subscription benefit for core contributors (#6963)

* Add Claude Code Pro subscription benefit for core contributors

Co-authored-by: Cursor <[email protected]>

* Add release notes for PR #6963

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Agent instructions for commit messages and PR titles (#6964)

* [AI] Add mandatory [AI] prefix requirement for commit messages and PR titles

Co-authored-by: matiss <[email protected]>

* [autofix.ci] apply automated fixes

* Add release notes for PR #6964

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Move redux state to react-query - account states (#6140)

* Fix typecheck errors

* Move redux state to react-query - account states

* TestProviders

* Add release notes for PR #6140

* Fix lint error

* Fix TestProviders

* Coderabbit feedback

* Cleanup

* [autofix.ci] apply automated fixes

* Fix TestProviders

* Fix onbudget and offbudget displaying closed accounts

* [skip ci] Change category to Maintenance and update migration text

* Replace logger calls in desktop-client to console

* Fix lint errors

* Clear react query on closing of budget file similar to redux resetApp action

* [autofix.ci] apply automated fixes

* Remove sendThrow

* Code review feedback

* [autofix.ci] apply automated fixes

* Fix import

* Fix import

* Coderabbit feedback

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* [AI] lint: convert oxlint warnings to errors (#6970)

Co-authored-by: Cursor <[email protected]>

* Add filter option for category groups (#6834)

* Add filter by category groups

* Add tests

* Add release notes

* [autofix.ci] apply automated fixes

* Fix typecheck findings

* Fix modal

* Address nitpick comment (filterBy)

* Fix e2e tests

* Make group a subfield of category

* Fix test by typing in autocomplete

* Replace testId with a11y lookups

* Apply new type import style rules

* Apply feedback

* Improve typing on array reduce, remove manual type coercion

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Fix some low-hanging-fruit `@ts-strict-ignore` (#6969)

* Fix low-hanging-fruit `@ts-strict-ignore`

* Add release notes

* A few more

* Include category group in transaction export (#6960)

* include category group in transaction export

* Apply suggestion from @yzAlvin

Co-authored-by: Alvin Zhao <[email protected]>

---------

Co-authored-by: youngcw <[email protected]>

* Implement missing logic for limit template type (#6690)

* core: support limit refill templates

* notes: refill templates

* core: apply refill limits during runs

* core: prioritize refill limits

* Patch

* Update release note

* Fix typecheck

* rework.  Tests and template notes still need reworked

* fix parser syntax

* Fix type issue

* Fix after rebase, support merging limit+refill

* PR feedback

---------

Co-authored-by: youngcw <[email protected]>

* :book: Move pluggy.ai doc out of experimental (#6975)

* move pluggy out of experimental

* remove note

* Add release notes for PR #6975

* fixes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [AI] Update CodeRabbit config for suspect AI generated labels (#6985)

Co-authored-by: Cursor <[email protected]>

* [AI] Introduce type-aware oxlint and disable no-duplicate-type-constituents rule (#6984)

Co-authored-by: Cursor <[email protected]>

* fix(ios): restore status bar color on iOS 26.2 (Safari 26) (#6983)

* fix(ios): restore status bar color on iOS 26.2 (Safari 26)

Safari 26 no longer uses the theme-color meta tag for the status bar
and instead derives the tint from the body background. Set body
background-color in HTML and sync it with the app theme so the status
bar shows purple (or the active theme) instead of white.

Fixes #6946

Co-authored-by: Cursor <[email protected]>

* [autofix.ci] apply automated fixes

* refactor(theme): update useMetaThemeColor to accept theme values directly

Modified the useMetaThemeColor hook to accept theme color values instead of predefined keys. Updated FinancesApp and ManagementApp components to utilize the new implementation, ensuring proper theme color handling based on screen width.

* [autofix.ci] apply automated fixes

* refactor(theme): remove unused body background color in index.html and add tests for useMetaThemeColor hook

Deleted the commented-out body background color in index.html to clean up the code. Added comprehensive tests for the useMetaThemeColor hook to ensure proper handling of theme colors, including support for CSS variables and reactivity to theme changes.

* refactor(theme): improve getPropertyValueFromVarString function in useMetaThemeColor hook

* [autofix.ci] apply automated fixes

* Add release notes for PR #6983

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Address some more low-hanging fruit for ts-strict-ignore (#6992)

* Address some more low-hanging fruit for ts-strict-ignore

* Add release notes

* Fix small issues

* Rabbit

* Retrofit dashboard hooks to use react-query (#6957)

* Retrofit useReports to use react-query under the hood

* Add release notes for PR #6951

* Update 6951.md

* Report mutations

* Fix react query cache not being cleared when switching budgets (#6953)

* Fix react query cache not being cleared when switching budgets

* React does not want to export function from src/index

* Release note

* Use react-query is dashboard queries and mutations

* Add release notes for PR #6957

* [autofix.ci] apply automated fixes

* Fix typecheck errors

* Coderabbit feedback

* Make error cause optional

* Rename useDashboardWidgetCopyMenu and update useDashboardWidget to accept object to prevent need to default id to empty string

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Fix operator precedence grouping for */ and +/- (#6993)

* Fix operator precedence grouping for */ and +/-

* Add release note for #6993

* Fix exponent associativity and add regression test

---------

Co-authored-by: Hadi Ayache <[email protected]>

* Add Tag API docs (#6979)

* Add Tag object type definition for API docs

* Add Tags nav entry to API reference sidebar

* Add Tags methods and examples to API reference

* Add theming to charts and hence allowing custom themes on charts (#6909)

* Add theming to charts and hence allowing custom themes on charts

* Removing additional color scales for charts.

* Fixed return fail over value.

* Add reports to command bar (#7002)

* Add reports to command bar

* Add release notes

* Improve category server app and react query mutation error handling (#6958)

* Improve category server app and react query mutation error handling

* Add release notes for PR #6958

* Fix test

* Fix throwing async test

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Do not swallow exceptions when batching messages - propagate instead

* Update error type to make 'cause' optional

Make 'cause' property optional in error type.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Fix redirect to accounts page when no accounts exists (#7007)

* Fix redirect to accounts page when no accounts exists

* Add release notes for PR #7007

* Use isFetching

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update useAccounts to return react query states (#7009)

* Fix redirect to accounts page when no accounts exists

* Add release notes for PR #7007

* Use isFetching

* Update useAccounts to return react query states (e.g. isPending, isFetching, etc.)

* Add release notes for PR #7009

* Delete upcoming-release-notes/7007.md

* Change category from Enhancements to Maintenance

Refactor `useAccounts` to improve data handling.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Move redux state to react-query - payees states (#6880)

* Move redux state to react-query - account states

* Fix onbudget and offbudget displaying closed accounts

* Move redux state to react-query - payees states

* Add release notes for PR #6880

* Replace usage of logger in desktop-client with console

* Address feedback on adding default data to usePayees (#6931)

* Initial plan

* Add default data to usePayees usages using inline destructuring

Co-authored-by: joel-jeremy <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* Fix imports

* Update empty payees list test

* Cleanup and simplify AccountEntity definition to fix `satisfies` syntax

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: joel-jeremy <[email protected]>

* Document graph color variables for custom themes (#7011)

* Document graph color variables for custom themes

Added documentation for graph color variables in custom themes.

* [autofix.ci] apply automated fixes

* Update custom themes documentation for clarity

Clarify the impact of color palettes on custom report widget graphs and format the list of color variables.

* Update packages/docs/docs/experimental/custom-themes.md

Co-authored-by: Matt Fiddaman <[email protected]>

* Fix color variable syntax in custom themes documentation

Updated color variable syntax for chart colors in documentation.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Matt Fiddaman <[email protected]>

* :book: start of reports dashboard updates (#6976)

* start of reports dashboard updates

* spelling

* Add release notes for PR #6976

* don't need one of these

* consistent naming

* bunny fixes

* images

* image again

* extenion

* fix

* consistent naming

* naming

* fix

* last one

* Ill be done with this someday

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* ⬆️ mid month dependency bump (#7013)

* baseline-browser-mapping (^2.9.14 → ^2.9.19)

* minimatch (^10.1.1 → ^10.1.2)

* lage (^2.14.15 → ^2.14.17)

* react-aria-components (^1.14.0 → ^1.15.1)

* @storybook/addon-a11y (^10.2.0 → ^10.2.7)

* p-limit (^7.2.0 → ^7.3.0)

* better-sqlite3 (^12.5.0 → ^12.6.2)

* vitest (^4.0.16 → ^4.0.18)

* @storybook/addon-docs (^10.2.0 → ^10.2.7)

* @storybook/react-vite (^10.2.0 → ^10.2.7)

* eslint-plugin-storybook (^10.2.0 → ^10.2.7)

* storybook (^10.2.0 → ^10.2.7)

* @codemirror/state (^6.5.3 → ^6.5.4)

* @swc/core (^1.15.8 → ^1.15.11)

* @tanstack/react-query (^5.90.19 → ^5.90.20)

* @vitejs/plugin-basic-ssl (^2.1.3 → ^2.1.4)

* @vitejs/plugin-react (^5.1.2 → ^5.1.3)

* i18next (^25.7.4 → ^25.8.4)

* react-aria (^3.45.0 → ^3.46.0)

* react-hotkeys-hook (^5.2.1 → ^5.2.4)

* react-i18next (^16.5.1 → ^16.5.4)

* sass (^1.97.2 → ^1.97.3)

* @easyops-cn/docusaurus-search-local (^0.52.2 → ^0.52.3)

* react (^19.2.3 → ^19.2.4)

* react-dom (^19.2.3 → ^19.2.4)

* component lib peer deps

* eslint-vitest-rule-tester (^3.0.1 → ^3.1.0)

* lru-cache (^11.2.4 → ^11.2.5)

* ua-parser-js (^2.0.7 → ^2.0.9)

* cors (^2.8.5 → ^2.8.6)

* @babel/core (^7.28.5 → ^7.29.0)

* @types/node (^22.19.3 → ^22.19.10)

* react (mixed → 19.2.4)

* @testing-library/react (16.3.0 → 16.3.2)

* react-router (7.12.0 → 7.13.0)

* vite-plugin-node-polyfills (^0.24.0 → ^0.25.0)

* pluggy-sdk (^0.79.0 → ^0.83.0)

* note

* [AI] Allow var(--name) in custom theme CSS (no fallbacks) (#7018)

Co-authored-by: Cursor <[email protected]>

* ⬆️ @playwright/test (1.57.0 → 1.58.2) (#7021)

* @playwright/test (1.57.0 → 1.58.2)

* note

* disable moving nav bar animations

* vrt

* [AI] lint: await-thenable, no-floating-promises (#6987)

* [AI] Desktop client, E2E, loot-core, sync-server and tooling updates

Co-authored-by: Cursor <[email protected]>

* Refactor database handling in various modules to use async/await for improved readability and error handling. This includes updates to database opening and closing methods across multiple files, ensuring consistent asynchronous behavior. Additionally, minor adjustments were made to encryption functions to support async operations.

* Refactor sync migration tests to utilize async/await for improved readability. Updated transaction handling to streamline event expectations and cleanup process.

* Refactor various functions to utilize async/await for improved readability and error handling. Updated service stopping, encryption, and file upload/download methods to ensure consistent asynchronous behavior across the application.

* Refactor BudgetFileSelection component to use async/await for onSelect method, enhancing error handling and readability. Update merge tests to utilize async/await for improved clarity in transaction merging expectations.

* Refactor filesystem module to use async/await for init function and related database operations, enhancing error handling and consistency across file interactions. Updated tests to reflect asynchronous behavior in database operations and file writing.

* Fix typo in init function declaration to ensure it returns a Promise<void> instead of Proise<void>.

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6987

* Update tests to use async/await for init function in web filesystem, ensuring consistent asynchronous behavior in database operations.

* Update VRT screenshot for payees filter test to reflect recent changes

* [AI] Fix no-floating-promises lint error in desktop-electron

Wrapped queuedClientWinLogs.map() with Promise.all and void operator to properly handle the array of promises for executing queued logs.

Co-authored-by: Matiss Janis Aboltins <[email protected]>

* Refactor promise handling in global and sync event handlers

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6987

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matiss Janis Aboltins <[email protected]>

* Bump @isaacs/brace-expansion from 5.0.0 to 5.0.1 (#7020)

* Bump @isaacs/brace-expansion from 5.0.0 to 5.0.1

Bumps @isaacs/brace-expansion from 5.0.0 to 5.0.1.

---
updated-dependencies:
- dependency-name: "@isaacs/brace-expansion"
  dependency-version: 5.0.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* note

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Fiddaman <[email protected]>

* feat(currency): Add Dominican Peso (DOP) currency (#7028)

* feat(currency): Add Dominican Peso (DOP) currency

* Add release notes

* ⬆️ recharts (3.4.0 → 3.7.1) (#7022)

* recharts (3.4.1 -> 3.7.0)

* Cell & activeShape deprecation

* note

* fix textAnchor

* remove Cell in BarGraph

* Fix Net Worth Calculations (#6968)

* fix: computed priorPeriodNetWorth and use it as a baseline for net worth calculations

* add release notes

* correct spelling

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6968

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6968

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6968

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6968

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6968

* note

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: youngcw <[email protected]>

* Set inital focus on category when covering overspending (#7012)

* Set inital focus on category when covering overspending

* Fixup: Make sure that the amount is set

* Unused import

* Fix bug where typing an amount and pressing enter uses previous value

---------

Co-authored-by: Dagur Ammendrup <[email protected]>

* 🎨 High Contrast Light theme for Actual (#7032)

* Update customThemeCatalog.json

* [autofix.ci] apply automated fixes

* Create 7032.md

🎨 High contrast light theme.

* Update customThemeCatalog.json

* Update 7032.md

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Require authentication for SimpleFIN and Pluggy.ai endpoints (#7034)

* Add authentication middleware to SimpleFIN and Pluggy.ai endpoints

Protect /simplefin/* and /pluggyai/* routes with validateSessionMiddleware
so only authenticated users can access bank account and transaction data.

Co-authored-by: Cursor <[email protected]>

* Release notes

---------

Co-authored-by: Cursor <[email protected]>

* Enhance PR template with structured sections (#6989)

* Enhance PR template with description, type of change, and checklist sections

Co-authored-by: Cursor <[email protected]>

* Update PR template to streamline instructions for writing release notes

* Remove unnecessary lines from the PR template to streamline instructions for writing release notes

* Add release notes for PR #6989

* Update category in release notes

Changed category from Enhancements to Maintenance.

* Update PULL_REQUEST_TEMPLATE.md

* Update AGENTS.md and PULL_REQUEST_TEMPLATE.md to clarify PR submission guidelines

* Update 6989.md

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Add ACTUAL_USER_CREATION_MODE documentation to oauth-auth.md (#6935)

* Add ACTUAL_USER_CREATION_MODE documentation to oauth-auth.md

* [autofix.ci] apply automated fixes

* add note that first external auth user is admin and owner

Added details about admin permissions and server ownership for users authenticating with OpenID/OAuth2.

* improve ACTUAL_USER_CREATION_MODE environment documentation

clarify warning about server owner

* [autofix.ci] apply automated fixes

* move first user admin warning to "after setup" section of OIDC documentation

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Add tooltip to imported payee in rule result window (#7031)

* Add tooltip to imported payee column in rule result window

The imported payee column in SimpleTransactionsTable was missing a
title attribute, so truncated text had no tooltip on hover. Other
columns (category, account, notes) already pass title for this purpose.

Fixes #7003

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Add release notes for #7031

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Your Name <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>

* Hide selected accounts in the mobile filter (#7030)

When filtering for accounts in the mobile view of reports, hide the
already selected accounts.

* Prevent single-slash paths from being parsed as filepaths (#6966)

* fix: prevent single-slash paths from being parsed as filepaths

* add release notes

* [autofix.ci] apply automated fixes

* test: add tests related to filepath

* additonal test from coderabbit

---------

Co-authored-by: Pratik Silwal <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* [AI] Remove usage of 'web' file types (#7033)

* [AI] Desktop client, E2E, loot-core, sync-server and tooling updates

Co-authored-by: Cursor <[email protected]>

* Refactor database handling in various modules to use async/await for improved readability and error handling. This includes updates to database opening and closing methods across multiple files, ensuring consistent asynchronous behavior. Additionally, minor adjustments were made to encryption functions to support async operations.

* Refactor sync migration tests to utilize async/await for improved readability. Updated transaction handling to streamline event expectations and cleanup process.

* Refactor various functions to utilize async/await for improved readability and error handling. Updated service stopping, encryption, and file upload/download methods to ensure consistent asynchronous behavior across the application.

* Refactor BudgetFileSelection component to use async/await for onSelect method, enhancing error handling and readability. Update merge tests to utilize async/await for improved clarity in transaction merging expectations.

* Refactor filesystem module to use async/await for init function and related database operations, enhancing error handling and consistency across file interactions. Updated tests to reflect asynchronous behavior in database operations and file writing.

* Fix typo in init function declaration to ensure it returns a Promise<void> instead of Proise<void>.

* Update VRT screenshots

Auto-generated by VRT workflow

PR: #6987

* Update tests to use async/await for init function in web filesystem, ensuring consistent asynchronous behavior in database operations.

* Update VRT screenshot for payees filter test to reflect recent changes

* Update filesystem module to remove web-specific implementations and streamline path handling. Refactor file operations to enhance type safety and consistency across different environments. Add tests for SQLite interactions and ensure proper handling of database transactions.

* Add release notes for maintenance: Remove usage of 'web' file types

* Refactor filesystem module to use type annotations for exports and improve consistency across methods. Remove deprecated web file handling and enhance encryption functions for better browser compatibility.

* Trigger CI

* Add asyncStorage API file to export Electron index module

* Trigger CI

* Feedback: typo

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [AI] Enforce file access authorization on sync API endpoints (#7040)

* [AI] Enforce file access authorization on sync API endpoints

Co-authored-by: Cursor <[email protected]>

* Refactor file deletion authorization to return error message as text

* Refactor file upload validation to improve error handling

* Add tests to allow admin users to retrieve encryption keys and sync files for other users

- Implemented a test for admin access to retrieve encryption keys for another user's file in the /user-get-key endpoint.
- Added a test for admin users to sync another user's file in the /sync endpoint, ensuring proper response and headers.

These changes enhance the authorization checks for admin actions on user files.

* Refactor file cleanup in tests to use onTestFinished for better error handling

* Enhance admin capabilities in file management tests

* Add migration to backfill file owners with admin ID

* Enhance file access authorization in sync API

* Update migration to backfill file owners with admin ID to ensure consistent ordering in the query

* Refactor access control tests for file downloads in sync API

* Add test for non-owner file download access via user_access in sync API

This test verifies that users with appropriate access can download files owned by others, utilizing the requireFileAccess logic and UserService.countUserAccess. It ensures correct response headers and content delivery for shared files.

* Refactor file cleanup in upload and download tests to utilize onTestFinished for improved error handling

This update consolidates file cleanup logic in the test suite, ensuring that temporary files are removed after each test execution. The changes enhance the reliability of tests by consistently managing file state across various scenarios.

---------

Co-authored-by: Cursor <[email protected]>

* Add limit/refill automation types (#6692)

* Add limit/refill automation components

* Add release note

* Fix typecheck

* Rabbit PR feedback

* Review

* [AI] Add per-package tsconfigs and typescript-strict-plugin for typecheck (#7019)

* [AI] Add per-package tsconfigs and typescript-strict-plugin for typecheck

Co-authored-by: Cursor <[email protected]>

* Update TypeScript configuration across multiple packages to correct plugin path key from "path" to "paths" and add reference to process-worker typings in index.electron.ts.

* Remove reference to process-worker typings in index.electron.ts and add new process-worker typings file for global Process augmentation.

* Refactor TypeScript build configurations across multiple packages by removing tsconfig.dist.json files and updating build scripts to use default TypeScript compilation. Adjusted compiler options to target ES2021 and enable declaration generation.

* Update TypeScript configuration in api package to refine include and exclude patterns for better file management.

* Update build script in api package to ensure migration SQL files are copied to the correct directory by creating the destination folder if it doesn't exist.

* Update TypeScript configurations in crdt and desktop-electron packages to refine include and exclude patterns for improved file management.

* Update TypeScript dependencies across multiple packages to include typescript-strict-plugin for enhanced type checking and maintain consistency in package.json files.

---------

Co-authored-by: Cursor <[email protected]>

* v26.2.1: critical security fix for simplefin, pluggy and multi-user (#7043)

* Add release notes for version 26.2.1, including critical security fixes for SimpleFin, Pluggy, and multi-user setups. Remove outdated upcoming release notes for related bugfixes.

* Add release notes for PR #7043

* Delete upcoming-release-notes/7043.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [AI] Bump version to 26.2.1 (#7052)

Co-authored-by: Cursor <[email protected]>

* Rename theme 'Okabe Ito' to 'Color-blind (dark)' (#7058)

* Rename theme 'Okabe Ito' to 'Color-blind (dark)'

* Rename 'Okabe Ito' theme to 'Color-blind (dark)'

* Fix capitalization in theme name for consistency

* Validate file IDs for correctness (#7067)

* Validate file IDs for correctness

* Add release notes

* 🐞 Midnight theme: Change menuAutoCompleteTextHover color - Fixes #7029 (#7048)

* Change menuAutoCompleteTextHover color to green400

* Change menuAutoCompleteTextHover color to green400 in Midnight theme.

Change menuAutoCompleteTextHover color to green400 in Midnight theme.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* :bug: Fix file path on windows (#7076)

* fix file path on windows

* file path in migrations

* release notes

* [AI] Fix API build output path (dist/index.js instead of dist/api/index.js) (#7084)

* [AI] Fix API build output path (dist/index.js instead of dist/api/index.js)

- Set rootDir in packages/api/tsconfig.json so output is under dist/ not dist/api/
- Remove loot-core pegjs.ts from include; add local typings/pegjs.d.ts
- Use mkdir -p in build:migrations for idempotent build
- Exclude **/@types/** so declaration output does not conflict with input

Made-with: Cursor

* Update TypeScript configuration in api package to refine exclude patterns

* Mobile rules item alignment (#7081)

* [AI] Fix mobile rules list items to be full width and left-aligned

- Override Button's default justifyContent/alignItems centering in
  ActionableGridListItem to use flex-start alignment
- Add width: 100% to RulesListItem's SpaceBetween to fill the item width

Co-authored-by: Matiss Janis Aboltins <[email protected]>

* Add release notes for PR #7081

* Change category from Enhancements to Bugfix

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [AI] Remove 'suspect ai generated' label and associated workflow (#7087)

* Initial plan

* [AI] Remove 'suspect ai generated' label and associated workflow

Co-authored-by: MatissJanis <[email protected]>

* [AI] Remove 'suspect ai generated' label from coderabbit config

Co-authored-by: MatissJanis <[email protected]>

* Add release notes for PR #7087

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: MatissJanis <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [Cursor] Development environment setup (#7088)

* [AI] Add Cursor Cloud specific instructions to AGENTS.md

Co-authored-by: Matiss Janis Aboltins <[email protected]>

* [autofix.ci] apply automated fixes

* Add release notes for PR #7088

* [AI] Fix Node.js minimum version requirement in AGENTS.md (#7089)

* [AI] Fix outdated Node.js version requirement in Build Failures section

Co-authored-by: Matiss Janis Aboltins <[email protected]>

* [AI] Add test budget tip to Cursor Cloud instructions

Co-authored-by: Matiss Janis Aboltins <[email protected]>

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>

* [AI] Github action for unfreezing PRs (#7094)

* [AI] Add GitHub Action to add PR to Merge Freeze unblocked list when unfreeze label is added

Made-with: Cursor

* Rename 7093.md to 7094.md

* Add concurrency control to unfreeze job in merge-freeze-unfreeze workflow

- Introduced concurrency settings to prevent overlapping executions of the unfreeze job based on labels.
- Updated error handling to abort the process if fetching the current merge freeze status fails, ensuring unblocked PRs are not overwritten.

* Refactor Merge Freeze workflow to simplify PR unblocking process

- Updated the workflow to directly post the PR to the unblocked list without fetching the current freeze status.
- Improved error handling by ensuring the access token is set before proceeding with the API call.

* Revert "feat(currency): Add Vietnamese Dong (VND) currency" (#7100)

* Revert "feat(currency): Add Vietnamese Dong (VND) currency (#6902)"

This reverts commit 7fa9fa900b3b590078ba88ac70377c25769782a7.

* Add release notes for PR #7100

* Delete 7100.md

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix bugfix categorisation in contributor points counting script (#7103)

* s/bugfix/bugfixes

* note

* add alias functionality

* note update

* [AI] Make merge-freeze-unfreeze workflow work on fork PRs (#7104)

* [AI] Make merge-freeze-unfreeze workflow work on fork PRs via pull_request_target

Made-with: Cursor

* Add release notes for the "unfreeze" workflow functionality in fork PRs

* Add empty permissions block to unfreeze job in merge-freeze-unfreeze workflow

* 🔖 (26.3.0) (#7097)

* 🔖 (26.3.0)

* Remove used release notes

* Add release notes for PR #7097

* Remove used release notes

* Remove used release notes

* Add release notes for version 26.3.0

* Add new terms to spelling expectation list

* Fix spelling and capitalization in release notes

Corrected spelling of 'reorganisation' to 'reorganization' and updated 'coderabbit' to 'CodeRabbit' for consistency.

* Update patterns.txt to allowlist 'CodeRabbit'

Add 'CodeRabbit' to allowlist of proper nouns.

* Clarify chart theming support in release notes

Updated the release notes to specify bar/pie chart theming support and added details about theme variables for customization.

* Remove 'CodeRabbit' from spelling expectations

* Refactor release notes and improve formatting

Reorganize release notes for clarity and update content.

* Create 2026-03-02-release-26-3-0.md

* Change release date to 2026-03-02

Updated the release date for version 26.3.0.

* Update release notes for version 26.3.0

---------

Co-authored-by: jfdoming <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Julian Dominguez-Schatz <[email protected]>

---------

Signed-off-by: Christian Speich <[email protected]>
Signed-off-by: Jonathon Jongsma <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Matiss Janis Aboltins <[email protected]>
Co-authored-by: Michael Clark <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nam <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Stephen Brown II <[email protected]>
Co-authored-by: Matthias Benaets <[email protected]>
Co-authored-by: Joshua Granick <[email protected]>
Co-authored-by: Matt Fiddaman <[email protected]>
Co-authored-by: Adam <[email protected]>
Co-authored-by: Joel Jeremy Marquez <joeljeremy.marquez@gm…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants