mirror of
https://github.com/we-promise/sure.git
synced 2026-05-31 08:19:03 +00:00
Header collapses to title + kebab. The status pill and the `Record pledge` button leave the title row. Status moves into a one-line callout below the subtitle that doubles as the catch-up demand when behind, the reach-date when on track, or a prompt for a target date when missing. `Record pledge` is now the only pledge entry point on the page and lives under the ring. Behind goals pre-fill it with the catch-up delta. The standalone catch-up alert card is gone — its title is the callout, its pace breakdown moves into the projection chart's subtitle, and its CTA is the ring-adjacent button. The "Adjust target instead" link is absorbed into the kebab's existing Edit item. Pending-pledge banner switches from a warning Alert to a neutral container chip. It is informational state, not a warning. Title carries the relative pledged-at meta inline; verbose auto-confirms body stays but in subdued size. Projection chart drops the today-line pending stub (vertical line + dashed marker + "+ pending $X" text). That data already lives in the pending banner above the chart; the duplicate annotation clutters the today line, the small dashed circle reads as misaligned at small pending amounts, and the label overlaps the projection trajectory. Shortfall label gets a paint-order halo so it stays legible across the dashed projection line.
29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
<%
|
|
context = goal.status_callout_context
|
|
return if context.blank?
|
|
|
|
variant_classes = case goal.status
|
|
when :behind
|
|
"bg-warning/10 border-warning/20 text-yellow-700 theme-dark:text-yellow-300"
|
|
when :on_track
|
|
"bg-success/10 border-success/20 text-green-700 theme-dark:text-green-300"
|
|
else
|
|
"bg-surface-inset border-secondary text-secondary"
|
|
end
|
|
|
|
icon_glyph = case goal.status
|
|
when :behind then "triangle-alert"
|
|
when :on_track then "circle-check"
|
|
when :no_target_date then "infinity"
|
|
else "info"
|
|
end
|
|
|
|
label = I18n.t("goals.status.#{goal.status}", default: goal.status.to_s.titleize)
|
|
%>
|
|
<div class="rounded-lg border px-3 py-2 text-sm flex items-center gap-2 <%= variant_classes %>">
|
|
<span class="shrink-0"><%= icon(icon_glyph, size: "sm") %></span>
|
|
<span class="font-medium"><%= label %></span>
|
|
<span class="opacity-60">·</span>
|
|
<span class="opacity-90"><%= context %></span>
|
|
</div>
|