Files
sure/app/components/savings/progress_ring_component.html.erb
Guillem Arias 7f10ec3b6c fix(savings_goals/show): dedupe ring labels, DS::Button banners, status-pill contrast
- progress_ring_component: drop the in-ring "$saved / of $target" lines.
  The same money pair already renders directly below the ring in
  show.html.erb (now the single source). Inside the ring keeps only
  "Saved" + percent.
- show.html.erb: replace 3 hand-rolled button_to CTAs (Paused banner
  "Resume goal", Archived banner "Restore goal", celebration card
  "Archive goal") with DS::Button so focus/hover/disabled match the
  rest of the app. variant: primary/outline, size: sm, method: :patch.
- status_pill_component: swap text-success / text-warning / text-secondary
  to text-green-700 / text-yellow-700 / text-gray-700 so all 5 light-mode
  pill variants pass WCAG 4.5:1. Local override pending the upstream DS
  token fix tracked at we-promise/sure#1736.
2026-05-11 19:36:54 +02:00

19 lines
1.0 KiB
Plaintext

<div data-controller="donut-chart"
data-donut-chart-segments-value="<%= goal.to_donut_segments_json.to_json %>"
data-donut-chart-segment-height-value="6"
role="progressbar"
aria-valuenow="<%= percent %>"
aria-valuemin="0"
aria-valuemax="100"
aria-label="<%= t("savings_goals.show.ring.aria_label", percent: percent, amount: amount_label, target: target_label) %>"
class="relative mx-auto"
style="width: <%= size %>px; height: <%= size %>px;">
<div data-donut-chart-target="chartContainer" class="absolute inset-0 pointer-events-none"></div>
<div data-donut-chart-target="contentContainer" class="flex items-center justify-center h-full">
<div data-donut-chart-target="defaultContent" class="flex flex-col items-center text-center">
<span class="text-secondary text-xs mb-1"><%= t("savings_goals.show.ring.saved") %></span>
<span class="text-3xl font-medium tabular-nums privacy-sensitive <%= percent_text_class %>"><%= percent %>%</span>
</div>
</div>
</div>