From 172c8603b6d95322f71573ce8bf66e5204b10c2c Mon Sep 17 00:00:00 2001 From: Guillem Arias Date: Thu, 14 May 2026 21:53:02 +0200 Subject: [PATCH] fix(goals): clarify "last saved" + add pledge timestamp to banner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/views/goals/_pending_pledge_banner.html.erb | 1 + config/locales/views/goals/en.yml | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/goals/_pending_pledge_banner.html.erb b/app/views/goals/_pending_pledge_banner.html.erb index b47baae3f..1e93a246f 100644 --- a/app/views/goals/_pending_pledge_banner.html.erb +++ b/app/views/goals/_pending_pledge_banner.html.erb @@ -7,6 +7,7 @@ %> <%= render DS::Alert.new(variant: "warning", title: title, live: :polite) do %>

<%= t(body_key) %>

+

<%= t("goals.show.pending_pledge.pledged_at", time_ago: time_ago_in_words(pledge.created_at)) %>

<%= render DS::Button.new( text: t("goals.show.pending_pledge.extend"), diff --git a/config/locales/views/goals/en.yml b/config/locales/views/goals/en.yml index 053830525..ef2db243c 100644 --- a/config/locales/views/goals/en.yml +++ b/config/locales/views/goals/en.yml @@ -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