Files
sure/app/components/goals/avatar_component.html.erb
Guillem Arias c9a3686f0b fix(goals/avatar): icon helper clash crashed show after saving an icon
Goals::AvatarComponent had `attr_reader :icon` which shadowed the
global `icon` view helper. Template called `icon(icon, size:, color:)`
which Ruby resolved against the attr-reader (zero-arity), throwing
"wrong number of arguments (given 2, expected 0)" the moment a goal
had a saved icon and the show page tried to render its avatar.

- Drop `:icon` from attr_reader; expose as `icon_name` instead.
- Template uses `helpers.icon(icon_name, ...)` matching the
  Goals::StatusPillComponent pattern (other Goals VCs already use
  `helpers.icon`).

Reproduced + verified live via Playwright: edit modal → pick an icon
→ save → show page renders the new avatar with the SVG. Same for
create flow (new modal → pick icon → step 2 → submit → show renders).
2026-05-11 21:41:51 +02:00

11 lines
395 B
Plaintext

<span class="goal-avatar inline-flex items-center justify-center font-semibold <%= box_classes %> <%= text_classes %> <%= radius_classes %>"
style="--avatar-color: <%= color %>;"
aria-hidden="true"
data-testid="goal-avatar">
<% if icon_name.present? %>
<%= helpers.icon(icon_name, size: icon_size, color: "current") %>
<% else %>
<%= initial %>
<% end %>
</span>