mirror of
https://github.com/we-promise/sure.git
synced 2026-05-29 23:39:03 +00:00
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:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user