From d39928a3f7756d63f46b7b9c04cec38cce789f6c Mon Sep 17 00:00:00 2001 From: Ricearoni1245 Date: Wed, 11 Mar 2026 21:56:12 -0500 Subject: [PATCH] fix: fixed reset button and safeguards on rebalance feature --- web/src/pages/settings/RebalancePage.tsx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/web/src/pages/settings/RebalancePage.tsx b/web/src/pages/settings/RebalancePage.tsx index a539dd6..8bd0846 100644 --- a/web/src/pages/settings/RebalancePage.tsx +++ b/web/src/pages/settings/RebalancePage.tsx @@ -43,12 +43,13 @@ export default function RebalancePage() { const maxSingle = Math.floor(available * 0.8); const errors: string[] = []; + const warnings: string[] = []; if (rows.some((r) => r.targetCents < 0)) errors.push("No category can be negative."); if (available > 0 && rows.some((r) => r.targetCents > maxSingle)) - errors.push("No category can exceed 80% of available."); - if (total !== available) errors.push(`Totals must equal available ($${(available / 100).toFixed(2)}).`); + warnings.push("A category exceeds 80% of available."); + if (total !== available) warnings.push(`Totals differ from available ($${(available / 100).toFixed(2)}).`); if ((savingsTotal < savingsBefore || savingsTotal < savingsFloor) && !forceSavings) - errors.push("Lowering savings requires confirmation."); + errors.push("Confirm lowering savings / below 20% floor."); const canSubmit = errors.length === 0; @@ -224,6 +225,14 @@ export default function RebalancePage() { )} + {warnings.length > 0 && ( +
+ {warnings.map((w) => ( +
{w}
+ ))} +
+ )} +