Make "Really free" read as the cash panel's answer

Merged
GA
2mo ago
+20-4

Problem

In the Budgets "Cash on hand" panel (preview features), the "Really free" result row had the same weight as the rows above it, and "Available in cash" showed a figure just as large (text-lg). The panel had two headline numbers and no clear answer.

Change

In app/views/budgets/_available_cash.html.erb:

  • "Really free" sits on a subtle bg-surface-inset rounded-lg inset, pulled half the card padding outwards (-mx-2 px-2) so its text stays aligned with the rows above. The figure goes from text-lg to text-2xl font-medium and stays tabular and privacy-sensitive.
  • "Available in cash" drops to text-sm text-primary, so the panel has a single headline figure.
  • Divider still sits above the result. It is now the earmarked row's bottom border, so it doesn't clip the rounded inset.
  • Card shell is unchanged (still p-4, like the sibling cards).

Only existing tokens are used, and no CSS was added. The rows stay hand-built rather than using DS::DetailRow: that component fixes the label to text-secondary and the value to text-sm text-primary, which clash with the secondary earmark and the larger free figure. A comment in the view records this.

Draft #3222 edits this file's comment and copy only, so a rebase between the two should be trivial.

Screenshots

Before on the left, after on the right. Desktop on top, 375px below.

Light

Light

Dark

Dark

Validation

  • New test in BudgetsControllerTest: with preview features on, the free figure renders the budget's formatted free_cash_money, is privacy-sensitive, and is the only text-2xl figure in the panel. It fails on main and passes with this change.
  • bin/rails test: 10330 runs, 0 failures, 0 errors.
  • RuboCop, erb_lint and Brakeman are clean. No JavaScript changed, and there are no budgets system tests.

Summary by CodeRabbit

  • Style
    • Updated the available-cash panel to distinguish earmarked funds from free cash, with free cash highlighted and its amount shown more prominently.