Skip to content

[AI] Fix missing payee on schedule previews if the schedule has a split - #8624

Merged
youngcw merged 2 commits into
masterfrom
fix-schedule-preview-split-payee
Aug 3, 2026
Merged

youngcw merged 2 commits into
masterfrom
fix-schedule-preview-split-payee

Conversation

@youngcw

@youngcw youngcw commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Description

Fix issue where schedules that have a split had an empty payee in the upcoming transaction.

Fixed by Claude

Related issue(s)

Testing

  • Create a schedule that creates a split that will occur in the next few days
  • Go to the respective bank account and look at the line for the upcoming schedule
  • Edge will have nothing in the payee field other that the split symbol. This PR will show the same payee text as a real transaction

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I have read every line of this diff and can explain what each change does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 39 13.21 MB → 13.2 MB (-1.15 kB) -0.01%
loot-core 1 4.62 MB 0%
api 2 3.84 MB 0%
cli 1 8.02 MB 0%
crdt 1 11.16 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
39 13.21 MB → 13.2 MB (-1.15 kB) -0.01%
Changeset
File Δ Size
src/hooks/useDisplayPayee.tsx 📈 +340 B (+10.25%) 3.24 kB → 3.57 kB
locale/en.json 📈 +512 B (+0.24%) 209.06 kB → 209.56 kB
locale/pl.json 📉 -75 B (-0.05%) 137.12 kB → 137.04 kB
locale/zh-Hans.json 📉 -63 B (-0.06%) 107.6 kB → 107.54 kB
locale/da.json 📉 -59 B (-0.06%) 95.93 kB → 95.87 kB
locale/de.json 📉 -140 B (-0.08%) 179.43 kB → 179.29 kB
locale/pt-BR.json 📉 -156 B (-0.08%) 179.81 kB → 179.66 kB
locale/es.json 📉 -146 B (-0.09%) 165.25 kB → 165.11 kB
locale/nl.json 📉 -129 B (-0.09%) 144.95 kB → 144.82 kB
locale/uk.json 📉 -182 B (-0.09%) 200.9 kB → 200.72 kB
locale/ca.json 📉 -161 B (-0.09%) 171.84 kB → 171.68 kB
locale/fr.json 📉 -164 B (-0.10%) 168.31 kB → 168.15 kB
locale/nb-NO.json 📉 -146 B (-0.10%) 136.65 kB → 136.51 kB
locale/it.json 📉 -168 B (-0.11%) 152.74 kB → 152.57 kB
locale/ru.json 📉 -168 B (-0.11%) 142.72 kB → 142.56 kB
locale/th.json 📉 -269 B (-0.16%) 165.62 kB → 165.36 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/en.js 209.06 kB → 209.56 kB (+512 B) +0.24%
static/js/Value.js 2 MB → 2 MB (+340 B) +0.02%

Smaller

Asset File Size % Changed
static/js/th.js 165.62 kB → 165.36 kB (-269 B) -0.16%
static/js/uk.js 200.9 kB → 200.72 kB (-182 B) -0.09%
static/js/it.js 152.74 kB → 152.57 kB (-168 B) -0.11%
static/js/ru.js 142.72 kB → 142.56 kB (-168 B) -0.11%
static/js/fr.js 168.31 kB → 168.15 kB (-164 B) -0.10%
static/js/ca.js 171.84 kB → 171.68 kB (-161 B) -0.09%
static/js/pt-BR.js 179.81 kB → 179.66 kB (-156 B) -0.08%
static/js/es.js 165.25 kB → 165.11 kB (-146 B) -0.09%
static/js/nb-NO.js 136.65 kB → 136.51 kB (-146 B) -0.10%
static/js/de.js 179.43 kB → 179.29 kB (-140 B) -0.08%
static/js/nl.js 144.95 kB → 144.82 kB (-129 B) -0.09%
static/js/pl.js 137.12 kB → 137.04 kB (-75 B) -0.05%
static/js/zh-Hans.js 107.6 kB → 107.54 kB (-63 B) -0.06%
static/js/da.js 95.93 kB → 95.87 kB (-59 B) -0.06%

Unchanged

Asset File Size % Changed
static/js/index.js 1.56 MB 0%
static/js/AppliedFilters.js 35.51 kB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 762.13 kB 0%
static/js/ManageRules.js 69.17 kB 0%
static/js/PayeeRuleCountLabel.js 9.41 kB 0%
static/js/ReportRouter.js 1.2 MB 0%
static/js/ScheduleEditForm.js 185.01 kB 0%
static/js/SchedulesTable.js 170.95 kB 0%
static/js/TransactionEdit.js 107.62 kB 0%
static/js/TransactionList.js 79.22 kB 0%
static/js/bootstrapHyperFormula.js 302 B 0%
static/js/chart-theme.js 670.14 kB 0%
static/js/client.js 452.05 kB 0%
static/js/en-GB.js 11.1 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/narrow.js 284.96 kB 0%
static/js/theme.js 31.1 kB 0%
static/js/useDateFormat.js 2.92 MB 0%
static/js/useFormatList.js 9.31 kB 0%
static/js/useTransactionBatchActions.js 9.77 kB 0%
static/js/wide.js 272.21 kB 0%
static/js/workbox-window.prod.es5.js 7.21 kB 0%

loot-core

Total

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

api

Total

Files count Total bundle size % Changed
2 3.84 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.84 MB 0%
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 8.02 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 8.02 MB 0%

