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

[WIP] Add progress bars for categories and goals #4371

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tbuist
Copy link

@tbuist tbuist commented Feb 13, 2025

Fixes #2965

This change introduces visual bars to indicate the status of a particular category for that month.

For standard expense categories, green, red, and gray indicate the value you have remaining/overspent in that category.

For categories with a #goal template, the bar uses blue to indicate the progress.

image

@actual-github-bot actual-github-bot bot changed the title Add progress bars for categories and goals [WIP] Add progress bars for categories and goals Feb 13, 2025
Copy link

netlify bot commented Feb 13, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit ab132db
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/67b2a731c1f5b200081356d9
😎 Deploy Preview https://deploy-preview-4371.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 Feb 13, 2025

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
17 6.92 MB → 6.93 MB (+5.45 kB) +0.08%
Changeset
File Δ Size
src/components/budget/ProgressBar.tsx 🆕 +4.27 kB 0 B → 4.27 kB
src/components/settings/Themes.tsx 📈 +961 B (+38.58%) 2.43 kB → 3.37 kB
src/components/budget/SidebarCategory.tsx 📈 +250 B (+4.72%) 5.17 kB → 5.42 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 4.31 MB → 4.31 MB (+5.45 kB) +0.12%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/en-GB.js 99.42 kB 0%
static/js/de.js 111.72 kB 0%
static/js/workbox-window.prod.es5.js 5.69 kB 0%
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/pt-BR.js 106.43 kB 0%
static/js/nl.js 98.54 kB 0%
static/js/wide.js 102.8 kB 0%
static/js/en.js 100.34 kB 0%
static/js/fr.js 61.06 kB 0%
static/js/uk.js 111.11 kB 0%
static/js/narrow.js 85.72 kB 0%
static/js/useAccountPreviewTransactions.js 1.69 kB 0%
static/js/AppliedFilters.js 10.52 kB 0%
static/js/ReportRouter.js 1.59 MB 0%

Copy link
Contributor

github-actions bot commented Feb 13, 2025

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.33 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.js 1.33 MB 0%

@tbuist tbuist force-pushed the tbuist-category-ui-bars branch 2 times, most recently from 7647a40 to 70941bd Compare February 17, 2025 01:55
@tbuist tbuist force-pushed the tbuist-category-ui-bars branch from 70941bd to b805cac Compare February 17, 2025 02:13
@youngcw
Copy link
Member

youngcw commented Feb 17, 2025

Do you have to do something to turn on the progress bars?

What will happen when viewing multiple months?

@tbuist
Copy link
Author

tbuist commented Feb 18, 2025

Do you have to do something to turn on the progress bars?

Yes, I added a global preference in the Themes section. I saw the documentation recommends against adding configuration for small UI tweaks, so I'm happy to hear feedback on if this is big enough to warrant a config option, or if it belongs somewhere else like a feature flag (or on by default, but I didn't want to presume).
image

What will happen when viewing multiple months?

The bars only appear in the sidebar that hosts the category titles, and only consider budgetting/spending in first month that is being looked at. Any thoughts about that? Two examples:
image
image

@Teprifer
Copy link

Do you have to do something to turn on the progress bars?

What will happen when viewing multiple months?

Tick box on the settings page by the theme selector.

Multi month looks like this, with the bars calculated for the left most month:
image

Multi-month presents a tricky UI challenge, probably simplest might be to have it only calculated for the current month, and all hidden when the current month isn't on screen.

My initial thoughts, were the bars look cramped.

Categories without any goal, budgeted, or spent, still have the bar space reserved.

Not sure about the mixed use of a bar to represent goal progress and budgeted vs spent as it's budgeting with goals, and usually goals are paired with templates, but the bar doesn't incorporate those because that way lies madness.

I can see a category bar will go red because an expense was recorded against it, indicator a 'negative' or bad thing, when really it's fine because the category balance is still positive, and the money for it had been budgeted in a prior month. So a little misleading?

Might be worth taking a look at #3424 which attempted to incorporate the multi-month aspects.

@tbuist
Copy link
Author

tbuist commented Feb 18, 2025

Multi-month presents a tricky UI challenge, probably simplest might be to have it only calculated for the current month, and all hidden when the current month isn't on screen.

This seems reasonable and intuitive to me.

My initial thoughts, were the bars look cramped.

Categories without any goal, budgeted, or spent, still have the bar space reserved.

Currently the color would be empty at least, so the bar still shows but doesn't draw as much attention.
image

Not sure about the mixed use of a bar to represent goal progress and budgeted vs spent as it's budgeting with goals, and usually goals are paired with templates, but the bar doesn't incorporate those because that way lies madness.

Fair point.

I can see a category bar will go red because an expense was recorded against it, indicator a 'negative' or bad thing, when really it's fine because the category balance is still positive, and the money for it had been budgeted in a prior month. So a little misleading?

Also a fair point.

Might be worth taking a look at #3424 which attempted to incorporate the multi-month aspects.

Wow, I'm not sure how I missed that entire thread when looking for other attempts at this problem. After skimming, this does seem like a more complex attempt than what I intended mine to be. Thinking more deeply about what I envisioned these bars representing, I think I was targeting only the two most basic use cases:

  1. For expense/template categories in one particular month, how much did I intend to spend, and how much did I actually spend?
  2. For goal categories in one particular month, how much did I intend to save, and how much do I now have saved in total as a result?

I think those cover the intended use cases and avoid entirely the complexity of communicating single- and multi-month statuses for a category at the same time, but obviously does so by limiting the amount of information being shown. That might be a philosophical difference, but I will mull on what multi-month support would need to look like.

@youngcw
Copy link
Member

youngcw commented Feb 18, 2025

I think the progress bars really should be per month and not next to the categories, if we are going to add them. Also this currently doesn't have any indication of underfunded categories which will need added too.

@lelemm
Copy link
Contributor

lelemm commented Feb 18, 2025

I like the idea, but I find it too distracting, not sure if the colors are too intense, or the colors doesn't fit to the overall theme. also, I agree with @youngcw.

I think the progress bars really should be per month and not next to the categories, if we are going to add them. Also this currently doesn't have any indication of underfunded categories which will need added too.

@tbuist
Copy link
Author

tbuist commented Feb 19, 2025

Here's a version that moves the bars out of the category column and also deemphasizes them a little bit by just shrinking the height - thoughts on this?
image

Here's the same height in their original location
image

My thought is that the shorter the horizontal length of the bar, the quicker I'm able to glean what the state of the category is without parsing the actual amounts.

*Edit:
Multi-month bars gets busy really quickly.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Progress bar for targets/templates
4 participants