Skip to content

Conversation

pogman-code
Copy link
Contributor

This add a live time range similar to "Year to date" but for the previous year.
This is useful to compare to current and previous year on the same time range.

I am not sure of the wording though (nor the placement withing the dropdown).

@actual-github-bot actual-github-bot bot changed the title Add 'Last year to date' time range [WIP] Add 'Last year to date' time range Jul 29, 2025
Copy link

netlify bot commented Jul 29, 2025

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit a558000
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/689217b7f9d7620008650cd5
😎 Deploy Preview https://deploy-preview-5419.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 project configuration.

Copy link
Contributor

github-actions bot commented Jul 29, 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
21 10.51 MB → 10.51 MB (+1.09 kB) +0.01%
Changeset
File Δ Size
src/components/reports/getLiveRange.ts 📈 +193 B (+17.53%) 1.08 kB → 1.26 kB
src/components/reports/Header.tsx 📈 +452 B (+6.37%) 6.93 kB → 7.37 kB
src/components/reports/reportRanges.ts 📈 +175 B (+3.92%) 4.36 kB → 4.53 kB
src/components/reports/ReportOptions.ts 📈 +202 B (+2.60%) 7.58 kB → 7.77 kB
src/components/reports/disabledList.ts 📈 +76 B (+1.79%) 4.15 kB → 4.22 kB
home/runner/work/actual/actual/packages/loot-core/src/shared/months.ts 📈 +19 B (+0.23%) 8.11 kB → 8.13 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/ReportRouter.js 826.76 kB → 827.83 kB (+1.07 kB) +0.13%
static/js/index.js 7.87 MB → 7.87 MB (+19 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/de.js 138.95 kB 0%
static/js/en-GB.js 6.38 kB 0%
static/js/en.js 125.68 kB 0%
static/js/es.js 70.7 kB 0%
static/js/fr.js 146.12 kB 0%
static/js/nl.js 100.01 kB 0%
static/js/pl.js 84.56 kB 0%
static/js/pt-BR.js 138.91 kB 0%
static/js/sv.js 64.72 kB 0%
static/js/th.js 189.32 kB 0%
static/js/uk.js 120.22 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 12.94 kB 0%
static/js/workbox-window.prod.es5.js 5.64 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/narrow.js 393.99 kB 0%
static/js/wide.js 116.08 kB 0%
static/js/TransactionList.js 10.92 kB 0%
static/js/useAccountPreviewTransactions.js 3.15 kB 0%

Copy link
Contributor

github-actions bot commented Jul 29, 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 2.26 MB 0%
Changeset
File Δ Size
packages/loot-core/src/shared/months.ts 📈 +17 B (+0.14%) 12 kB → 12.02 kB
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 2.26 MB 0%

@pogman-code pogman-code changed the title [WIP] Add 'Last year to date' time range Add 'Last year to date' time range Jul 29, 2025
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

This change adds a new "Prior year to date" date range option to the desktop client's reporting components. The option is integrated into the date range selection UI, the array of available date range options, and the list of disabled interval options. The date range calculation logic is extended with a new mode to compute the start of the previous year through the equivalent date last year. The TimeFrame type is updated to include the 'priorYearToDate' mode. Additionally, a utility function for calculating the previous year was modified to accept a customizable date format parameter.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

✨ Merged

Suggested reviewers

  • matt-fidd

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00d12eb and 2d4ed6e.

⛔ Files ignored due to path filters (7)
  • packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-cash-flow-graph-and-checks-visuals-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-loads-net-worth-graph-and-checks-visuals-3-chromium-linux.png is excluded by !**/*.png
  • upcoming-release-notes/5419.md is excluded by !**/*.md
📒 Files selected for processing (7)
  • packages/desktop-client/src/components/reports/Header.tsx (1 hunks)
  • packages/desktop-client/src/components/reports/ReportOptions.ts (1 hunks)
  • packages/desktop-client/src/components/reports/disabledList.ts (1 hunks)
  • packages/desktop-client/src/components/reports/getLiveRange.ts (1 hunks)
  • packages/desktop-client/src/components/reports/reportRanges.ts (1 hunks)
  • packages/loot-core/src/shared/months.ts (1 hunks)
  • packages/loot-core/src/types/models/dashboard.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • packages/loot-core/src/shared/months.ts
  • packages/desktop-client/src/components/reports/getLiveRange.ts
  • packages/desktop-client/src/components/reports/Header.tsx
  • packages/desktop-client/src/components/reports/reportRanges.ts
  • packages/desktop-client/src/components/reports/disabledList.ts
  • packages/desktop-client/src/components/reports/ReportOptions.ts
  • packages/loot-core/src/types/models/dashboard.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Functional
  • GitHub Check: Visual regression
  • GitHub Check: build (ubuntu-latest)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@matt-fidd
Copy link
Member

"Last year to date" reads to me as "from the start of last year, to the current date on this year".

Eg today 2024-01-01 -> 2025-08-02

I agree though, better wording is difficult. I'll keep thinking it over, but I don't want to merge yet.

@matt-fidd
Copy link
Member

The only two I can come up with:

  • Prior YTD
  • YTD Last Year

@pogman-code
Copy link
Contributor Author

It seems that PYTD (Prior/Previous Year to Date) is a term used in financial reports globally, so I guess your idea is the good one :D

@pogman-code pogman-code changed the title Add 'Last year to date' time range Add 'Prior year to date' time range Aug 5, 2025
@pogman-code
Copy link
Contributor Author

/update-vrt

Copy link
Member

@matt-fidd matt-fidd left a comment

Choose a reason for hiding this comment

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

Thanks!

I can see the use in this, so I'll add my approval.

We do need to be careful that we don't clutter the top bar with lots of more niche filters that could be set up manually for those that want them though.

Will give it a couple of days for any other opinions before I merge.

@youngcw
Copy link
Member

youngcw commented Aug 7, 2025

At some point it would be nice to just have the live ranges be configurable. That would remove the need for most of the different range options that are there.

@youngcw youngcw merged commit 3c34603 into actualbudget:master Aug 7, 2025
24 checks passed
Johnn27 pushed a commit to Johnn27/actual that referenced this pull request Aug 12, 2025
* add 'Last year to date' time range

* Rename 'Last YTD' to 'Prior YTD'

* Day accurate prevYear for Prior YTD

* Update VRT
@tomasgriffin
Copy link

@youngcw just out of interest, would something akin to Datadog's DateRangePicker be what you mean when you refer to the live ranges being "configurable"?

@youngcw
Copy link
Member

youngcw commented Aug 13, 2025

@youngcw just out of interest, would something akin to Datadog's DateRangePicker be what you mean when you refer to the live ranges being "configurable"?

We would need to have a date range picker that supported start and end dates, as well as an update time. So pick a starting window, then you need to decide if you want that window to update every year, quarter, month, week, day, etc.

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