feat(goals): footer 'N pending' on cards + drop warning tone from top callout

- Pending pledges surface in the card footer as '· N pending' tacked
  on after the existing footer line (text-subdued). Quiet, semantic,
  doesn't compete with the status pill or the avatar.
- The top-of-page 'You have pending pledges' callout was using the
  amber DS::Alert warning variant. Pending isn't a warning — it's a
  passive 'we're waiting on a sync' state. Switch to the info
  variant so the visual weight matches the meaning.
This commit is contained in:
Guillem Arias
2026-05-18 22:29:20 +02:00
parent 66680877f4
commit 78f97320de
4 changed files with 12 additions and 11 deletions

View File

@@ -13,14 +13,6 @@
<%= goal.name %>
</a>
</p>
<% if has_pending_pledge? %>
<span class="text-subdued shrink-0"
role="img"
aria-label="<%= t("goals.goal_card.pending_pledge") %>"
title="<%= t("goals.goal_card.pending_pledge") %>">
<%= helpers.icon("clock", size: "xs") %>
</span>
<% end %>
<%= render Goals::StatusPillComponent.new(goal: goal) %>
</div>
<p class="text-xs text-subdued truncate"><%= secondary_line %></p>
@@ -66,6 +58,8 @@
<%= render Goals::AccountStackComponent.new(accounts: linked_accounts, color_map: goal.account_color_map) %>
<span class="text-xs text-subdued"><%= linked_accounts_count_label %></span>
</div>
<span class="text-xs text-subdued tabular-nums"><%= footer_line %></span>
<span class="text-xs text-subdued tabular-nums">
<%= footer_line %><% if has_pending_pledge? %> · <%= t("goals.goal_card.pending_count", count: pending_pledges_count) %><% end %>
</span>
</div>
</div>

View File

@@ -30,7 +30,11 @@ class Goals::CardComponent < ApplicationComponent
# `.includes(:open_pledges, ...)` chain in GoalsController#index, so
# this is a hit on the in-memory association — no N+1.
def has_pending_pledge?
goal.open_pledges.any?
pending_pledges_count.positive?
end
def pending_pledges_count
@pending_pledges_count ||= goal.open_pledges.size
end
def linked_accounts_count_label

View File

@@ -85,7 +85,7 @@
</section>
<% if @any_pending_pledge %>
<%= render DS::Alert.new(variant: "warning", message: t(".pending_pledges_callout"), live: :polite) %>
<%= render DS::Alert.new(variant: "info", message: t(".pending_pledges_callout"), live: :polite) %>
<% end %>
<%# Goals section %>

View File

@@ -234,6 +234,9 @@ en:
footer_catch_up: "Save %{amount}/mo to catch up"
footer_no_deadline: Open
pending_pledge: Pending pledge
pending_count:
one: 1 pending
other: "%{count} pending"
footer_no_pledges: No matched pledges yet
footer_last_today: Last pledge matched today
footer_last_days: