From 03b5126c8a2120ffffd7dc0add1592440dfe1acc Mon Sep 17 00:00:00 2001 From: Guillem Arias Date: Mon, 11 May 2026 17:01:39 +0200 Subject: [PATCH] fix(savings_goals/show): contributions list + funding accounts breakdown use per-account deterministic color MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both used goal.color for every account avatar, so every linked account ended up the same color as the goal. Sure's convention elsewhere (accounts/_logo.html.erb) is accountable.color (type color: Depository → purple) — but savings goals only link Depository accounts, so that would still collapse to one color. Reuse the deterministic Savings::GoalAvatarComponent.color_for(name) helper from the index card stack instead. Same account always resolves to the same color across processes, and multiple accounts on the same goal read as distinct. Funding-accounts breakdown bar at the top now also colors each segment by account so the proportions are visibly typed (not a single goal- color block). --- .../savings/funding_accounts_breakdown_component.html.erb | 4 ++-- app/views/savings_goals/_contributions_list.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/savings/funding_accounts_breakdown_component.html.erb b/app/components/savings/funding_accounts_breakdown_component.html.erb index ca3f674fb..fee45f857 100644 --- a/app/components/savings/funding_accounts_breakdown_component.html.erb +++ b/app/components/savings/funding_accounts_breakdown_component.html.erb @@ -4,7 +4,7 @@
<% rows.each do |row| %> <% next if row[:amount].to_d.zero? %> -
<% end %>
@@ -12,7 +12,7 @@