Skip to content

A local-first personal finance app

Improve 'Before split' section in rule splits (#2651)

Julian Dominguez-Schatzcdad43ff32bb
diff --git a/packages/desktop-client/src/components/modals/EditRule.jsx b/packages/desktop-client/src/components/modals/EditRule.jsx
index ce34999b62..54b76c2cf5 100644
--- a/packages/desktop-client/src/components/modals/EditRule.jsx
+++ b/packages/desktop-client/src/components/modals/EditRule.jsx
@@ -1020,7 +1020,7 @@ export function EditRule({ modalProps, defaultRule, onSave: originalOnSave }) {
}}
>
{splitIndex === 0
- ? 'Before split'
+ ? 'Apply to all'
: `Split ${splitIndex}`}
</Text>
{splitIndex && (
diff --git a/packages/desktop-client/src/components/rules/RuleRow.tsx b/packages/desktop-client/src/components/rules/RuleRow.tsx
index 4af4d31050..6548e8fd5d 100644
--- a/packages/desktop-client/src/components/rules/RuleRow.tsx
+++ b/packages/desktop-client/src/components/rules/RuleRow.tsx
@@ -139,7 +139,7 @@ export const RuleRow = memo(
marginBottom: 6,
}}
>
- {i ? `Split ${i}` : 'Before split'}
+ {i ? `Split ${i}` : 'Apply to all'}
</Text>
{split.actions.map((action, j) => (
<ActionExpression
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx
index d06dbd2fd8..0758138833 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.test.jsx
@@ -861,6 +861,7 @@ describe('Transactions', () => {
{
account: accounts[0].id,
amount: -1000,
+ category: null,
cleared: false,
date: '2017-01-01',
error: null,
@@ -874,6 +875,7 @@ describe('Transactions', () => {
{
account: accounts[0].id,
amount: -1777,
+ category: null,
cleared: false,
date: '2017-01-01',
error: null,
diff --git a/packages/loot-core/src/server/accounts/rules.ts b/packages/loot-core/src/server/accounts/rules.ts
index 68f0d67bff..ab7ccd11d3 100644
--- a/packages/loot-core/src/server/accounts/rules.ts
+++ b/packages/loot-core/src/server/accounts/rules.ts
@@ -622,7 +622,7 @@ export function execActions(actions: Action[], transaction) {
}
}
- // The split index 0 is reserved for "Before split" actions.
+ // The split index 0 is reserved for "Apply to all" actions.
// Remove that entry from the subtransactions.
update.subtransactions = update.subtransactions.slice(1);
diff --git a/packages/loot-core/src/shared/transactions.ts b/packages/loot-core/src/shared/transactions.ts
index c4f868725b..ac3b7356d5 100644
--- a/packages/loot-core/src/shared/transactions.ts
+++ b/packages/loot-core/src/shared/transactions.ts
@@ -49,6 +49,7 @@ export function makeChild<T extends GenericTransactionEntity>(
return {
amount: 0,
...data,
+ category: 'category' in data ? data.category : parent.category,
payee: 'payee' in data ? data.payee : parent.payee,
id: 'id' in data ? data.id : prefix + uuidv4(),
account: parent.account,
diff --git a/upcoming-release-notes/2651.md b/upcoming-release-notes/2651.md
new file mode 100644
index 0000000000..9c642480ca
--- /dev/null
+++ b/upcoming-release-notes/2651.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [jfdoming]
+---
+
+Make the 'Apply to all' section (fka 'Before split') of rule splits more intuitive