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

Custom Reports: add save reports menu #2257

Merged
merged 22 commits into from
Feb 5, 2024

Conversation

carkom
Copy link
Contributor

@carkom carkom commented Jan 20, 2024

Expanding the menu for saving reports and adding hooks and logic.

The actual "save to db" code is commented out as the table doesn't exist yet.

@trafico-bot trafico-bot bot added the 🚧 WIP label Jan 20, 2024
Copy link

netlify bot commented Jan 20, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit ce4b670
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/65c0ab3e023cc3000903431b
😎 Deploy Preview https://deploy-preview-2257.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 Jan 20, 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
10 4.99 MB → 4.99 MB (+6.58 kB) +0.13%
Changeset
File Δ Size
src/components/reports/SaveReportName.tsx 🆕 +1.97 kB 0 B → 1.97 kB
src/components/reports/SaveReportMenu.tsx 🆕 +1.42 kB 0 B → 1.42 kB
src/components/reports/SaveReport.tsx 📈 +1.55 kB (+86.27%) 1.79 kB → 3.34 kB
src/components/reports/ReportTopbar.jsx 📈 +403 B (+7.58%) 5.19 kB → 5.58 kB
src/components/reports/reports/CustomReport.jsx 📈 +1021 B (+7.52%) 13.27 kB → 14.26 kB
home/runner/work/actual/actual/packages/loot-core/src/client/data-hooks/reports.ts 📈 +23 B (+3.29%) 700 B → 723 B
src/components/reports/ReportSidebar.jsx 📈 +300 B (+1.96%) 14.95 kB → 15.25 kB
src/components/reports/ReportOptions.ts 📉 -59 B (-1.63%) 3.54 kB → 3.48 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/ReportRouter.js 1.84 MB → 1.85 MB (+6.58 kB) +0.35%

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/ButtonLink.js 379 B 0%
static/js/narrow.js 80.18 kB 0%
static/js/BalanceTooltip.js 6.06 kB 0%
static/js/AppliedFilters.js 28.99 kB 0%
static/js/wide.js 240.55 kB 0%
static/js/index.js 2.65 MB 0%

Copy link
Contributor

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


import { v4 as uuidv4 } from 'uuid';

//import { send, sendCatch } from 'loot-core/src/platform/client/fetch';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Saved for next PR where db table is created and save menu is functional

if (menuItem === 'save-report') {
//create new flow
/*
res = await sendCatch('report/create', {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Next PR will use this to save the report props to the db table

};
//send update and rename to DB
/*
res = await sendCatch('report/update', {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Next PR will use this to update the report props to the db table

@carkom carkom changed the title [WIP] Custom Reports: add save reports menu Custom Reports: add save reports menu Feb 5, 2024
@carkom
Copy link
Contributor Author

carkom commented Feb 5, 2024

This is ready for review. Please keep in mind that while the menu works it's only saving to the page state not to any database as the table will be created in the next PR. This is just to get the menu functioning as intended, will add db table and connections next.

@Teprifer
Copy link

Teprifer commented Feb 5, 2024

Wahoo!

While I've started trying to learn the code side of things(inspired in no small part to what I'm seeing yourself and others do with Actual) I'm still about useful there as a dead fish on a hot day. So nothing from me there.

I do like the context aware menu, options are all self explanatory and discoverable.

Revert changes = awesome!
Update report = excellent!
Reset to Default = very nice!
Having a divider between 'this report' options and 'general options' is a good choice.

Some notes from poking around:

  • It still tags the name with (modified) if a setting is changed, then changed back.
  • Toggling Labels doesn't trigger the (modified) tag or save/revert options.
  • Toggling Summary doesn't trigger the (modified) tag or save/revert options.
  • Toggling Legend doesn't trigger the (modified) tag or save/revert options.

On these last three points, there are some graphs I'd want them visible on, and others I wouldn't. Overall I'd expect the 'look' I create for a report would include these options as they form a part of it.

Suggestions:

  • Add a confirm prompt to the delete option.
  • There's a lot of horizontal space available, could the space that displays of the save report name be made wider (340-450px) to allow for descriptive names? This still allows a reasonably narrow window before it'd overflow.

From your comment re: saving I'm going to assume the drop down menu for report selection is later for obvious reasons.

Not specific to this PR, but I did note that you can toggle labels on the table chart, which doesn't make sense. I'll add this to the main feedback thread to keep it separate.

@carkom
Copy link
Contributor Author

carkom commented Feb 5, 2024

Thanks for the UI review and subsequent feedback!

Legend/Summary/Label choices are all global variables so they stay as is. If you navigate away from the report (to accounts screen for example) then come back, they will be as you left them. This is as intended and not likely to change.

Thanks for the suggestions they are both good ideas.

@carkom carkom merged commit 4c4f2fd into actualbudget:master Feb 5, 2024
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Feb 5, 2024
@carkom carkom deleted the addSaveReportsMenu branch February 5, 2024 22:40
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
* Add schema work

* notes

* merge fixes

* Add Reports Save Menu

* merge fixes

* updates

* notes

* updates

* updates

* save updates fix

* typecheck fixes

* merge fixes

* saveReport strict Typescript

* fix sidebar

* lint fix

* fixing functionality plus clean up

* clean up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants