mirror of
https://github.com/we-promise/sure.git
synced 2026-08-05 16:42:18 +00:00
* 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.
83 lines
3.0 KiB
Plaintext
83 lines
3.0 KiB
Plaintext
<%# locals: (family:, active_tab:, mobile: false) %>
|
|
|
|
<% 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? %>
|
|
<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| %>
|
|
<% tabs.with_nav do |nav| %>
|
|
<% nav.with_btn(id: "all", label: t("accounts.sidebar.tabs.all")) %>
|
|
<% nav.with_btn(id: "asset", label: t("accounts.sidebar.tabs.assets")) %>
|
|
<% nav.with_btn(id: "liability", label: t("accounts.sidebar.tabs.debts")) %>
|
|
<% end %>
|
|
|
|
<% tabs.with_panel(tab_id: "asset") do %>
|
|
<div class="space-y-2">
|
|
<%= render DS::Link.new(
|
|
text: t("accounts.sidebar.new_asset"),
|
|
variant: "ghost",
|
|
href: new_account_path(step: "method_select", classification: "asset"),
|
|
icon: "plus",
|
|
frame: :modal,
|
|
full_width: true,
|
|
class: "justify-start"
|
|
) %>
|
|
|
|
<div>
|
|
<% family.balance_sheet.assets.account_groups.each do |group| %>
|
|
<%= render "accounts/accountable_group", account_group: group, mobile: mobile %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% tabs.with_panel(tab_id: "liability") do %>
|
|
<div class="space-y-2">
|
|
<%= render DS::Link.new(
|
|
text: t("accounts.sidebar.new_debt"),
|
|
variant: "ghost",
|
|
href: new_account_path(step: "method_select", classification: "liability"),
|
|
icon: "plus",
|
|
frame: :modal,
|
|
full_width: true,
|
|
class: "justify-start"
|
|
) %>
|
|
|
|
<div>
|
|
<% family.balance_sheet.liabilities.account_groups.each do |group| %>
|
|
<%= render "accounts/accountable_group", account_group: group, mobile: mobile %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% tabs.with_panel(tab_id: "all") do %>
|
|
<div class="space-y-2">
|
|
<%= render DS::Link.new(
|
|
text: t("accounts.sidebar.new_account"),
|
|
variant: "ghost",
|
|
full_width: true,
|
|
href: new_account_path(step: "method_select"),
|
|
icon: "plus",
|
|
frame: :modal,
|
|
class: "justify-start"
|
|
) %>
|
|
|
|
<div>
|
|
<% family.balance_sheet.account_groups.each do |group| %>
|
|
<%= render "accounts/accountable_group", account_group: group, mobile: mobile, all_tab: true %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|