Show remaining budget in mobile category buttons

Each category button now displays "X € restants" below the name,
alongside the existing progress gauge and percentage — so the user
sees both how much of the budget is used and how much is left
without leaving the entry form. Remaining is floored at 0 to match
the gauge's 100% cap.

categoryProgress now returns a ['pct', 'remaining'] pair per category
instead of a bare percentage; tests updated accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jeremy bayse
2026-07-26 12:55:44 +02:00
co-authored by Claude Sonnet 5
parent 613220f43a
commit 1b3906ade2
3 changed files with 23 additions and 9 deletions
+4 -1
View File
@@ -199,7 +199,10 @@ class Index extends Component
$tracked = $this->trackedForCategoryThisMonth($category, $year, $month);
return [$category->id => min(100, round($tracked / $budget * 100))];
return [$category->id => [
'pct' => min(100, round($tracked / $budget * 100)),
'remaining' => max(0, $budget - $tracked),
]];
});
return view('livewire.suivi.index', [