From b2b89437b08e3e0bff71912ae8cd9cb9ddc8ebd2 Mon Sep 17 00:00:00 2001 From: Guillem Arias Fauste Date: Thu, 11 Jun 2026 15:30:08 +0200 Subject: [PATCH] fix(ds): route remaining literal yellow warning surfaces onto --color-warning (#2250) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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
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
, 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
-markup fragments on deploy. The sidebar missing-data notice migrated from
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. --- app/helpers/accounts_helper.rb | 2 +- .../accounts/_account_sidebar_tabs.html.erb | 22 +++++-------------- app/views/import/confirms/_mappings.html.erb | 2 +- app/views/rules/index.html.erb | 12 +++------- .../_replacement_prompt.html.erb | 4 ++-- 5 files changed, 13 insertions(+), 29 deletions(-) diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb index a119246fd..d35ed07ed 100644 --- a/app/helpers/accounts_helper.rb +++ b/app/helpers/accounts_helper.rb @@ -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, diff --git a/app/views/accounts/_account_sidebar_tabs.html.erb b/app/views/accounts/_account_sidebar_tabs.html.erb index 653a64c85..9b9087091 100644 --- a/app/views/accounts/_account_sidebar_tabs.html.erb +++ b/app/views/accounts/_account_sidebar_tabs.html.erb @@ -3,22 +3,12 @@ <% cache account_sidebar_tabs_cache_key(family: family, active_tab: active_tab, mobile: mobile), expires_in: 12.hours do %>
<% if family.missing_data_provider? %> -
- -
- <%= icon "triangle-alert", size: "sm", color: "warning" %> -

<%= t("accounts.sidebar.missing_data") %>

-
- - <%= icon("chevron-down", color: "warning", class: "group-open:transform group-open:rotate-180") %> -
-
-

<%= t("accounts.sidebar.missing_data_description", product: product_name) %>

-

- <%= link_to t("accounts.sidebar.configure_providers"), settings_hosting_path, class: "text-yellow-600 underline" %> -

-
-
+
+ <%= render DS::Alert.new(title: t("accounts.sidebar.missing_data"), variant: :warning) do %> +

<%= t("accounts.sidebar.missing_data_description", product: product_name) %>

+

<%= link_to t("accounts.sidebar.configure_providers"), settings_hosting_path, class: "underline font-medium" %>

+ <% end %> +
<% end %> <%= render DS::Tabs.new(active_tab: active_tab, session_key: "account_sidebar_tab", testid: "account-sidebar-tabs") do |tabs| %> diff --git a/app/views/import/confirms/_mappings.html.erb b/app/views/import/confirms/_mappings.html.erb index 2cfb6ab46..9ad032903 100644 --- a/app/views/import/confirms/_mappings.html.erb +++ b/app/views/import/confirms/_mappings.html.erb @@ -23,7 +23,7 @@ <% elsif import.has_unassigned_account? %>
-
+
<%= tag.p t(".unassigned_account"), class: "text-sm" %> <%= render DS::Link.new( text: t(".create_account"), diff --git a/app/views/rules/index.html.erb b/app/views/rules/index.html.erb index 4c43de864..57fc04e12 100644 --- a/app/views/rules/index.html.erb +++ b/app/views/rules/index.html.erb @@ -147,17 +147,11 @@
<% if run.pending? %> - - <%= t("rules.recent_runs.statuses.#{run.status}") %> - + <%= render DS::Pill.new(label: t("rules.recent_runs.statuses.#{run.status}"), tone: :warning, marker: false) %> <% elsif run.success? %> - - <%= t("rules.recent_runs.statuses.#{run.status}") %> - + <%= render DS::Pill.new(label: t("rules.recent_runs.statuses.#{run.status}"), tone: :success, marker: false) %> <% else %> - - <%= t("rules.recent_runs.statuses.#{run.status}") %> - + <%= render DS::Pill.new(label: t("rules.recent_runs.statuses.#{run.status}"), tone: :error, marker: false) %> <% end %> <% if run.failed? && run.error_message.present? %>
diff --git a/app/views/simplefin_items/_replacement_prompt.html.erb b/app/views/simplefin_items/_replacement_prompt.html.erb index 4337a8f69..095601f9e 100644 --- a/app/views/simplefin_items/_replacement_prompt.html.erb +++ b/app/views/simplefin_items/_replacement_prompt.html.erb @@ -20,7 +20,7 @@ <% dismissal_key = "#{old_sfa.id}:#{new_sfa.id}" %> <% next if dismissed_ids.include?(dismissal_key) %> -
+
<%= icon "credit-card", size: "sm", color: "warning", class: "shrink-0 mt-0.5" %>
@@ -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 %>