From bcae1afc24dc1e5d3a6edf985ec46b80124060ed Mon Sep 17 00:00:00 2001 From: Guillem Arias Date: Mon, 11 May 2026 15:00:28 +0200 Subject: [PATCH] feat(savings_goals/new): deterministic account avatar color via name hash Replace the hardcoded var(--color-blue-500) on every funding-account row's avatar with a deterministic pick from Category::COLORS based on the account name's hash. Rows now read at a glance instead of melting into one blue column. --- app/views/savings_goals/_form_stepper.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/savings_goals/_form_stepper.html.erb b/app/views/savings_goals/_form_stepper.html.erb index 064ef1446..65f440390 100644 --- a/app/views/savings_goals/_form_stepper.html.erb +++ b/app/views/savings_goals/_form_stepper.html.erb @@ -69,7 +69,7 @@ account_subtype: account.subtype || subtype, account_balance: account.balance } %> - <%= render Savings::GoalAvatarComponent.new(name: account.name, color: "var(--color-blue-500)", size: "md") %> + <%= render Savings::GoalAvatarComponent.new(name: account.name, color: Category::COLORS[account.name.hash.abs % Category::COLORS.size], size: "md") %>

<%= account.name %>

<%= (account.subtype || subtype).titleize %>