Repository navigation
[AI] Fix clearing pre-assigned transaction fields - #7455
NathanDrake2406 wants to merge 4 commits into
Conversation
|
👋 Hello contributor! We would love to review your PR! Before we can do that, please make sure:
We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges. For more information, please see our Contributing Guide. |
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughRefactors transaction rule-application logic into a new helper Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/desktop-client/src/components/transactions/applyRulesToTransaction.test.ts`:
- Line 1: Remove the unnecessary import of Vitest globals by deleting the
"import { describe, expect, it } from 'vitest';" line in
applyRulesToTransaction.test.ts; since globals: true is enabled in the Vite
config the test should use describe/it/expect directly without importing them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 23e3fd0e-2f4c-4e09-b065-ad883a0ab2c3
📒 Files selected for processing (3)
packages/desktop-client/src/components/transactions/TransactionList.tsxpackages/desktop-client/src/components/transactions/applyRulesToTransaction.test.tspackages/desktop-client/src/components/transactions/applyRulesToTransaction.ts
|
The /mobile - TransactionEdit looks to have the same bug. Not sure if that is going to be updated separately but thought to call it out. |
|
Thank you so much! Excited to see this fix get merged and released! |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR was closed because it has been stalled for 5 days with no activity. |
Description
Fixes a bug where clearing a rule-populated field on a new transaction did not stick. If a payee rule pre-assigned a category, notes, or another empty-overwritable field, clearing that field would immediately get overwritten the next time rules ran.
This change extracts the merge logic from TransactionList into a pure helper and teaches it to preserve the field the user just edited, even when that edit clears the value. It also fixes the split-transaction case so clearing a field on the parent does not let rule output repopulate that field on child splits.
Related issue(s)
#7390
Testing
Unit tests:
Covered clearing a rule-assigned category on a normal transaction
Covered clearing notes
Covered initial-load behavior when updatedFieldName is null
Covered split propagation when a parent field is set
Covered split propagation when category or notes is cleared on the parent
Checklist
Bundle Stats
View detailed bundle stats
desktop-client
Total
Changeset
src/components/transactions/applyRulesToTransaction.tssrc/components/transactions/TransactionList.tsxView detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
Smaller
No assets were 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