Files
sure/app/views
Guillem Arias 8548703651 refactor(goals/show): move projection_summary + catch_up_delta to model
The show template carried a 17-line `if/elsif` chain computing
`projection_summary` inline, plus a `Money.new([…, 0].max, …)`
expression building the catch-up delta on the fly. CLAUDE.md's
"skinny controllers, fat models" convention pushes both onto Goal.

- `Goal#projection_summary`: returns the localized,
  `html_safe`-aware string for the chart subtitle and the chart's
  `aria-description`. Memoized so the two callsites in show.html.erb
  share one computation.
- `Goal#catch_up_delta_money`: clamped-at-zero monthly delta between
  pace and the required monthly target. Used by the catch-up
  callout body. Previously the view computed
  `Money.new([req - pace, 0].max, currency)` — same math, but
  duplicated inline.

show.html.erb drops both blocks and reads `@goal.projection_summary`
/ `@goal.catch_up_delta_money` directly.

Also: V15 — the celebration card used `bg-green-500/10` directly.
Swap to `bg-success/10` (DS semantic token, same Tailwind-4 alpha
syntax DS::Alert already uses) so the celebration palette tracks
the rest of the success surface.
2026-05-14 19:43:29 +02:00
..
2025-11-24 19:52:34 +01:00
2025-11-24 19:52:34 +01:00
2026-04-22 10:10:18 +02:00
2026-03-22 10:48:54 +01:00
2026-03-25 17:47:04 +01:00
2026-03-11 15:54:01 +01:00
2026-03-25 17:47:04 +01:00
2026-03-29 17:28:07 +02:00
2026-02-19 19:55:10 +01:00
2025-04-11 09:28:00 -05:00
2025-07-18 08:30:00 -04:00