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

✨ (dashboards) ability to save net-worth widget details #3364

Merged
merged 16 commits into from
Sep 9, 2024

Conversation

MatissJanis
Copy link
Member

@MatissJanis MatissJanis commented Sep 4, 2024

Added the ability to save filters & date-ranges on the net worth widgets.

How to use:

  1. open reports page
  2. open a net worth graph (click on it)
  3. in the net worth page: change date-range and maybe add a filter
  4. click save
  5. go back to dashboard
  6. the widget will show the filtered data and with the specific time-range

Feedback is welcome. I plan to implement the same behaviour to the other existing reports too, but starting with just this one.

#3282

@actual-github-bot actual-github-bot bot changed the title ✨ (dashboards) ability to save net-worth widget details [WIP] ✨ (dashboards) ability to save net-worth widget details Sep 4, 2024
Copy link

netlify bot commented Sep 4, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 9eda34d
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66dcbc37eff2ad000869e020
😎 Deploy Preview https://deploy-preview-3364.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 Sep 4, 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 5.22 MB → 5.22 MB (+3.49 kB) +0.07%
Changeset
File Δ Size
src/components/reports/Header.tsx 🆕 +4.76 kB 0 B → 4.76 kB
src/icons/v1/Pause.tsx 🆕 +340 B 0 B → 340 B
src/icons/v1/Play.tsx 🆕 +325 B 0 B → 325 B
home/runner/work/actual/actual/packages/loot-core/src/client/data-hooks/widget.ts 🆕 +236 B 0 B → 236 B
src/components/reports/reports/NetWorth.jsx 📈 +1.39 kB (+30.96%) 4.49 kB → 5.88 kB
src/components/reports/ReportRouter.tsx 📈 +164 B (+18.16%) 903 B → 1.04 kB
src/components/reports/reportRanges.ts 📈 +425 B (+14.81%) 2.8 kB → 3.22 kB
src/components/reports/reports/NetWorthCard.tsx 📈 +220 B (+5.74%) 3.74 kB → 3.96 kB
src/hooks/useFilters.ts 📈 +43 B (+2.84%) 1.48 kB → 1.52 kB
src/components/reports/getLiveRange.ts 📈 +22 B (+2.04%) 1.05 kB → 1.08 kB
src/components/common/Button2.tsx 📈 +24 B (+0.45%) 5.25 kB → 5.27 kB
src/components/reports/Overview.tsx 📈 +30 B (+0.19%) 15.62 kB → 15.65 kB
src/components/reports/ReportSidebar.tsx 📈 +10 B (+0.06%) 17.67 kB → 17.68 kB
src/components/reports/reports/CashFlow.tsx 📉 -244 B (-3.49%) 6.82 kB → 6.58 kB
src/components/reports/Header.jsx 🔥 -4.22 kB (-100%) 4.22 kB → 0 B
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/ReportRouter.js 1.49 MB → 1.5 MB (+3.47 kB) +0.23%
static/js/index.js 3.26 MB → 3.26 MB (+24 B) +0.00%

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 1.59 kB 0%
static/js/AppliedFilters.js 21.01 kB 0%
static/js/narrow.js 78.61 kB 0%
static/js/wide.js 224.31 kB 0%

Copy link
Contributor

github-actions bot commented Sep 4, 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.19 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.19 MB 0%

@MatissJanis MatissJanis changed the title [WIP] ✨ (dashboards) ability to save net-worth widget details ✨ (dashboards) ability to save net-worth widget details Sep 4, 2024
@youngcw
Copy link
Contributor

youngcw commented Sep 5, 2024

The dashboard card doesn't seem to respect the added filters.
Steps:
edited the default net worth report with a new name (working)
set the date range (working)
and added an account filter

The filter is saved and works when viewing the full page report, but the dashboard card doesn't filter down to just the account.

@MikesGlitch
Copy link
Contributor

MikesGlitch commented Sep 5, 2024

I managed to break it by doing the following:

sfdafda

