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

Filter Balance fix #2777

Merged
merged 10 commits into from
May 29, 2024
Merged

Filter Balance fix #2777

merged 10 commits into from
May 29, 2024

Conversation

carkom
Copy link
Contributor

@carkom carkom commented May 18, 2024

On the accounts page - filter balance only adds up transactions that are showing. If your filter has more than one page it won't be added to the balance unless you scroll to the bottom and reveal all transactions. This fixes that.

@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label May 18, 2024
@github-actions github-actions bot changed the title Filter Balance fix [WIP] Filter Balance fix May 18, 2024
@trafico-bot trafico-bot bot added the 🚧 WIP Still work-in-progress, please don't review and don't merge label May 18, 2024
Copy link

netlify bot commented May 18, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit f70962c
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66565853d98b390008f0749e
😎 Deploy Preview https://deploy-preview-2777.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.

@trafico-bot trafico-bot bot removed the 🔍 Ready for Review Pull Request is not reviewed yet label May 18, 2024
Copy link
Contributor

github-actions bot commented May 18, 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.72 MB → 4.72 MB (+563 B) +0.01%
Changeset
File Δ Size
src/components/accounts/Account.jsx 📈 +671 B (+1.46%) 44.75 kB → 45.4 kB
src/components/accounts/Header.jsx 📈 +18 B (+0.12%) 14.98 kB → 15 kB
src/components/accounts/Balance.jsx 📉 -126 B (-2.28%) 5.39 kB → 5.27 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/wide.js 262.56 kB → 263.11 kB (+563 B) +0.21%

Smaller

No assets were smaller

Unchanged

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

Copy link
Contributor

github-actions bot commented May 18, 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.2 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.2 MB 0%

@carkom carkom changed the title [WIP] Filter Balance fix Filter Balance fix May 18, 2024
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed 🚧 WIP Still work-in-progress, please don't review and don't merge labels May 18, 2024
@youngcw youngcw added this to the v24.6.0 milestone May 22, 2024
@psybers
Copy link
Contributor

psybers commented May 25, 2024

Not sure why, but the filter is broken now?

image

If I filter on amount <0 or >0, it puts everything into one of those categories and nothing in the other. The demo data has both deposits and payments, so those two filters should both have transactions.

@carkom
Copy link
Contributor Author

carkom commented May 25, 2024

Not sure why, but the filter is broken now?

If I filter on amount <0 or >0, it puts everything into one of those categories and nothing in the other. The demo data has both deposits and payments, so those two filters should both have transactions.

Can you do the same test on edge? I suspect this is something to do with #2643. Maybe you haven't tried the edge build since that PR was merged?

@psybers
Copy link
Contributor

psybers commented May 25, 2024

@carkom Works fine on edge. And release.

Only broken for me on this PR. Do you also see this behavior here?

@carkom
Copy link
Contributor Author

carkom commented May 25, 2024

@carkom Works fine on edge. And release.

Only broken for me on this PR. Do you also see this behavior here?

Can we clarify the behavior you mention. You use a lot of ambiguous words in your description.

So to be specific, I'm assuming you're saying:

  • Filter with "Amount is greater than or equal to 0" results in the "filter balance" being equal to the account balance.
  • Filter with "Amount is less than or equal to 0" results in "filter balance" being equal to 0

If I've mis-interpreted your comment please let me know.

These both display the the same behavior I see on edge. For greater than or equal filter you need to scroll down until all the transactions are displayed in order to get it all working. For less than or equal to 0 it also shows no transations on edge.

This is due to the 2643 PR I mentioned before.

@psybers
Copy link
Contributor

psybers commented May 25, 2024

bug

@carkom
Copy link
Contributor Author

carkom commented May 25, 2024

bug

Can you post the same video using edge build? This is how it works for me on edge.

@psybers
Copy link
Contributor

psybers commented May 25, 2024

@carkom Oh weird. Now I see that behavior on edge too. Looks like the bug isn't this PR.

@carkom
Copy link
Contributor Author

carkom commented May 25, 2024

@carkom Oh weird. Now I see that behavior on edge too. Looks like the bug isn't this PR.

It's not a bug. It's as intended. If you want to filter on payments/deposits you have to use inflow/outflow from the drop down. This behavior was implemented in PR 2643. Idea was that none of the numbers in the transaction table show as negative so less than 0 should not ever be used.

@youngcw youngcw removed this from the v24.6.0 milestone May 28, 2024
@carkom carkom added this to the v24.6.0 milestone May 28, 2024
@youngcw youngcw removed this from the v24.6.0 milestone May 28, 2024
@carkom carkom added this to the v24.6.0 milestone May 28, 2024
@youngcw
Copy link
Contributor

youngcw commented May 28, 2024

It looks to me like the amount shown in the pill is taking into account multiple accounts. If I look at just the "Bank of America" test account, which always has really small charges, the filtered amount can be way higher than what is actually there.

As a sanity check I've been trying a filter of category, then click the select all box. I get way different values between the two amount summaries that should in theory be the same.
image

@carkom
Copy link
Contributor Author

carkom commented May 28, 2024

It looks to me like the amount shown in the pill is taking into account multiple accounts. If I look at just the "Bank of America" test account, which always has really small charges, the filtered amount can be way higher than what is actually there.

As a sanity check I've been trying a filter of category, then click the select all box. I get way different values between the two amount summaries that should in theory be the same.

Good shout thanks for catching that. All fixed!

youngcw
youngcw previously approved these changes May 28, 2024
@trafico-bot trafico-bot bot added ✅ Approved Pull Request has been approved and can be merged and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 28, 2024
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed ✅ Approved Pull Request has been approved and can be merged labels May 28, 2024
@carkom carkom requested a review from youngcw May 28, 2024 22:22
@trafico-bot trafico-bot bot added ✅ Approved Pull Request has been approved and can be merged and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 29, 2024
@carkom carkom merged commit 1195af7 into actualbudget:master May 29, 2024
19 checks passed
@carkom carkom deleted the filterQuery branch May 29, 2024 18:34
@trafico-bot trafico-bot bot added the ✨ Merged Pull Request has been merged successfully label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Approved Pull Request has been approved and can be merged ✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants