Editor: the card's questions give their buttons room
The leave-free question's first button sat on the last line of its text: the card zeroes a paragraph's margin, and the callout's own spacing went with it. A question's actions in the card now sit 12px under its words with 8px between buttons (the Delete slide question too), and the leave-free question's two buttons, too wide to share a row at 248px, stack at the callout's width.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+26
−0
internal/slides/static/editor.css+10 −0internal/slidestest/browser_quieter_test.go+16 −0
diff --git a/internal/slides/static/editor.css b/internal/slides/static/editor.css| index c034055..76c7f65 100644 |
| --- a/internal/slides/static/editor.css |
| +++ b/internal/slides/static/editor.css |
| @@ -1388,6 +1388,16 @@ summary[slides-card-row]::-webkit-details-marker { |
| [slides-inspector-form] [rst-callout] { |
| margin: 0; |
| } |
| +/* A question in the card: its buttons clear of its words. The |
| + leave-free question's two do not fit side by side in the card's |
| + measure, so they stack, each the callout's width. */ |
| +[slides-inspector-form] [rst-callout-body] > [slides-inspector-actions] { |
| + gap: var(--rst-sp-2); |
| + margin-block-start: var(--rst-sp-3); |
| +} |
| +[slides-confirm-layout] [slides-inspector-actions] { |
| + flex-direction: column; |
| +} |
| [slides-accent] { |
| align-items: end; |
| } |
diff --git a/internal/slidestest/browser_quieter_test.go b/internal/slidestest/browser_quieter_test.go| index e7d16cd..66a414f 100644 |
| --- a/internal/slidestest/browser_quieter_test.go |
| +++ b/internal/slidestest/browser_quieter_test.go |
| @@ -1321,6 +1321,22 @@ func TestQuieterLayoutPictures(t *testing.T) { |
| if dashed != "dashed" { |
| t.Errorf("the picture asked about has a %s outline, want dashed", dashed) |
| } |
| + // The question has room (review V1): clear space between its text |
| + // and its first button, and between the buttons, each inside the |
| + // callout. |
| + var room string |
| + te.rig.Run(chromedp.Evaluate(`(() => { |
| + const q = document.querySelector('[slides-confirm-layout]'), text = q.querySelector('[slides-confirm-layout-text]').getBoundingClientRect() |
| + const [a, b] = [...q.querySelectorAll('[slides-inspector-actions] button')].map(x => x.getBoundingClientRect()), box = q.getBoundingClientRect(), out = [] |
| + if (a.top - text.bottom < 8) out.push('the first button is ' + (a.top - text.bottom).toFixed(1) + 'px under the text, want at least 8') |
| + const gap = b.top >= a.bottom ? b.top - a.bottom : b.left - a.right |
| + if (gap < 6) out.push('the buttons are ' + gap.toFixed(1) + 'px apart, want at least 6') |
| + for (const r of [a, b]) if (r.left < box.left || r.right > box.right) out.push('a button runs outside the question') |
| + return out.join('; ') |
| + })()`, &room)) |
| + if room != "" { |
| + t.Errorf("the leave-free question: %s", room) |
| + } |
| te.rig.Screen(`[slides-inspector]`, "leaving free placement asks") |
| te.rig.Run( |
| chromedp.Click(`[slides-confirm-layout] [data-command="layout-leave-free-cancel"]`, chromedp.ByQuery), |