@MatissJanis
Copy link
Member Author

@youngcw - great catch. I forgot to add filters to the dashboard cards 🤦

@MikesGlitch - this looks like a pre-existing issue (visible on edge too). I'll open a separate issue for patching this.

MikesGlitch
MikesGlitch previously approved these changes Sep 5, 2024
@youngcw
Copy link
Contributor

youngcw commented Sep 6, 2024

Will the date ranges update automatically still?

@MatissJanis
Copy link
Member Author

Will the date ranges update automatically still?

Depends how you select them. If you select a specific date-range via the dropdowns: that will remain static. However, if you select via the buttons (i.e. "past year") - that will auto-magically update.

Now that I'm tying this.. it would make sense to display somewhere an indicator if the selected timeframe is static or a sliding window. Any UX suggestions for that?

@youngcw
Copy link
Contributor

youngcw commented Sep 6, 2024

You could always make it like the custom reports where you have to decide if its fixed or dynamic.

@carkom
Copy link
Contributor

carkom commented Sep 7, 2024

Will the date ranges update automatically still?

Depends how you select them. If you select a specific date-range via the dropdowns: that will remain static. However, if you select via the buttons (i.e. "past year") - that will auto-magically update.

Now that I'm tying this.. it would make sense to display somewhere an indicator if the selected timeframe is static or a sliding window. Any UX suggestions for that?

Something like this?

https://github.com/carkom/actual/blob/bf729ca17bd83434f776de70ddb96e3541699968/packages/desktop-client/src/components/reports/Header.jsx

@MikesGlitch MikesGlitch self-requested a review September 7, 2024 07:41
@MatissJanis
Copy link
Member Author

Good idea @carkom ! I used your idea and then slightly built upon that by introducing a play/pause button. That allows us to save vertical space by having just a single button instead of two (+ margins between them).

A question you folks might now ask: why do we still show both the time-frame selector (dropdowns), but also the quick-pick buttons?

I think it makes sense to keep both of these visible at all times. This allows the user to also select, for example, "last 7 months" and then make it "live update". It also allows to quickly select "last 3 months" and then "pause" the timeFrame. Quite a handy feature if you ask me :)

Also: the quick-pick and static selection will automatically update the play/pause state. You can always swap it back.. but by default IMO the quick-pick options should have "play" enabled. And same goes for static selections - those should have "paused" by default, but allow to switch it to "play" if the user wishes so.

Screen.Recording.2024-09-07.at.19.28.10.mov

MikesGlitch
MikesGlitch previously approved these changes Sep 7, 2024
@MatissJanis
Copy link
Member Author

Updated Header component to TS while I'm working in it here.. out for review again!

@youngcw
Copy link
Contributor

youngcw commented Sep 7, 2024

I think it makes sense to keep both of these visible at all times. This allows the user to also select, for example, "last 7 months" and then make it "live update". It also allows to quickly select "last 3 months" and then "pause" the timeFrame. Quite a handy feature if you ask me :)

Maybe we could look into compressing the quick selections down into a menu or something in the future, but for now it looks good.

@carkom
Copy link
Contributor

carkom commented Sep 7, 2024

Looks pretty good!

@MatissJanis can you move filter button to the far right? I'm not sure why it bothers me where it is but it does... 😬

@MatissJanis
Copy link
Member Author

MatissJanis commented Sep 7, 2024

Maybe we could look into compressing the quick selections down into a menu or something in the future, but for now it looks good.

@youngcw that's a good idea for future when we need more vertical space there. But for now I think we're good :)

--

@MatissJanis can you move filter button to the far right? I'm not sure why it bothers me where it is but it does... 😬

@carkom Good idea! Moved them to the far right

@MatissJanis MatissJanis merged commit 68a2af0 into master Sep 9, 2024
19 checks passed
@MatissJanis MatissJanis deleted the matiss/net-worth-save branch September 9, 2024 19:38
a-gradina pushed a commit to a-gradina/actual that referenced this pull request Sep 15, 2024
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.

4 participants