Repository navigation
[AI] Fix missing payee on schedule previews if the schedule has a split - #8624
Conversation
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]>
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe 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. ChangesSplit schedule preview payee
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/desktop-client/src/hooks/useDisplayPayee.tsx (1)
49-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the manual
useMemo.
allSubtransactionsonly 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, andReact.memounless 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
📒 Files selected for processing (3)
packages/desktop-client/src/components/transactions/TransactionsTable.test.tsxpackages/desktop-client/src/hooks/useDisplayPayee.tsxupcoming-release-notes/fix-schedule-preview-split-payee.md
…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]>
…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]>
Description
Fix issue where schedules that have a split had an empty payee in the upcoming transaction.
Fixed by Claude
Related issue(s)
Testing
Checklist
Bundle Stats
View detailed bundle stats
desktop-client
Total
Changeset
src/hooks/useDisplayPayee.tsxlocale/en.jsonlocale/pl.jsonlocale/zh-Hans.jsonlocale/da.jsonlocale/de.jsonlocale/pt-BR.jsonlocale/es.jsonlocale/nl.jsonlocale/uk.jsonlocale/ca.jsonlocale/fr.jsonlocale/nb-NO.jsonlocale/it.jsonlocale/ru.jsonlocale/th.jsonView detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
Smaller
Unchanged
loot-core
Total
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
api
Total
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
cli
Total
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
crdt
Total
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