Files
sure/app/views/goals/_status_callout.html.erb
Guillem Arias 91baa62604 fix(goals): cover money displays with privacy-sensitive
Audit-driven sweep. The class was already on the obvious surfaces (KPI
strip, ring center, card balance, funding-accounts breakdown); these
were the secondary surfaces missed in the initial PR — money interpolated
into descriptive prose, account-picker balances, live previews, and the
projection chart tooltip.

- card_component: target divisor next to the masked balance, pace line,
  and behind-status footer (`footer_has_money?` helper keeps non-money
  branches unmasked so paused / archived / "Goal reached" copy stays
  readable in privacy mode).
- show: header_summary (target + date subtitle), to_go remaining,
  inactive recap body, celebration body, catch_up body.
- _status_callout: conditional on `goal.status == :behind` — only that
  branch carries an amount; on_track / no_target_date have date or
  static copy.
- _form_edit + _form_stepper: account balance shown in the linked-
  account picker rows.
- _form_stepper review section: reviewSummary + reviewSuggested ps
  (Stimulus injects target / suggested $X/mo into both).
- _pending_pledge_banner: banner title span (amount + account + days).
- goal_pledges/new: live preview p (Stimulus injects "Reaches X%, $A of
  $B" / "Hits your $B target").
- goal_projection_chart_controller: tooltip was inline-styled with
  hard-coded gray-900 + white (DS drift) and had no privacy class.
  Replaced cssText with className using bg-container + text-primary +
  border-secondary + rounded-lg + privacy-sensitive — mirrors the
  pattern in time_series_chart_controller and the post-#1996 sankey
  fix. Tooltip now respects theme and privacy mode.
2026-05-27 10:14:13 +02:00

29 lines
1.1 KiB
Plaintext

<%
context = goal.status_callout_context
return if context.blank?
variant_classes = case goal.status
when :behind
"bg-warning/10 border-warning/20 text-warning"
when :on_track
"bg-success/10 border-success/20 text-success"
else
"bg-surface-inset border-secondary text-secondary"
end
icon_glyph = case goal.status
when :behind then "triangle-alert"
when :on_track then "circle-check"
when :no_target_date then "infinity"
else "info"
end
label = t("goals.status.#{goal.status}", default: goal.status.to_s.titleize)
%>
<div class="rounded-lg border px-3 py-2 text-sm flex items-center gap-2 <%= variant_classes %>">
<span class="shrink-0"><%= icon(icon_glyph, size: "sm") %></span>
<span class="font-medium"><%= label %></span>
<span class="opacity-60">·</span>
<span class="opacity-90 <%= "privacy-sensitive" if goal.status == :behind %>"><%= context %></span>
</div>