Skip to content

Commit e692842

Browse files
committed
fix: Improve "Mark as Paid" UX with default split options
This commit fixes a significant usability issue where the "Mark as Paid" feature would behave incorrectly if the group had a default splitting option other than "Evenly". Previously, when a user set a default splitting method for a group (e.g., "Unevenly" or "By Shares"), this default was also being applied to reimbursements. A reimbursement, by its nature, is a simple transfer between two parties and should always be split evenly. Applying a different split mode was not a valid operation and resulted in a confusing and disruptive user experience, making it difficult to mark debts as paid. The fix is to update expense-form.tsx to ensure that when an expense is a reimbursement (isReimbursement: true), the splitMode is always hardcoded to 'EVENLY'. This change bypasses any group-level default splitting options for reimbursements, ensuring a smooth and intuitive workflow. Fixes #365
1 parent d3b151e commit e692842

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/groups/[groupId]/expenses/expense-form.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ export function ExpenseForm({
230230
: undefined,
231231
],
232232
isReimbursement: true,
233-
splitMode: defaultSplittingOptions.splitMode,
233+
// Mark as paid reimbursements should always be split evenly
234+
// independent of any stored default splitting options.
235+
splitMode: 'EVENLY',
234236
saveDefaultSplittingOptions: false,
235237
documents: [],
236238
notes: '',

0 commit comments

Comments
 (0)