crdt

Total

Files count Total bundle size % Changed
1 11.16 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.16 kB 0%

useDisplayPayee determined a split parent's payee by querying the DB
for its children, which works for persisted transactions but not for
schedule preview rows, whose split children only ever exist in
memory. Merge in-memory is_child rows into the subtransaction lookup
so preview splits get the same computed payee real splits already do.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@actual-github-bot actual-github-bot Bot changed the title [AI] Fix missing payee on schedule previews with a split underneath [WIP] [AI] Fix missing payee on schedule previews with a split underneath Aug 3, 2026
@netlify

netlify Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit d5427a8
🔍 Latest deploy log https://app.netlify.com/projects/actualbudget/deploys/6a70b8ee4ec3e60008a19f2e
😎 Deploy Preview https://deploy-preview-8624.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The payee display hook now combines persisted and in-memory child transactions for split schedule previews. A regression test verifies the parent displays the most common child payee. Release notes document the fix.

Changes

Split schedule preview payee

Layer / File(s) Summary
Merge child transactions and validate preview payees
packages/desktop-client/src/hooks/useDisplayPayee.tsx, packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx, upcoming-release-notes/fix-schedule-preview-split-payee.md
The payee hook merges and deduplicates persisted and local child transactions. The regression test verifies the parent displays “Alice”. Release notes document the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: matissjanis, matt-fidd

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the fix for missing payees in schedule previews with split transactions.
Description check ✅ Passed The description explains the schedule preview payee bug, its fix, testing steps, and release note.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-schedule-preview-split-payee

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

Comment @coderabbitai help to get the list of available commands.

@youngcw youngcw changed the title [WIP] [AI] Fix missing payee on schedule previews with a split underneath [AI] Fix missing payee on schedule previews with a split underneath Aug 3, 2026
@youngcw youngcw changed the title [AI] Fix missing payee on schedule previews with a split underneath [AI] Fix missing payee on schedule previews if the schedule has a split Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/desktop-client/src/hooks/useDisplayPayee.tsx (1)

49-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the manual useMemo.

allSubtransactions only feeds local render-time calculation. It has no non-compiled consumer that requires stable identity. Compute it directly and rely on the React Compiler for memoization. Verify that this package enables the React Compiler before the change.

Proposed refactor
-  const allSubtransactions = useMemo(() => {
-    const localChildren = transactions.filter(t => t.is_child);
-    const localIds = new Set(localChildren.map(t => t.id));
-    return [
-      ...queriedSubtransactions.filter(st => !localIds.has(st.id)),
-      ...localChildren,
-    ];
-  }, [queriedSubtransactions, transactions]);
+  const localChildren = transactions.filter(t => t.is_child);
+  const localIds = new Set(localChildren.map(t => t.id));
+  const allSubtransactions = [
+    ...queriedSubtransactions.filter(st => !localIds.has(st.id)),
+    ...localChildren,
+  ];

As per coding guidelines, “rely on the React Compiler's automatic memoization; omit manual useCallback, useMemo, and React.memo unless stable identity is required by a non-compiled dependency.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/desktop-client/src/hooks/useDisplayPayee.tsx` around lines 49 - 56,
Verify that the desktop-client package has React Compiler enabled, then remove
the manual useMemo wrapping allSubtransactions in useDisplayPayee and compute
the filtered/combined array directly. Preserve the existing exclusion of
duplicate local child IDs and the ordering of queried subtransactions followed
by local children.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/desktop-client/src/hooks/useDisplayPayee.tsx`:
- Around line 49-56: Verify that the desktop-client package has React Compiler
enabled, then remove the manual useMemo wrapping allSubtransactions in
useDisplayPayee and compute the filtered/combined array directly. Preserve the
existing exclusion of duplicate local child IDs and the ordering of queried
subtransactions followed by local children.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6f7b1ce7-f28e-43e8-83b2-8c5ad776de21

📥 Commits

Reviewing files that changed from the base of the PR and between 4e5c0d5 and d5427a8.

📒 Files selected for processing (3)
  • packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx
  • packages/desktop-client/src/hooks/useDisplayPayee.tsx
  • upcoming-release-notes/fix-schedule-preview-split-payee.md

@youngcw
youngcw added this pull request to the merge queue Aug 3, 2026
Merged via the queue into master with commit 6b7d8c9 Aug 3, 2026
47 checks passed
@youngcw
youngcw deleted the fix-schedule-preview-split-payee branch August 3, 2026 20:13
youngcw added a commit that referenced this pull request Aug 11, 2026
…it (#8624)

* [AI] Fix missing payee on schedule previews with a split underneath

useDisplayPayee determined a split parent's payee by querying the DB
for its children, which works for persisted transactions but not for
schedule preview rows, whose split children only ever exist in
memory. Merge in-memory is_child rows into the subtransaction lookup
so preview splits get the same computed payee real splits already do.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix note

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
RafaelEspino pushed a commit to RafaelEspino/actual that referenced this pull request Oct 28, 2026
…it (actualbudget#8624)

* [AI] Fix missing payee on schedule previews with a split underneath

useDisplayPayee determined a split parent's payee by querying the DB
for its children, which works for persisted transactions but not for
schedule preview rows, whose split children only ever exist in
memory. Merge in-memory is_child rows into the subtransaction lookup
so preview splits get the same computed payee real splits already do.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix note

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
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.

2 participants