Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Goals]: Add a long term goal template #3012

Merged
merged 34 commits into from
Jul 26, 2024
Merged

Conversation

youngcw
Copy link
Member

@youngcw youngcw commented Jul 8, 2024

This adds in the ability to set a goal in a strict sense. Instead of a monthly auto budget template like what we have had up till now, this adds in the option to set a purely visual goal. This type wont apply anything to the budget but will flag the goal as a "long goal" in the db that is then used to color the balance for personal reference.

For a basic test use a note like #goal 500. Then try out different budget amounts to adjust the balance. If the total balance is <500 it should be marked as unmet. If >=500, met.

The goal directive will not unset the budgeted amount, so the category acts like a normal category, just with a colored balance.

This should work in conjunction with other templates too. For example

#template 100 up to 500
#goal 500

The goals get run after templates so the value to get green coloring is 500 not 100, but 100 will automatically get budgeted. In this case the budgeted amount will get overwritten since there is a template in the category.

Based on #3011
docs: actualbudget/docs#401

@github-actions github-actions bot changed the title [Goals]: Add a long term goal template [WIP] [Goals]: Add a long term goal template Jul 8, 2024
Copy link

netlify bot commented Jul 8, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 639ed09
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66a181b3b747db0008895a51
😎 Deploy Preview https://deploy-preview-3012.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 site configuration.

Copy link
Contributor

github-actions bot commented Jul 8, 2024

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
9 4.79 MB → 4.79 MB (+751 B) +0.01%
Changeset
File Δ Size
src/components/budget/BalanceWithCarryover.tsx 📈 +133 B (+7.71%) 1.68 kB → 1.81 kB
src/components/modals/RolloverBalanceMenuModal.tsx 📈 +64 B (+2.70%) 2.31 kB → 2.38 kB
src/components/modals/ReportBalanceMenuModal.tsx 📈 +62 B (+2.70%) 2.24 kB → 2.3 kB
home/runner/work/actual/actual/packages/loot-core/src/client/queries.ts 📈 +84 B (+1.24%) 6.6 kB → 6.68 kB
src/components/mobile/budget/BudgetTable.jsx 📈 +280 B (+0.54%) 50.94 kB → 51.22 kB
src/components/budget/report/ReportComponents.tsx 📈 +63 B (+0.53%) 11.62 kB → 11.68 kB
src/components/budget/rollover/RolloverComponents.tsx 📈 +65 B (+0.51%) 12.53 kB → 12.59 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.04 MB → 3.04 MB (+343 B) +0.01%
static/js/narrow.js 78 kB → 78.27 kB (+280 B) +0.35%
static/js/wide.js 277.1 kB → 277.22 kB (+128 B) +0.05%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 27.61 kB 0%
static/js/ReportRouter.js 1.23 MB 0%

Copy link
Contributor

github-actions bot commented Jul 8, 2024

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 1.14 MB → 1.14 MB (+1.37 kB) +0.12%
Changeset
File Δ Size
packages/loot-core/src/server/budget/goal-template.pegjs 📈 +3.97 kB (+7.86%) 50.5 kB → 54.47 kB
packages/loot-core/src/server/budget/goaltemplates.ts 📈 +1.57 kB (+7.23%) 21.72 kB → 23.29 kB
packages/loot-core/src/server/sheet.ts 📈 +86 B (+1.28%) 6.57 kB → 6.66 kB
packages/loot-core/src/server/budget/base.ts 📈 +88 B (+0.58%) 14.84 kB → 14.92 kB
packages/loot-core/src/server/budget/actions.ts 📈 +53 B (+0.51%) 10.24 kB → 10.29 kB
packages/loot-core/src/server/aql/schema/index.ts 📈 +66 B (+0.46%) 14.07 kB → 14.13 kB
packages/loot-core/src/server/budget/cleanup-template.ts 📈 +38 B (+0.29%) 12.84 kB → 12.87 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.14 MB → 1.14 MB (+1.37 kB) +0.12%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@youngcw youngcw changed the title [WIP] [Goals]: Add a long term goal template [Goals]: Add a long term goal template Jul 9, 2024
@atgrey24
Copy link

The "Apply Budget Template" option for an individual category doesn't seem to be working on individual categories. Behavior works as expected for both Apply and Overwrite on the whole budget month.

Overall I really like this new capability, and think it should be included in the eventual goals UI #496

@youngcw
Copy link
Member Author

youngcw commented Jul 16, 2024

@atgrey24 I think its all working now. Can you test it again?

@atgrey24
Copy link

@atgrey24 I think its all working now. Can you test it again?

Had to reset the budget cache, but now it seems to be working as expected. Thanks!

@youngcw youngcw changed the title [Goals]: Add a long term goal template [WIP] [Goals]: Add a long term goal template Jul 16, 2024
@youngcw youngcw changed the title [WIP] [Goals]: Add a long term goal template [Goals]: Add a long term goal template Jul 16, 2024
@youngcw youngcw added this to the v24.8.0 milestone Jul 21, 2024
Copy link
Contributor

@matt-fidd matt-fidd left a comment

Choose a reason for hiding this comment

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

Nothing pops out in the code and functionally it's handled everything I've thrown at it.
Looking forward to using this!

@youngcw youngcw merged commit 511f677 into master Jul 26, 2024
19 checks passed
@youngcw youngcw deleted the youngcw/goal-type-template branch July 26, 2024 16:04
youngcw added a commit to actualbudget/docs that referenced this pull request Jul 26, 2024
This adds the description about how a `goal` template line works with
some examples.
Also some minor tweaks to the page

matches actualbudget/actual#3012
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.

5 participants