[PR #8097] [CLOSED] [AI] fix(reports): apply correct filters when drilling down from Transfer/Uncategorized bars #122326

Closed
opened 2026-06-11 21:08:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/8097
Author: @okxint
Created: 6/5/2026
Status: Closed

Base: masterHead: fix/report-drill-down-transfer-filter


📝 Commits (2)

  • e1b1790 [AI] fix(reports): apply correct filters when drilling down from Transfer/Uncategorized bars
  • a410f61 [AI] fix(reports): resolve TypeScript type errors in BarGraph and DonutGraph for uncategorized_id

📊 Changes

10 files changed (+87 additions, -27 deletions)

View changed files

📝 packages/desktop-client/src/components/reports/graphs/BarGraph.tsx (+24 -18)
📝 packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx (+9 -1)
📝 packages/desktop-client/src/components/reports/graphs/LineGraph.tsx (+2 -0)
📝 packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx (+1 -0)
📝 packages/desktop-client/src/components/reports/graphs/showActivity.ts (+25 -7)
📝 packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx (+4 -0)
📝 packages/desktop-client/src/components/reports/spreadsheets/calculateLegend.ts (+9 -1)
📝 packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts (+3 -0)
📝 packages/loot-core/src/types/models/reports.ts (+4 -0)
upcoming-release-notes/7999.md (+6 -0)

📄 Description

Summary

Fixes #7999.

When clicking a Transfers (or Uncategorized/Off-budget) bar in a Custom Report chart, the drill-down navigated to the transactions page but applied no category filter — showing all transactions for the period instead of just transfers.

Root cause

Transfer, Off-budget, and Uncategorized (other) are pseudo-categories defined with id: ''. In showActivity.ts, the filter construction uses:

id && { field, op: 'is', value: id, type: 'id' }

Since '' && ... is falsy, the filter is silently dropped and the drill-down shows everything.

Fix

Threads uncategorized_id ('transfer' | 'off_budget' | 'other') from UncategorizedEntity through the data pipeline:

recalculateGroupedEntitycalculateLegendLegendEntity → chart click handlers → showActivity

In showActivity, pseudo-categories now receive the correct filters:

uncategorized_id Filter applied
transfer { field: 'transfer', op: 'is', value: true }
other { field: 'category', op: 'is', value: null } + { field: 'transfer', op: 'is', value: false }
off_budget (account-level filter already handles this; no category filter added)

Files changed

  • reports.ts — add optional uncategorized_id to GroupedEntity and LegendEntity
  • recalculate.ts — preserve uncategorized_id from source UncategorizedEntity
  • calculateLegend.ts — pass through uncategorized_id to legend entries
  • showActivity.ts — add uncategorized_id param and build correct filters
  • BarGraph, DonutGraph, LineGraph, StackedBarGraph, ReportTableRow — pass uncategorized_id from legend entry to showActivity

Testing

  1. Create a Custom Report split by Category, type Deposit, interval Weekly
  2. Click on the Transfers bar
  3. Confirm the drill-down shows only transfer transactions (not all deposits)
  4. Repeat for the Uncategorized bar — should show only truly uncategorized transactions

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 37 14.05 MB → 14.05 MB (+1.34 kB) +0.01%
loot-core 1 5.28 MB 0%
api 2 3.86 MB 0%
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.05 MB → 14.05 MB (+1.34 kB) +0.01%
Changeset
File Δ Size
src/components/reports/graphs/showActivity.ts 📈 +347 B (+18.60%) 1.82 kB → 2.16 kB
src/components/reports/spreadsheets/calculateLegend.ts 📈 +206 B (+14.94%) 1.35 kB → 1.55 kB
src/components/reports/spreadsheets/recalculate.ts 📈 +86 B (+4.22%) 1.99 kB → 2.08 kB
src/components/reports/graphs/tableGraph/ReportTableRow.tsx 📈 +319 B (+2.41%) 12.95 kB → 13.26 kB
src/components/reports/graphs/LineGraph.tsx 📈 +186 B (+1.85%) 9.84 kB → 10.03 kB
src/components/reports/graphs/DonutGraph.tsx 📈 +132 B (+0.57%) 22.77 kB → 22.9 kB
src/components/reports/graphs/StackedBarGraph.tsx 📈 +48 B (+0.48%) 9.8 kB → 9.84 kB
src/components/reports/graphs/BarGraph.tsx 📈 +47 B (+0.41%) 11.21 kB → 11.26 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 (+1.34 kB) +0.10%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 1.56 MB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 962.55 kB 0%
static/js/ManageRules.js 46.6 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.26 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 100.8 kB 0%
static/js/de.js 170.65 kB 0%
static/js/en-GB.js 9.25 kB 0%
static/js/en.js 200.02 kB 0%
static/js/es.js 178.21 kB 0%
static/js/extends.js 508.06 kB 0%
static/js/fr.js 178.06 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 164.53 kB 0%
static/js/narrow.js 364.2 kB 0%
static/js/nb-NO.js 147.72 kB 0%
static/js/nl.js 106.82 kB 0%
static/js/pt-BR.js 187.97 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 174.31 kB 0%
static/js/theme.js 31.88 kB 0%
static/js/toString.js 705.14 kB 0%
static/js/uk.js 208.65 kB 0%
static/js/useFormatList.js 2.52 kB 0%
static/js/useTransactionBatchActions.js 9.71 kB 0%
static/js/wide.js 298.88 kB 0%
static/js/workbox-window.prod.es5.js 7.33 kB 0%
static/js/zh-Hans.js 116.84 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.28 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
kcab.worker.BkkH_8jr.js 5.28 MB 0%

api

Total

Files count Total bundle size % Changed
2 3.86 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
index.js 3.86 MB 0%
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/8097 **Author:** [@okxint](https://github.com/okxint) **Created:** 6/5/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/report-drill-down-transfer-filter` --- ### 📝 Commits (2) - [`e1b1790`](https://github.com/actualbudget/actual/commit/e1b1790cf3ddd6f15f43e8645c98bcbe5e087aa3) [AI] fix(reports): apply correct filters when drilling down from Transfer/Uncategorized bars - [`a410f61`](https://github.com/actualbudget/actual/commit/a410f61ad88f7b44696c5b709a1bcb094068c5be) [AI] fix(reports): resolve TypeScript type errors in BarGraph and DonutGraph for uncategorized_id ### 📊 Changes **10 files changed** (+87 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/reports/graphs/BarGraph.tsx` (+24 -18) 📝 `packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx` (+9 -1) 📝 `packages/desktop-client/src/components/reports/graphs/LineGraph.tsx` (+2 -0) 📝 `packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx` (+1 -0) 📝 `packages/desktop-client/src/components/reports/graphs/showActivity.ts` (+25 -7) 📝 `packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx` (+4 -0) 📝 `packages/desktop-client/src/components/reports/spreadsheets/calculateLegend.ts` (+9 -1) 📝 `packages/desktop-client/src/components/reports/spreadsheets/recalculate.ts` (+3 -0) 📝 `packages/loot-core/src/types/models/reports.ts` (+4 -0) ➕ `upcoming-release-notes/7999.md` (+6 -0) </details> ### 📄 Description ## Summary Fixes #7999. When clicking a **Transfers** (or Uncategorized/Off-budget) bar in a Custom Report chart, the drill-down navigated to the transactions page but applied no category filter — showing all transactions for the period instead of just transfers. ### Root cause `Transfer`, `Off-budget`, and `Uncategorized (other)` are pseudo-categories defined with `id: ''`. In `showActivity.ts`, the filter construction uses: ```ts id && { field, op: 'is', value: id, type: 'id' } ``` Since `'' && ...` is falsy, the filter is silently dropped and the drill-down shows everything. ### Fix Threads `uncategorized_id` (`'transfer' | 'off_budget' | 'other'`) from `UncategorizedEntity` through the data pipeline: `recalculate` → `GroupedEntity` → `calculateLegend` → `LegendEntity` → chart click handlers → `showActivity` In `showActivity`, pseudo-categories now receive the correct filters: | `uncategorized_id` | Filter applied | |-|-| | `transfer` | `{ field: 'transfer', op: 'is', value: true }` | | `other` | `{ field: 'category', op: 'is', value: null }` + `{ field: 'transfer', op: 'is', value: false }` | | `off_budget` | _(account-level filter already handles this; no category filter added)_ | ## Files changed - `reports.ts` — add optional `uncategorized_id` to `GroupedEntity` and `LegendEntity` - `recalculate.ts` — preserve `uncategorized_id` from source `UncategorizedEntity` - `calculateLegend.ts` — pass through `uncategorized_id` to legend entries - `showActivity.ts` — add `uncategorized_id` param and build correct filters - `BarGraph`, `DonutGraph`, `LineGraph`, `StackedBarGraph`, `ReportTableRow` — pass `uncategorized_id` from legend entry to `showActivity` ## Testing 1. Create a Custom Report split by **Category**, type **Deposit**, interval **Weekly** 2. Click on the **Transfers** bar 3. Confirm the drill-down shows only transfer transactions (not all deposits) 4. Repeat for the **Uncategorized** bar — should show only truly uncategorized transactions <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 37 | 14.05 MB → 14.05 MB (+1.34 kB) | +0.01% loot-core | 1 | 5.28 MB | 0% api | 2 | 3.86 MB | 0% 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.05 MB → 14.05 MB (+1.34 kB) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/components/reports/graphs/showActivity.ts` | 📈 +347 B (+18.60%) | 1.82 kB → 2.16 kB `src/components/reports/spreadsheets/calculateLegend.ts` | 📈 +206 B (+14.94%) | 1.35 kB → 1.55 kB `src/components/reports/spreadsheets/recalculate.ts` | 📈 +86 B (+4.22%) | 1.99 kB → 2.08 kB `src/components/reports/graphs/tableGraph/ReportTableRow.tsx` | 📈 +319 B (+2.41%) | 12.95 kB → 13.26 kB `src/components/reports/graphs/LineGraph.tsx` | 📈 +186 B (+1.85%) | 9.84 kB → 10.03 kB `src/components/reports/graphs/DonutGraph.tsx` | 📈 +132 B (+0.57%) | 22.77 kB → 22.9 kB `src/components/reports/graphs/StackedBarGraph.tsx` | 📈 +48 B (+0.48%) | 9.8 kB → 9.84 kB `src/components/reports/graphs/BarGraph.tsx` | 📈 +47 B (+0.41%) | 11.21 kB → 11.26 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 (+1.34 kB) | +0.10% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 1.56 MB | 0% static/js/BackgroundImage.js | 121.09 kB | 0% static/js/FormulaEditor.js | 962.55 kB | 0% static/js/ManageRules.js | 46.6 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.26 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 100.8 kB | 0% static/js/de.js | 170.65 kB | 0% static/js/en-GB.js | 9.25 kB | 0% static/js/en.js | 200.02 kB | 0% static/js/es.js | 178.21 kB | 0% static/js/extends.js | 508.06 kB | 0% static/js/fr.js | 178.06 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 164.53 kB | 0% static/js/narrow.js | 364.2 kB | 0% static/js/nb-NO.js | 147.72 kB | 0% static/js/nl.js | 106.82 kB | 0% static/js/pt-BR.js | 187.97 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 174.31 kB | 0% static/js/theme.js | 31.88 kB | 0% static/js/toString.js | 705.14 kB | 0% static/js/uk.js | 208.65 kB | 0% static/js/useFormatList.js | 2.52 kB | 0% static/js/useTransactionBatchActions.js | 9.71 kB | 0% static/js/wide.js | 298.88 kB | 0% static/js/workbox-window.prod.es5.js | 7.33 kB | 0% static/js/zh-Hans.js | 116.84 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.28 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 ----- | --------- | --------- kcab.worker.BkkH_8jr.js | 5.28 MB | 0% </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 2 | 3.86 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 ----- | --------- | --------- index.js | 3.86 MB | 0% 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-11 21:08:22 -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#122326