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 date paused #2080

Merged
merged 9 commits into from
Dec 15, 2023
Merged

Custom Reports date paused #2080

merged 9 commits into from
Dec 15, 2023

Conversation

carkom
Copy link
Contributor

@carkom carkom commented Dec 13, 2023

Add live/static choice for date filters.

Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit ac60b9f
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/657c2bcec2bfcf000894cb41
😎 Deploy Preview https://deploy-preview-2080.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 Dec 13, 2023

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
16 3.08 MB → 3.09 MB (+362 B) +0.01%
Changeset
File Δ Size
src/components/reports/ReportSidebar.js 📈 +1.63 kB (+9.17%) 17.75 kB → 19.38 kB
src/components/reports/spreadsheets/grouped-spreadsheet.ts 📈 +56 B (+1.44%) 3.81 kB → 3.86 kB
src/components/reports/CategorySelector.tsx 📈 +138 B (+1.23%) 10.94 kB → 11.08 kB
src/components/reports/reports/CustomReport.js 📈 +190 B (+1.17%) 15.86 kB → 16.05 kB
src/components/reports/spreadsheets/default-spreadsheet.tsx 📉 -67 B (-1.53%) 4.29 kB → 4.22 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/reports.chunk.js 76.33 kB → 76.68 kB (+362 B) +0.46%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/main.js 1.26 MB 0%
static/js/665.chunk.js 824.28 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/444.chunk.js 156.11 kB 0%
static/js/231.chunk.js 117.38 kB 0%
static/js/wide-components.chunk.js 114.96 kB 0%
static/js/narrow-components.chunk.js 51.17 kB 0%
static/js/226.chunk.js 28.94 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 911 B 0%

Copy link
Contributor

github-actions bot commented Dec 13, 2023

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
2 2.23 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.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

Comment on lines 87 to 91
if (cond === 'live') {
onSelectRange(dateRange);
} else {
onChangeDates(startDate, endDate);
}
Copy link
Member

Choose a reason for hiding this comment

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

💬 suggestion: ‏I don't quite understand why we have 2x different callbacks here. Why not unify them into a single one onDateChange/onChangeDate? Would make things easier and reduce duplication.

Surely on the consumer level you're not storing 2x different dates for the custom reports, but instead a single date (or if you are storing 2x dates - that's actually a problem that we will need to solve before we save them to the DB).

Copy link
Member

Choose a reason for hiding this comment

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

The local usage of 2x date ranges also seems off to me, but I understand why it's done as-is (to make the implementation easier). So I'm OK with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it was unesseccary extra code. I think it's better now.

For reference I am not saving 2 dates. Current saved fields are: (isDateStatic, dateRange, startDate, endDate). First one tells us if it's a static or live graph, if live then next one saves the dateRange for the live graph, if static the final 2 tell us the start/end date.

Concievably this could all be stored as one array if that's easier to maintain.

dateArray{isDateStatic: (true/false), dateRange: string, startDate: yyyy-mm-dd, endDate: yyyy-mm-dd}

Copy link
Member

Choose a reason for hiding this comment

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

Those are 2x date-ranges though: 1) dateRange; 2) startDate + endDate. We should not be saving duplicate information in the DB (eventually).

You could combine them in just a single date object: startDate + endDate + isStatic. If isStatic = false then you can use endDate - startDate to calculate the dateRange value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would that equation know the difference between "thisMonth" and "lastMonth"? Especially for a graph I save now then don't open again for a couple months? Seems overly complex for something that can be solved by saving it directly as a simple string.

Copy link
Member

Choose a reason for hiding this comment

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

Good argument. I hadn't thought about the this month/last month problem. In that case it does make sense to keep all the values.

@carkom carkom merged commit 4497fbc into actualbudget:master Dec 15, 2023
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Dec 15, 2023
@carkom carkom deleted the datePaused branch December 15, 2023 23:05
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
* work

* fixes

* updates

* update table layout

* revert changes

* notes

* updae names and improve flow
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.

2 participants