From c8b1d8cf92fea318fab0181e4dd4ee930378d901 Mon Sep 17 00:00:00 2001 From: Guillem Arias Fauste Date: Sat, 23 May 2026 09:06:17 +0200 Subject: [PATCH] fix(design-system): DS::Disclosure :default variant summary_content layout (#1929) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PRs #1855, #1857, #1858 (DS::Disclosure :card/:card_inset/:inline variants) introduced a `
` wrapper around `summary_content`. The wrapper is required for non-default variants — their `` is `display: list-item` (no flex), so a caller's inner flex+justify-between div would shrink-wrap to content width. But for the `:default` variant, `` is already `flex items-center justify-between`. Wrapping caller siblings in a single `w-full` block collapses them into one flex child, killing the justify-between distribution. This regressed the only default-variant summary_content caller — `accounts/_accountable_group.html.erb` (the homepage account sidebar) — where the group name and total/sparkline divs no longer aligned across the row. Render `summary_content` bare for `:default` (summary is the flex container) and keep the `w-full` wrapper for `:card`, `:card_inset`, `:inline`. --- app/components/DS/disclosure.html.erb | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/components/DS/disclosure.html.erb b/app/components/DS/disclosure.html.erb index 876dc054c..c323aa76c 100644 --- a/app/components/DS/disclosure.html.erb +++ b/app/components/DS/disclosure.html.erb @@ -1,13 +1,21 @@ <%= tag.details class: details_classes, open: open, **details_opts do %> <%= tag.summary class: summary_classes do %> <% if summary_content? %> - <%# `` is `display: list-item`, so a flex inner div would - shrink-wrap to content width and any `justify-between` inside - the slot has nothing to distribute. Wrap in a `w-full` block - so caller-supplied flex rows stretch across the card. %> -
+ <% if variant == :default %> + <%# `:default` summary is already `flex justify-between`, so + caller-provided sibling divs get distributed directly. + Wrapping would collapse them into a single flex child and + kill the justify-between distribution. %> <%= summary_content %> -
+ <% else %> + <%# Non-default summaries are `list-item` (no flex), so a flex + caller div would shrink-wrap to content width and any + `justify-between` inside has nothing to distribute. Wrap + in `w-full` so caller flex rows stretch across the card. %> +
+ <%= summary_content %> +
+ <% end %> <% else %>
<% if align == :left %>