[PR #6711] [MERGED] Enhance Average Goal Template to allow adjusting the budgetted amount… #48507

Closed
opened 2026-04-26 10:26:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6711
Author: @totallynotjon
Created: 1/19/2026
Status: Merged
Merged: 1/21/2026
Merged by: @youngcw

Base: masterHead: average_buffer


📝 Commits (10+)

  • fe74e37 Enhance Average Goal Template to allow adjusting the budgetted amount from the average by a percent or fixed amount
  • bbbfd0d fix typos
  • ee3a70a ensure check is for undefined, so zero doesn't cause edge cases
  • 902cb8a typo in enhancement message
  • a332c84 scale by cents for fixed amount, fixup tests for this as well
  • f2f1c21 Add support for fixed values in Schedule template
  • c9bb1bb [autofix.ci] apply automated fixes
  • 94d1b85 Changed to 'fixed' from 'amount'. Added unparse logic for Average, also fixed Schedule unparse
  • 3e1d4cc Merge branch 'master' into average_buffer
  • b6ddf97 move to generic for syntax from specific number

📊 Changes

9 files changed (+284 additions, -41 deletions)

View changed files

📝 packages/docs/docs/experimental/goal-templates.md (+35 -21)
📝 packages/loot-core/src/server/budget/category-template-context.test.ts (+131 -0)
📝 packages/loot-core/src/server/budget/category-template-context.ts (+26 -1)
📝 packages/loot-core/src/server/budget/goal-template.pegjs (+9 -5)
📝 packages/loot-core/src/server/budget/schedule-template.test.ts (+20 -0)
📝 packages/loot-core/src/server/budget/schedule-template.ts (+27 -3)
📝 packages/loot-core/src/server/budget/template-notes.ts (+27 -11)
📝 packages/loot-core/src/types/models/templates.ts (+3 -0)
upcoming-release-notes/6711.md (+6 -0)

📄 Description

Enhance Average Goal Template to allow adjusting the budgeted amount from the average by a percent or fixed amount

It just allows some extra syntax for average goal template to add or remove from the budget after the average calculation. This could be used to give a buffer so that a category accumulates extra over time, or simply as a caution.

To stick with the convention of Schedules, decrease is included as it is easy enough to implement. In theory someone might make use of this. To try and cut down on spending for a category gradually.

#6709

Pretty lightweight add, I adjusted the peggy file and types to add adjustment similar to the ScheduleTemplate. I also built in adjustmentType to allow support for percent and fixed amount changes.

I adjusted the docs to reflect the new functionality.

I also added in tests for the new template params.


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 28 14.4 MB 0%
loot-core 1 5.83 MB → 5.84 MB (+5.95 kB) +0.10%
api 1 4.37 MB → 4.38 MB (+5.21 kB) +0.12%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
28 14.4 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
static/js/index.js 9.24 MB 0%
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.66 kB 0%
static/js/de.js 171.61 kB 0%
static/js/en-GB.js 6.98 kB 0%
static/js/en.js 159.34 kB 0%
static/js/es.js 172.08 kB 0%
static/js/fr.js 177.92 kB 0%
static/js/it.js 172.51 kB 0%
static/js/nb-NO.js 158.17 kB 0%
static/js/nl.js 103.44 kB 0%
static/js/pl.js 88.64 kB 0%
static/js/pt-BR.js 146.42 kB 0%
static/js/ru.js 106.97 kB 0%
static/js/sv.js 78.36 kB 0%
static/js/th.js 182.48 kB 0%
static/js/uk.js 216.45 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 120.54 kB 0%
static/js/ReportRouter.js 1.05 MB 0%
static/js/narrow.js 640.86 kB 0%
static/js/TransactionList.js 101.58 kB 0%
static/js/wide.js 159.96 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.83 MB → 5.84 MB (+5.95 kB) +0.10%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/budget/template-notes.ts 📈 +656 B (+9.14%) 7.01 kB → 7.65 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/goal-template.pegjs 📈 +4.26 kB (+5.86%) 72.75 kB → 77.02 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/schedule-template.ts 📈 +469 B (+5.35%) 8.55 kB → 9.01 kB
home/runner/work/actual/actual/packages/loot-core/src/server/budget/category-template-context.ts 📈 +607 B (+2.66%) 22.31 kB → 22.91 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.BInehE-N.js 0 B → 5.84 MB (+5.84 MB) -

Removed

Asset File Size % Changed
kcab.worker.B3_-Z7dv.js 5.83 MB → 0 B (-5.83 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 4.37 MB → 4.38 MB (+5.21 kB) +0.12%
Changeset
File Δ Size
src/server/budget/template-notes.ts 📈 +608 B (+9.53%) 6.23 kB → 6.82 kB
src/server/budget/goal-template.pegjs 📈 +3.68 kB (+5.75%) 63.92 kB → 67.6 kB
src/server/budget/schedule-template.ts 📈 +421 B (+5.33%) 7.71 kB → 8.12 kB
src/server/budget/category-template-context.ts 📈 +535 B (+2.62%) 19.92 kB → 20.45 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
bundle.api.js 4.37 MB → 4.38 MB (+5.21 kB) +0.12%

Smaller
No assets were smaller

Unchanged
No assets were unchanged


🔄 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/6711 **Author:** [@totallynotjon](https://github.com/totallynotjon) **Created:** 1/19/2026 **Status:** ✅ Merged **Merged:** 1/21/2026 **Merged by:** [@youngcw](https://github.com/youngcw) **Base:** `master` ← **Head:** `average_buffer` --- ### 📝 Commits (10+) - [`fe74e37`](https://github.com/actualbudget/actual/commit/fe74e3779e6fb1db05d7960173aeaf69bf79fbcb) Enhance Average Goal Template to allow adjusting the budgetted amount from the average by a percent or fixed amount - [`bbbfd0d`](https://github.com/actualbudget/actual/commit/bbbfd0d21d25fdeb7af8db33982e81cd8bae40ec) fix typos - [`ee3a70a`](https://github.com/actualbudget/actual/commit/ee3a70a7be314c1f208ea8be55b49d795e59cdc4) ensure check is for undefined, so zero doesn't cause edge cases - [`902cb8a`](https://github.com/actualbudget/actual/commit/902cb8a9d7d98d9d5a7ba196e4d4a12d6a6a40e7) typo in enhancement message - [`a332c84`](https://github.com/actualbudget/actual/commit/a332c84fee0872de374644f30d4f751bcf36bfd6) scale by cents for fixed amount, fixup tests for this as well - [`f2f1c21`](https://github.com/actualbudget/actual/commit/f2f1c21d9d0d0174e3dae4b2abc7c38849bcc788) Add support for fixed values in Schedule template - [`c9bb1bb`](https://github.com/actualbudget/actual/commit/c9bb1bbf4cea82257f41342d1660270d5738003d) [autofix.ci] apply automated fixes - [`94d1b85`](https://github.com/actualbudget/actual/commit/94d1b856fdeb3b34fe5cabaa305f653b65f61ca5) Changed to 'fixed' from 'amount'. Added unparse logic for Average, also fixed Schedule unparse - [`3e1d4cc`](https://github.com/actualbudget/actual/commit/3e1d4cc954ea1fd608a9c0ccb01e39d20ea6319b) Merge branch 'master' into average_buffer - [`b6ddf97`](https://github.com/actualbudget/actual/commit/b6ddf97704238122fb7469c10f7ff2bc03aad41a) move to generic for syntax from specific number ### 📊 Changes **9 files changed** (+284 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `packages/docs/docs/experimental/goal-templates.md` (+35 -21) 📝 `packages/loot-core/src/server/budget/category-template-context.test.ts` (+131 -0) 📝 `packages/loot-core/src/server/budget/category-template-context.ts` (+26 -1) 📝 `packages/loot-core/src/server/budget/goal-template.pegjs` (+9 -5) 📝 `packages/loot-core/src/server/budget/schedule-template.test.ts` (+20 -0) 📝 `packages/loot-core/src/server/budget/schedule-template.ts` (+27 -3) 📝 `packages/loot-core/src/server/budget/template-notes.ts` (+27 -11) 📝 `packages/loot-core/src/types/models/templates.ts` (+3 -0) ➕ `upcoming-release-notes/6711.md` (+6 -0) </details> ### 📄 Description Enhance Average Goal Template to allow adjusting the budgeted amount from the average by a percent or fixed amount It just allows some extra syntax for average goal template to add or remove from the budget after the average calculation. This could be used to give a buffer so that a category accumulates extra over time, or simply as a caution. To stick with the convention of Schedules, decrease is included as it is easy enough to implement. In theory someone might make use of this. To try and cut down on spending for a category gradually. #6709 Pretty lightweight add, I adjusted the peggy file and types to add adjustment similar to the ScheduleTemplate. I also built in adjustmentType to allow support for percent and fixed amount changes. I adjusted the docs to reflect the new functionality. I also added in tests for the new template params. <hr> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 28 | 14.4 MB | 0% loot-core | 1 | 5.83 MB → 5.84 MB (+5.95 kB) | +0.10% api | 1 | 4.37 MB → 4.38 MB (+5.21 kB) | +0.12% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 28 | 14.4 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **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 ----- | --------- | --------- static/js/index.js | 9.24 MB | 0% 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.66 kB | 0% static/js/de.js | 171.61 kB | 0% static/js/en-GB.js | 6.98 kB | 0% static/js/en.js | 159.34 kB | 0% static/js/es.js | 172.08 kB | 0% static/js/fr.js | 177.92 kB | 0% static/js/it.js | 172.51 kB | 0% static/js/nb-NO.js | 158.17 kB | 0% static/js/nl.js | 103.44 kB | 0% static/js/pl.js | 88.64 kB | 0% static/js/pt-BR.js | 146.42 kB | 0% static/js/ru.js | 106.97 kB | 0% static/js/sv.js | 78.36 kB | 0% static/js/th.js | 182.48 kB | 0% static/js/uk.js | 216.45 kB | 0% static/js/resize-observer.js | 18.37 kB | 0% static/js/BackgroundImage.js | 120.54 kB | 0% static/js/ReportRouter.js | 1.05 MB | 0% static/js/narrow.js | 640.86 kB | 0% static/js/TransactionList.js | 101.58 kB | 0% static/js/wide.js | 159.96 kB | 0% static/js/AppliedFilters.js | 9.71 kB | 0% static/js/usePayeeRuleCounts.js | 11.79 kB | 0% static/js/useTransactionBatchActions.js | 13.23 kB | 0% static/js/FormulaEditor.js | 1.04 MB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.83 MB → 5.84 MB (+5.95 kB) | +0.10% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/budget/template-notes.ts` | 📈 +656 B (+9.14%) | 7.01 kB → 7.65 kB `home/runner/work/actual/actual/packages/loot-core/src/server/budget/goal-template.pegjs` | 📈 +4.26 kB (+5.86%) | 72.75 kB → 77.02 kB `home/runner/work/actual/actual/packages/loot-core/src/server/budget/schedule-template.ts` | 📈 +469 B (+5.35%) | 8.55 kB → 9.01 kB `home/runner/work/actual/actual/packages/loot-core/src/server/budget/category-template-context.ts` | 📈 +607 B (+2.66%) | 22.31 kB → 22.91 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.BInehE-N.js | 0 B → 5.84 MB (+5.84 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.B3_-Z7dv.js | 5.83 MB → 0 B (-5.83 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.37 MB → 4.38 MB (+5.21 kB) | +0.12% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/server/budget/template-notes.ts` | 📈 +608 B (+9.53%) | 6.23 kB → 6.82 kB `src/server/budget/goal-template.pegjs` | 📈 +3.68 kB (+5.75%) | 63.92 kB → 67.6 kB `src/server/budget/schedule-template.ts` | 📈 +421 B (+5.33%) | 7.71 kB → 8.12 kB `src/server/budget/category-template-context.ts` | 📈 +535 B (+2.62%) | 19.92 kB → 20.45 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- bundle.api.js | 4.37 MB → 4.38 MB (+5.21 kB) | +0.12% **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <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-04-26 10:26:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#48507