[PR #5641] [MERGED] Reports - Add an option to trim the start & end intervals #6046

Closed
opened 2026-02-28 21:23:05 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5641
Author: @MikesGlitch
Created: 8/28/2025
Status: Merged
Merged: 10/5/2025
Merged by: @MikesGlitch

Base: masterHead: trim-empty-intervals-charts


📝 Commits (10+)

📊 Changes

13 files changed (+252 additions, -3 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/ReportOptions.ts (+1 -0)
📝 packages/desktop-client/src/components/reports/ReportSidebar.tsx (+16 -0)
📝 packages/desktop-client/src/components/reports/reports/CustomReport.tsx (+8 -0)
📝 packages/desktop-client/src/components/reports/reports/GetCardData.tsx (+2 -0)
📝 packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts (+30 -2)
📝 packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts (+24 -0)
packages/desktop-client/src/components/reports/spreadsheets/trimIntervals.ts (+153 -0)
📝 packages/desktop-client/src/hooks/useReports.ts (+1 -0)
packages/loot-core/migrations/1759260219000_add_trim_interval_report_setting.sql (+6 -0)
📝 packages/loot-core/src/server/aql/schema/index.ts (+1 -0)
📝 packages/loot-core/src/server/reports/app.ts (+2 -1)
📝 packages/loot-core/src/types/models/reports.ts (+2 -0)
upcoming-release-notes/5641.md (+6 -0)

📄 Description

Purpose of this feature

My budget data goes back to 2015, but some charts only have meaningful entries starting from 2018. I use live ranges to keep charts up to date, but there's currently no way to set a custom start date and use live ranges - it's just "all time":

image

This results in charts cluttered with empty space. That’s where the option to Trim intervals comes in. It automatically removes empty periods from the beginning and end of the report, making the charts cleaner. This is more flexible than just adding a start date to the live range because it also works on end dates where there is no data (trimming end intervals).

Below are some examples.

Before (intervals at start show as empty)

image

After:

Empty intervals at start are trimmed
image

Trims the empty intervals at the start and end
trims end

Preserves empty intervals in the middle of the dataset
preserves empty intervals in middle

Trims the intervals via the grouped-spreadsheet
table


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/5641 **Author:** [@MikesGlitch](https://github.com/MikesGlitch) **Created:** 8/28/2025 **Status:** ✅ Merged **Merged:** 10/5/2025 **Merged by:** [@MikesGlitch](https://github.com/MikesGlitch) **Base:** `master` ← **Head:** `trim-empty-intervals-charts` --- ### 📝 Commits (10+) - [`a0a7d0f`](https://github.com/actualbudget/actual/commit/a0a7d0fa044af31c13028fdb4d0cfddecee186fb) initial test to trim the intervals - [`15b824a`](https://github.com/actualbudget/actual/commit/15b824a8836fd2adaddc83b194464f4157615195) bit more - [`ff05d89`](https://github.com/actualbudget/actual/commit/ff05d89e5606637b950a35dcf21facdce41a8bf8) got the logic - [`fd8ef41`](https://github.com/actualbudget/actual/commit/fd8ef414887c7d23ddf6ed38213697c8be555aa0) fix table data - [`96e5982`](https://github.com/actualbudget/actual/commit/96e5982479a75d02b0081361aef847d80c3d0c2d) Merge branch 'master' into trim-empty-intervals-charts - [`5a6ae76`](https://github.com/actualbudget/actual/commit/5a6ae76cbdb3b16bde1a70daa9a7e85e46043b16) add migration for trim intervals - [`bf34457`](https://github.com/actualbudget/actual/commit/bf34457b1ed149a6251951af5cd7ec0dd556b5a5) release notes - [`e76efd7`](https://github.com/actualbudget/actual/commit/e76efd74712afa504af9003171f03c4395899156) nice work rabbit - [`2949f17`](https://github.com/actualbudget/actual/commit/2949f17e200f92ac7d4e4b9fbb8fba0a2fed3063) small cleanup - [`cc6da5a`](https://github.com/actualbudget/actual/commit/cc6da5a5967bdabff3c2d22271ad1cd190166c07) not sure how major that is but yeah why not ### 📊 Changes **13 files changed** (+252 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/ReportOptions.ts` (+1 -0) 📝 `packages/desktop-client/src/components/reports/ReportSidebar.tsx` (+16 -0) 📝 `packages/desktop-client/src/components/reports/reports/CustomReport.tsx` (+8 -0) 📝 `packages/desktop-client/src/components/reports/reports/GetCardData.tsx` (+2 -0) 📝 `packages/desktop-client/src/components/reports/spreadsheets/custom-spreadsheet.ts` (+30 -2) 📝 `packages/desktop-client/src/components/reports/spreadsheets/grouped-spreadsheet.ts` (+24 -0) ➕ `packages/desktop-client/src/components/reports/spreadsheets/trimIntervals.ts` (+153 -0) 📝 `packages/desktop-client/src/hooks/useReports.ts` (+1 -0) ➕ `packages/loot-core/migrations/1759260219000_add_trim_interval_report_setting.sql` (+6 -0) 📝 `packages/loot-core/src/server/aql/schema/index.ts` (+1 -0) 📝 `packages/loot-core/src/server/reports/app.ts` (+2 -1) 📝 `packages/loot-core/src/types/models/reports.ts` (+2 -0) ➕ `upcoming-release-notes/5641.md` (+6 -0) </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> ## Purpose of this feature My budget data goes back to 2015, but some charts only have meaningful entries starting from 2018. I use live ranges to keep charts up to date, but there's currently no way to set a custom start date and use live ranges - it's just "all time": <img width="299" height="133" alt="image" src="https://github.com/user-attachments/assets/19fe486c-77f9-4f37-a522-149783377cd5" /> This results in charts cluttered with empty space. That’s where the option to Trim intervals comes in. It automatically removes empty periods from the beginning and end of the report, making the charts cleaner. This is more flexible than just adding a start date to the live range because it also works on end dates where there is no data (trimming end intervals). Below are some examples. ### Before (intervals at start show as empty) <img width="1039" height="326" alt="image" src="https://github.com/user-attachments/assets/25e84af0-7e93-46ca-b5e8-a85baea5ec00" /> ### After: **Empty intervals at start are trimmed** <img width="1127" height="344" alt="image" src="https://github.com/user-attachments/assets/14c0fffa-4c88-4974-920e-3b065ad351f9" /> **Trims the empty intervals at the start and end** ![trims end](https://github.com/user-attachments/assets/54f62fea-bbd6-49f9-8525-2d47cc2517f8) **Preserves empty intervals in the middle of the dataset** ![preserves empty intervals in middle](https://github.com/user-attachments/assets/52b36c55-d074-4cba-9642-e5b91c1fdd20) **Trims the intervals via the grouped-spreadsheet** ![table](https://github.com/user-attachments/assets/eee7d9a2-5155-41e5-a70f-d1d12b350cd1) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:23:05 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6046