[PR #4994] [MERGED] Add runningBalances to usePreviewTransactions and an option to set the starting balance to start running balance calculation from #5695

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/4994
Author: @joel-jeremy
Created: 5/15/2025
Status: Merged
Merged: 5/15/2025
Merged by: @joel-jeremy

Base: masterHead: usePreviewTransactions-runningBalances


📝 Commits (2)

  • 7b18655 Add runningBalances to usePreviewTransactions and an option to set the starting balance to start running balance calculation from
  • 2d56a9a Add filter to usePreviewTransactions and set startingBalance to account and category preview transaction hooks

📊 Changes

11 files changed (+300 additions, -104 deletions)

View changed files

📝 packages/desktop-client/src/components/accounts/Reconcile.tsx (+1 -1)
📝 packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx (+4 -4)
📝 packages/desktop-client/src/components/mobile/accounts/Accounts.tsx (+10 -4)
📝 packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx (+3 -3)
📝 packages/desktop-client/src/components/sidebar/Accounts.tsx (+3 -3)
📝 packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts (+92 -25)
📝 packages/desktop-client/src/hooks/useCategoryPreviewTransactions.ts (+69 -15)
📝 packages/desktop-client/src/hooks/useCategoryScheduleGoalTemplates.ts (+16 -6)
📝 packages/loot-core/src/client/data-hooks/transactions.ts (+75 -25)
📝 packages/loot-core/src/client/queries.ts (+21 -18)
upcoming-release-notes/4994.md (+6 -0)

📄 Description

How to use:

const { previewTransactions, runningBalances } = usePreviewTransactions({
  options: {
    startingBalance: getAccountBalance(accountId)
  },
}); 

useAccountPreviewTransactions and useCategoryPreviewTransactions have also been updated to use account balance and category balance as startingBalance respectively.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/4994 **Author:** [@joel-jeremy](https://github.com/joel-jeremy) **Created:** 5/15/2025 **Status:** ✅ Merged **Merged:** 5/15/2025 **Merged by:** [@joel-jeremy](https://github.com/joel-jeremy) **Base:** `master` ← **Head:** `usePreviewTransactions-runningBalances` --- ### 📝 Commits (2) - [`7b18655`](https://github.com/actualbudget/actual/commit/7b186554f75f54cb85de7d91c99ce6713ee7b6e1) Add runningBalances to usePreviewTransactions and an option to set the starting balance to start running balance calculation from - [`2d56a9a`](https://github.com/actualbudget/actual/commit/2d56a9aa7c47c0bd08ff7093b6082e7f02444737) Add filter to usePreviewTransactions and set startingBalance to account and category preview transaction hooks ### 📊 Changes **11 files changed** (+300 additions, -104 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/accounts/Reconcile.tsx` (+1 -1) 📝 `packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx` (+4 -4) 📝 `packages/desktop-client/src/components/mobile/accounts/Accounts.tsx` (+10 -4) 📝 `packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx` (+3 -3) 📝 `packages/desktop-client/src/components/sidebar/Accounts.tsx` (+3 -3) 📝 `packages/desktop-client/src/hooks/useAccountPreviewTransactions.ts` (+92 -25) 📝 `packages/desktop-client/src/hooks/useCategoryPreviewTransactions.ts` (+69 -15) 📝 `packages/desktop-client/src/hooks/useCategoryScheduleGoalTemplates.ts` (+16 -6) 📝 `packages/loot-core/src/client/data-hooks/transactions.ts` (+75 -25) 📝 `packages/loot-core/src/client/queries.ts` (+21 -18) ➕ `upcoming-release-notes/4994.md` (+6 -0) </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> How to use: ```js const { previewTransactions, runningBalances } = usePreviewTransactions({ options: { startingBalance: getAccountBalance(accountId) }, }); ``` `useAccountPreviewTransactions` and `useCategoryPreviewTransactions` have also been updated to use account balance and category balance as `startingBalance` respectively. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:16:53 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5695