fix(goals): clarify "last saved" + add pledge timestamp to banner

UX audit pair.

Header "Last saved N days ago" was rendered from
`Goal#last_matched_pledge_at` — date of the most recent
*pledge-matched* entry — but the funding column on the same page
shows "$X last 30d" computed off *all* entries. A user who
deposited cash without recording a pledge saw "Funding · last 30d:
$200" while the header still read "Last saved 47 days ago." Two
adjacent figures contradicted each other.

Rename the locale strings (used on both the index card and the
show header) to reflect the actual data source:
  - footer_no_pledges: "No matched pledges yet"
  - footer_last_today: "Last pledge matched today"
  - footer_last_days: "Last pledge matched N days ago"

Two open pledges into the same account previously rendered as
two near-identical yellow banners with no way to tell which one
the Cancel button targeted. Add a relative-time line below the
body — "Pledged 2 hours ago" / "Pledged about a minute ago" —
using `time_ago_in_words(pledge.created_at)`. Discriminator without
changing the title or the action surface.
This commit is contained in:
Guillem Arias
2026-05-14 21:53:02 +02:00
parent ff98a9cee2
commit 172c8603b6
2 changed files with 6 additions and 4 deletions

View File

@@ -7,6 +7,7 @@
%>
<%= render DS::Alert.new(variant: "warning", title: title, live: :polite) do %>
<p class="text-secondary"><%= t(body_key) %></p>
<p class="text-xs text-subdued mt-1"><%= t("goals.show.pending_pledge.pledged_at", time_ago: time_ago_in_words(pledge.created_at)) %></p>
<div class="mt-2 flex items-center gap-2 flex-wrap">
<%= render DS::Button.new(
text: t("goals.show.pending_pledge.extend"),

View File

@@ -113,6 +113,7 @@ en:
other: "Pending: %{amount} into %{account} · %{count} days left"
body_transfer: Auto-confirms when Sure spots a matching deposit on the next sync.
body_manual: Confirms on your next manual balance edit.
pledged_at: "Pledged %{time_ago} ago"
extend: Extend 7 days
cancel: Cancel
confirm_cancel_title: Cancel this pledge?
@@ -218,11 +219,11 @@ en:
footer_reached: Goal reached
footer_catch_up: "Save %{amount}/mo to catch up"
footer_no_deadline: Open
footer_no_pledges: No pledges yet
footer_last_today: Last saved today
footer_no_pledges: No matched pledges yet
footer_last_today: Last pledge matched today
footer_last_days:
one: Last saved 1 day ago
other: "Last saved %{count} days ago"
one: Last pledge matched 1 day ago
other: "Last pledge matched %{count} days ago"
form_stepper:
cancel: Cancel
continue: Continue