[PR #7954] [MERGED] add trend line to line graphs #126942

Closed
opened 2026-06-14 06:25:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7954
Author: @matt-fidd
Created: 5/25/2026
Status: Merged
Merged: 5/30/2026
Merged by: @matt-fidd

Base: masterHead: reports/trend-line


📝 Commits (5)

📊 Changes

15 files changed (+213 additions, -2 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/ChooseGraph.tsx (+3 -0)
📝 packages/desktop-client/src/components/reports/ReportOptions.ts (+1 -0)
📝 packages/desktop-client/src/components/reports/ReportSidebar.tsx (+15 -0)
📝 packages/desktop-client/src/components/reports/graphs/LineGraph.tsx (+18 -0)
packages/desktop-client/src/components/reports/graphs/util/computeTrendLines.test.ts (+99 -0)
packages/desktop-client/src/components/reports/graphs/util/computeTrendLines.ts (+50 -0)
📝 packages/desktop-client/src/components/reports/reports/CustomReport.tsx (+7 -0)
📝 packages/desktop-client/src/components/reports/reports/GetCardData.tsx (+1 -0)
📝 packages/desktop-client/src/components/reports/spreadsheets/calculateLegend.ts (+1 -1)
📝 packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts (+1 -0)
packages/loot-core/migrations/1780099200000_add_show_trend_lines_report_setting.sql (+5 -0)
📝 packages/loot-core/src/server/aql/schema/index.ts (+1 -0)
📝 packages/loot-core/src/server/reports/app.ts (+2 -0)
📝 packages/loot-core/src/types/models/reports.ts (+3 -1)
upcoming-release-notes/7954.md (+6 -0)

📄 Description

CONTAINS MIGRATION

Description

I feel the need for this when I'm trying to draw a correlation in my data, like seeing if the amount I'm spending is going up on average or down. I toyed with adding it as an option but I feel it's pretty useful regardless and it would need a db migration, happy for pushback on that though.

image

Testing

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 37 14.03 MB → 14.03 MB (+2.89 kB) +0.02%
loot-core 1 5.34 MB → 5.34 MB (+152 B) +0.00%
api 2 3.97 MB → 3.97 MB (+149 B) +0.00%
cli 1 7.97 MB 0%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
37 14.03 MB → 14.03 MB (+2.89 kB) +0.02%
Changeset
File Δ Size
src/components/reports/graphs/util/computeTrendLines.ts 🆕 +932 B 0 B → 932 B
src/components/reports/graphs/LineGraph.tsx 📈 +716 B (+7.65%) 9.14 kB → 9.84 kB
src/components/reports/ReportSidebar.tsx 📈 +501 B (+2.76%) 17.75 kB → 18.24 kB
src/components/reports/ChooseGraph.tsx 📈 +152 B (+1.89%) 7.86 kB → 8.01 kB
src/components/reports/reports/GetCardData.tsx 📈 +111 B (+1.39%) 7.79 kB → 7.9 kB
src/components/reports/reports/CustomReport.tsx 📈 +505 B (+1.18%) 41.85 kB → 42.34 kB
src/components/reports/spreadsheets/recalculate.ts 📈 +23 B (+1.14%) 1.97 kB → 1.99 kB
src/components/reports/ReportOptions.ts 📈 +24 B (+0.32%) 7.23 kB → 7.25 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.26 MB → 1.26 MB (+2.89 kB) +0.22%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 1.54 MB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 962.55 kB 0%
static/js/ManageRules.js 46.98 kB 0%
static/js/PayeeRuleCountLabel.js 7.33 kB 0%
static/js/ScheduleEditForm.js 146.44 kB 0%
static/js/SchedulesTable.js 202.7 kB 0%
static/js/TransactionEdit.js 90.63 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/Value.js 5.08 MB 0%
static/js/_baseIsEqual.js 98.38 kB 0%
static/js/ca.js 186.75 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 101.15 kB 0%
static/js/de.js 170.77 kB 0%
static/js/en-GB.js 9.25 kB 0%
static/js/en.js 198.24 kB 0%
static/js/es.js 178.68 kB 0%
static/js/extends.js 500.96 kB 0%
static/js/fr.js 178.57 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 165 kB 0%
static/js/narrow.js 364.2 kB 0%
static/js/nb-NO.js 148.05 kB 0%
static/js/nl.js 106.24 kB 0%
static/js/pt-BR.js 188.43 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 174.48 kB 0%
static/js/theme.js 31.88 kB 0%
static/js/toString.js 705.14 kB 0%
static/js/uk.js 207.46 kB 0%
static/js/useFormatList.js 2.52 kB 0%
static/js/useTransactionBatchActions.js 9.71 kB 0%
static/js/wide.js 296.1 kB 0%
static/js/workbox-window.prod.es5.js 7.33 kB 0%
static/js/zh-Hans.js 116.89 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.34 MB → 5.34 MB (+152 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/reports/app.ts 📈 +101 B (+2.71%) 3.64 kB → 3.74 kB
home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts 📈 +51 B (+0.51%) 9.76 kB → 9.81 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker._bwMMgjb.js 0 B → 5.34 MB (+5.34 MB) -

Removed

Asset File Size % Changed
kcab.worker.CM8SDlxB.js 5.34 MB → 0 B (-5.34 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
2 3.97 MB → 3.97 MB (+149 B) +0.00%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/reports/app.ts 📈 +99 B (+2.72%) 3.55 kB → 3.65 kB
home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts 📈 +50 B (+0.52%) 9.47 kB → 9.52 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.97 MB → 3.97 MB (+149 B) +0.00%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 7.97 MB 0%
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
cli.js 7.97 MB 0%

crdt

Total

Files count Total bundle size % Changed
1 11.12 kB 0%
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
index.js 11.12 kB 0%

🔄 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/7954 **Author:** [@matt-fidd](https://github.com/matt-fidd) **Created:** 5/25/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `reports/trend-line` --- ### 📝 Commits (5) - [`8723233`](https://github.com/actualbudget/actual/commit/87232334c125f681136bd898197f2957b841b50b) add trend line to line graphs - [`277f579`](https://github.com/actualbudget/actual/commit/277f579522dc46c8c890167ac44fbd48f17ac63e) note - [`fc58bf1`](https://github.com/actualbudget/actual/commit/fc58bf1d639651f991b743ac9bb990f195491260) add to options - [`895dfd5`](https://github.com/actualbudget/actual/commit/895dfd563ad99fa05a31cb21f63035b424c47759) split trend generation logic into seperate handler, add test - [`66857b8`](https://github.com/actualbudget/actual/commit/66857b814232108867a7ee9235cb5c470035e084) tighten types ### 📊 Changes **15 files changed** (+213 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/ChooseGraph.tsx` (+3 -0) 📝 `packages/desktop-client/src/components/reports/ReportOptions.ts` (+1 -0) 📝 `packages/desktop-client/src/components/reports/ReportSidebar.tsx` (+15 -0) 📝 `packages/desktop-client/src/components/reports/graphs/LineGraph.tsx` (+18 -0) ➕ `packages/desktop-client/src/components/reports/graphs/util/computeTrendLines.test.ts` (+99 -0) ➕ `packages/desktop-client/src/components/reports/graphs/util/computeTrendLines.ts` (+50 -0) 📝 `packages/desktop-client/src/components/reports/reports/CustomReport.tsx` (+7 -0) 📝 `packages/desktop-client/src/components/reports/reports/GetCardData.tsx` (+1 -0) 📝 `packages/desktop-client/src/components/reports/spreadsheets/calculateLegend.ts` (+1 -1) 📝 `packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts` (+1 -0) ➕ `packages/loot-core/migrations/1780099200000_add_show_trend_lines_report_setting.sql` (+5 -0) 📝 `packages/loot-core/src/server/aql/schema/index.ts` (+1 -0) 📝 `packages/loot-core/src/server/reports/app.ts` (+2 -0) 📝 `packages/loot-core/src/types/models/reports.ts` (+3 -1) ➕ `upcoming-release-notes/7954.md` (+6 -0) </details> ### 📄 Description # CONTAINS MIGRATION <!-- 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://actualbudget.org/docs/contributing/#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> ## Description <!-- What does this PR do? Why is it needed? Please give context on the "why?": why do we need this change? What problem is it solving for you?--> I feel the need for this when I'm trying to draw a correlation in my data, like seeing if the amount I'm spending is going up on average or down. I toyed with adding it as an option but I feel it's pretty useful regardless and it would need a db migration, happy for pushback on that though. <img width="1161" height="959" alt="image" src="https://github.com/user-attachments/assets/2f029ae3-afd5-4417-b2c9-c8651d030f24" /> ## Related issue(s) <!-- e.g. Fixes #123, Relates to #456 --> ## Testing <!-- What did you test? How can we reproduce the issue you are fixing or how can we test the feature you built? --> ## Checklist - [x] Release notes added (see link above) - [x] No obvious regressions in affected areas - [x] Self-review has been performed - I understand what each change in the code does and why it is needed <!--- actual-bot-sections ---> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 37 | 14.03 MB → 14.03 MB (+2.89 kB) | +0.02% loot-core | 1 | 5.34 MB → 5.34 MB (+152 B) | +0.00% api | 2 | 3.97 MB → 3.97 MB (+149 B) | +0.00% cli | 1 | 7.97 MB | 0% crdt | 1 | 11.12 kB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 37 | 14.03 MB → 14.03 MB (+2.89 kB) | +0.02% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/reports/graphs/util/computeTrendLines.ts` | 🆕 +932 B | 0 B → 932 B `src/components/reports/graphs/LineGraph.tsx` | 📈 +716 B (+7.65%) | 9.14 kB → 9.84 kB `src/components/reports/ReportSidebar.tsx` | 📈 +501 B (+2.76%) | 17.75 kB → 18.24 kB `src/components/reports/ChooseGraph.tsx` | 📈 +152 B (+1.89%) | 7.86 kB → 8.01 kB `src/components/reports/reports/GetCardData.tsx` | 📈 +111 B (+1.39%) | 7.79 kB → 7.9 kB `src/components/reports/reports/CustomReport.tsx` | 📈 +505 B (+1.18%) | 41.85 kB → 42.34 kB `src/components/reports/spreadsheets/recalculate.ts` | 📈 +23 B (+1.14%) | 1.97 kB → 1.99 kB `src/components/reports/ReportOptions.ts` | 📈 +24 B (+0.32%) | 7.23 kB → 7.25 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/ReportRouter.js | 1.26 MB → 1.26 MB (+2.89 kB) | +0.22% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 1.54 MB | 0% static/js/BackgroundImage.js | 121.09 kB | 0% static/js/FormulaEditor.js | 962.55 kB | 0% static/js/ManageRules.js | 46.98 kB | 0% static/js/PayeeRuleCountLabel.js | 7.33 kB | 0% static/js/ScheduleEditForm.js | 146.44 kB | 0% static/js/SchedulesTable.js | 202.7 kB | 0% static/js/TransactionEdit.js | 90.63 kB | 0% static/js/TransactionList.js | 85.81 kB | 0% static/js/Value.js | 5.08 MB | 0% static/js/_baseIsEqual.js | 98.38 kB | 0% static/js/ca.js | 186.75 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 101.15 kB | 0% static/js/de.js | 170.77 kB | 0% static/js/en-GB.js | 9.25 kB | 0% static/js/en.js | 198.24 kB | 0% static/js/es.js | 178.68 kB | 0% static/js/extends.js | 500.96 kB | 0% static/js/fr.js | 178.57 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 165 kB | 0% static/js/narrow.js | 364.2 kB | 0% static/js/nb-NO.js | 148.05 kB | 0% static/js/nl.js | 106.24 kB | 0% static/js/pt-BR.js | 188.43 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 174.48 kB | 0% static/js/theme.js | 31.88 kB | 0% static/js/toString.js | 705.14 kB | 0% static/js/uk.js | 207.46 kB | 0% static/js/useFormatList.js | 2.52 kB | 0% static/js/useTransactionBatchActions.js | 9.71 kB | 0% static/js/wide.js | 296.1 kB | 0% static/js/workbox-window.prod.es5.js | 7.33 kB | 0% static/js/zh-Hans.js | 116.89 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.34 MB → 5.34 MB (+152 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/reports/app.ts` | 📈 +101 B (+2.71%) | 3.64 kB → 3.74 kB `home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts` | 📈 +51 B (+0.51%) | 9.76 kB → 9.81 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker._bwMMgjb.js | 0 B → 5.34 MB (+5.34 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CM8SDlxB.js | 5.34 MB → 0 B (-5.34 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 2 | 3.97 MB → 3.97 MB (+149 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/reports/app.ts` | 📈 +99 B (+2.72%) | 3.55 kB → 3.65 kB `home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts` | 📈 +50 B (+0.52%) | 9.47 kB → 9.52 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- index.js | 3.97 MB → 3.97 MB (+149 B) | +0.00% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- models.js | 0 B | 0% </div> </details> --- #### cli **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 7.97 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **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 ----- | --------- | --------- cli.js | 7.97 MB | 0% </div> </details> --- #### crdt **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 11.12 kB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **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 ----- | --------- | --------- index.js | 11.12 kB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <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-06-14 06:25:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#126942