fix(ds): route remaining literal yellow warning surfaces onto --color-warning (#2250)

* fix(ds): route remaining literal yellow warning surfaces onto --color-warning

Completes the #2198 warning consolidation for view-level surfaces:

- rules/index recent-runs status badges → DS::Pill (warning / success / error).
- accounts/_account_sidebar_tabs missing-data notice: bg-yellow-tint-10 /
  text-yellow-600 → bg-warning/10 / text-warning.
- import/confirms/_mappings unassigned-account notice → bg-warning/10 /
  border-warning/20 (also fixes a missing dark variant — it was light-yellow
  in dark mode).
- simplefin/_replacement_prompt card → bg-warning/10 / border-warning/20,
  dropping the now-redundant theme-dark: companions (the token is theme-aware).

rules' blue/purple execution-type badges and the red failed-row highlight are
left as-is (not warning surfaces).

Part of #2198.

* fix(ds): neutral text in sidebar missing-data notice (match DS::Alert recipe)

Warning surfaces follow the DS::Alert recipe — warning tint + warning-colored
icon, but neutral body text (text-primary / text-secondary). The sidebar
missing-data notice was the lone holdout still painting its text (and link)
with text-warning. Switch to neutral text; keep the bg-warning/10 tint and the
warning-colored triangle/chevron as the accent. More readable (color-on-tint
text is low-contrast) and consistent with the DS::Alert migrations.

* fix(ds): missing-data sidebar notice → static DS::Alert (drop disclosure)

The notice was a raw collapsible <details> styled as a warning — a hybrid
that hid its own primary action (the "Configure providers" link) and its
explanation behind a chevron click. A warning's job is to surface a problem
and its fix; a disclosure's job is to hide secondary detail. The two fought
each other (triangle-alert "act on this" vs chevron "optional, expand").

Replace with a static DS::Alert(:warning): icon + title + body + the
Configure link, always visible. Fixes the affordance, surfaces the action,
canonicalizes the last warning-styled raw <details>, and matches the other
DS::Alert notices.

* fix(ds): grey body text in missing-data alert for title/body hierarchy

DS::Alert renders its body in text-primary (same dark as the title). For
this notice, drop the description to text-secondary so the title (primary,
semibold) reads above the supporting body (grey) — clearer hierarchy. Still
neutral (no colored text); the Configure link stays primary + underline so
the action remains the prominent element.

* fix(ds): bump account_sidebar_tabs cache version v1→v2

Flush stale <details>-markup fragments on deploy. The sidebar
missing-data notice migrated from <details> to a static DS::Alert,
but the fragment is cached with a 12h TTL — without a key change,
old markup renders until expiry (and inconsistently across
staggered multi-server cache warmups). Bumping the version string
changes the cache-key namespace so every cached fragment is
bypassed immediately.
This commit is contained in:
Guillem Arias Fauste
2026-06-11 15:30:08 +02:00
committed by GitHub
parent ab3e7e98c3
commit b2b89437b0
5 changed files with 13 additions and 29 deletions

View File

@@ -36,7 +36,7 @@ module AccountsHelper
end
[
family.build_cache_key("account_sidebar_tabs_v1", invalidate_on_data_updates: true),
family.build_cache_key("account_sidebar_tabs_v2", invalidate_on_data_updates: true),
Current.user&.id,
shares_version,
active_tab,

View File

@@ -3,22 +3,12 @@
<% cache account_sidebar_tabs_cache_key(family: family, active_tab: active_tab, mobile: mobile), expires_in: 12.hours do %>
<div id="account-sidebar-tabs">
<% if family.missing_data_provider? %>
<details class="group bg-yellow-tint-10 rounded-lg p-2 text-yellow-600 mb-3 text-xs">
<summary class="flex items-center justify-between gap-2">
<div class="flex items-center gap-2">
<%= icon "triangle-alert", size: "sm", color: "warning" %>
<p class="font-medium"><%= t("accounts.sidebar.missing_data") %></p>
</div>
<%= icon("chevron-down", color: "warning", class: "group-open:transform group-open:rotate-180") %>
</summary>
<div class="text-xs py-2 space-y-2">
<p><%= t("accounts.sidebar.missing_data_description", product: product_name) %></p>
<p>
<%= link_to t("accounts.sidebar.configure_providers"), settings_hosting_path, class: "text-yellow-600 underline" %>
</p>
</div>
</details>
<div class="mb-3">
<%= render DS::Alert.new(title: t("accounts.sidebar.missing_data"), variant: :warning) do %>
<p class="text-secondary"><%= t("accounts.sidebar.missing_data_description", product: product_name) %></p>
<p><%= link_to t("accounts.sidebar.configure_providers"), settings_hosting_path, class: "underline font-medium" %></p>
<% end %>
</div>
<% end %>
<%= render DS::Tabs.new(active_tab: active_tab, session_key: "account_sidebar_tab", testid: "account-sidebar-tabs") do |tabs| %>

View File

@@ -23,7 +23,7 @@
<% elsif import.has_unassigned_account? %>
<div class="w-full max-w-full overflow-hidden mb-4">
<div class="overflow-x-auto">
<div class="flex items-center justify-between p-4 gap-4 text-secondary bg-yellow-100 border border-yellow-200 rounded-lg w-[650px] min-w-0 mx-auto">
<div class="flex items-center justify-between p-4 gap-4 text-secondary bg-warning/10 border border-warning/20 rounded-lg w-[650px] min-w-0 mx-auto">
<%= tag.p t(".unassigned_account"), class: "text-sm" %>
<%= render DS::Link.new(
text: t(".create_account"),

View File

@@ -147,17 +147,11 @@
<td class="px-4 py-3 text-sm text-center">
<div class="flex items-center justify-center gap-2">
<% if run.pending? %>
<span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-yellow-50 text-yellow-700 theme-dark:bg-yellow-950/30 theme-dark:text-yellow-400">
<%= t("rules.recent_runs.statuses.#{run.status}") %>
</span>
<%= render DS::Pill.new(label: t("rules.recent_runs.statuses.#{run.status}"), tone: :warning, marker: false) %>
<% elsif run.success? %>
<span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-green-50 text-green-700 theme-dark:bg-green-950/30 theme-dark:text-green-400">
<%= t("rules.recent_runs.statuses.#{run.status}") %>
</span>
<%= render DS::Pill.new(label: t("rules.recent_runs.statuses.#{run.status}"), tone: :success, marker: false) %>
<% else %>
<span class="inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-red-50 text-red-700 theme-dark:bg-red-950/30 theme-dark:text-red-400">
<%= t("rules.recent_runs.statuses.#{run.status}") %>
</span>
<%= render DS::Pill.new(label: t("rules.recent_runs.statuses.#{run.status}"), tone: :error, marker: false) %>
<% end %>
<% if run.failed? && run.error_message.present? %>
<div data-controller="tooltip" data-tooltip-content-value="<%= run.error_message %>">

View File

@@ -20,7 +20,7 @@
<% dismissal_key = "#{old_sfa.id}:#{new_sfa.id}" %>
<% next if dismissed_ids.include?(dismissal_key) %>
<div class="bg-yellow-50 theme-dark:bg-yellow-900/20 border border-yellow-200 theme-dark:border-yellow-800 rounded-lg p-4">
<div class="bg-warning/10 border border-warning/20 rounded-lg p-4">
<div class="flex items-start gap-3">
<%= icon "credit-card", size: "sm", color: "warning", class: "shrink-0 mt-0.5" %>
<div class="flex-1 space-y-2">
@@ -33,7 +33,7 @@
params: { dormant_sfa_id: old_sfa.id, active_sfa_id: new_sfa.id },
method: :post,
form: { class: "inline shrink-0" },
class: "-mt-1 -mr-1 p-1 rounded hover:bg-yellow-100 theme-dark:hover:bg-yellow-900/40 text-secondary",
class: "-mt-1 -mr-1 p-1 rounded hover:bg-warning/20 text-secondary",
aria: { label: t("simplefin_items.replacement_prompt.dismiss_aria") } do %>
<%= icon "x", size: "sm" %>
<% end %>