mirror of
https://github.com/we-promise/sure.git
synced 2026-05-25 13:34:58 +00:00
Migrates the hand-rolled "Pending" / "Review recommended" / "Potential duplicate" / "Split" badges across the transaction views to the extended DS::Pill primitive from #1902. **Visual contract for badge mode** In #1902 the badge mode (`marker: false`) used `rounded-md` (chip shape) because the marker mode does. But every existing pill / status badge in the codebase uses `rounded-full` — see `settings/providers/_status_pill.html.erb`, `settings/providers/_maturity_badge.html.erb`, and the inline transaction badges this PR is migrating. To keep the visual contract consistent, this PR shifts `DS::Pill`'s badge mode to `rounded-full` (marker mode stays `rounded-md`, unchanged from #1829). The shape distinction now reads: markers are tags, badges are pills. **Callsites migrated** (5): - `app/views/transactions/_transaction.html.erb` — Pending, Review-recommended, Possible-duplicate, Split badges - `app/views/transactions/_header.html.erb` — Pending badge - `app/views/transactions/_split_parent_row.html.erb` — Split badge **Tone mapping** | Badge | Tone | Notes | |---|---|---| | Pending | `:neutral` | unchanged copy/icon, gains subtle DS-controlled bg | | Review recommended | `:neutral` | matches existing `bg-surface-inset` look | | Possible duplicate | `:warning` | DS semantic alias for the existing `text-warning` | | Split | `:neutral` | matches existing `bg-surface-inset` look | **Deferred to follow-up PRs** - `app/views/transactions/_transfer_match.html.erb` — uses two responsive-visibility variants (`hidden lg:inline-flex` for long copy, `inline-flex lg:hidden` for short). DS::Pill currently has no `class:` arg for caller-controlled wrapper classes; deferring until that lands. - `app/views/transactions/searches/filters/_badge.html.erb` — has a close button alongside the label (`button_to clear_filter_*`) and uses `rounded-3xl p-1.5` instead of a true pill. Closer to a removable filter chip — better fit for a separate `DS::FilterChip` primitive than for `DS::Pill`. Refs #1751.
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
<%# locals: (entry:) %>
|
|
<div class="flex items-start justify-between gap-4" id="<%= dom_id(entry, :header) %>">
|
|
<div>
|
|
<h3 class="font-medium flex items-center gap-2">
|
|
<span class="text-2xl text-primary privacy-sensitive">
|
|
<%= format_money -entry.amount_money %>
|
|
</span>
|
|
<span class="text-lg text-secondary">
|
|
<%= entry.currency %>
|
|
</span>
|
|
<% if entry.transaction.transfer? %>
|
|
<%= icon "arrow-left-right", size: "sm", class: "text-secondary" %>
|
|
<% end %>
|
|
<% if entry.linked? %>
|
|
<span title="<%= t("transactions.transaction.linked_with_provider", provider: entry.account.provider_name&.titleize) %>" class="text-secondary">
|
|
<%= icon("refresh-ccw", size: "sm") %>
|
|
</span>
|
|
<% end %>
|
|
</h3>
|
|
<div class="flex items-center gap-2">
|
|
<span class="text-sm text-secondary">
|
|
<%= entry.date ? I18n.l(entry.date, format: :long) : "—" %>
|
|
</span>
|
|
<% if entry.transaction.pending? %>
|
|
<%= render DS::Pill.new(
|
|
label: t("transactions.transaction.pending"),
|
|
tone: :neutral,
|
|
marker: false,
|
|
icon: "clock",
|
|
title: t("transactions.transaction.pending_tooltip")
|
|
) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|