oficina / slides Public

Editor: Share is estilo's plain pill, as in Docs (review R17, R18)

R17: drop the Slides-only 1px outline on Share; from 800px it carries
only estilo's pill rules, as Docs' Share does. TestTidyBarPills now
asserts no border on any side and a transparent fill at rest.

R18: a comment in TestTidyCoverIsCentred says why the picture is
compared with the stage and not the frame's midpoint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 964a8b9c76b306aaa2ce7fd509595ca33458c784 parent ce9028e
2 files changed, +6 −9
  • internal/slides/static/editor.css +0 −5
  • internal/slidestest/browser_editor_tidy_test.go +6 −4
diff --git a/internal/slides/static/editor.css b/internal/slides/static/editor.css
index 53c4fdd..caf8a1c 100644
--- a/internal/slides/static/editor.css
+++ b/internal/slides/static/editor.css
@@ -327,11 +327,6 @@
inset-inline-start: 0;
position: absolute;
}
- /* Share… is the outlined one (spec §2); estilo's set draws its
- controls with no border, so the line is Slides'. */
- [estilo-bar-control] > a[slides-head-share] {
- border: 1px solid var(--rst-line);
- }
}
/* The header's toggles (Format, the assistant): a pill that is lit
while what it shows is shown — the fill AND aria-expanded or
diff --git a/internal/slidestest/browser_editor_tidy_test.go b/internal/slidestest/browser_editor_tidy_test.go
index cc15ad2..b0b9bf1 100644
--- a/internal/slidestest/browser_editor_tidy_test.go
+++ b/internal/slidestest/browser_editor_tidy_test.go
@@ -2060,6 +2060,7 @@ func TestTidyCoverIsCentred(t *testing.T) {
if dx := math.Abs(cx - 960); dx > 0.005*1920 {
t.Errorf("in the cover's picture the heading's centre is %.1f across, %.1f off the middle; want within 0.5%%: text %+v", cx, dx, c.Text)
}
+ // Compared with the stage, not the frame's midpoint: a lone heading sits half a gap above the middle on the slide itself, and moving it would change how slides render, which this slice does not do (ruling R18; an open question for Paul).
if want, dy := (stage.T+stage.B)/2, math.Abs(cy-(stage.T+stage.B)/2); dy > 0.005*1080 {
t.Errorf("in the cover's picture the heading's centre is %.1f down; the slide's own page puts it at %.1f (%.1f off, %.1f%%; want within 0.5%%): text %+v, stage %+v", cy, want, dy, 100*dy/1080, c.Text, stage)
}
@@ -2089,12 +2090,13 @@ const barJS = `(() => {
const format = q('[slides-head-end] [data-view-toggle="inspector"]'), share = q('[slides-head-share]'), present = q('[slides-present-form] button')
return {Undo: box(undo), Redo: box(redo), History: box(q('[slides-history]')), Format: box(format), Share: box(share), Present: box(present),
FormatBg: cs(format).backgroundColor, ShareBg: cs(share).backgroundColor, PresentBg: cs(present).backgroundColor, PageBg: cs(q('[slides-head]')).backgroundColor,
- ShareBorder: cs(share).borderTopWidth + ' ' + cs(share).borderTopStyle, PresentRadius: cs(present).borderTopLeftRadius,
+ ShareBorder: [cs(share).borderTopWidth, cs(share).borderRightWidth, cs(share).borderBottomWidth, cs(share).borderLeftWidth].join(' '), PresentRadius: cs(present).borderTopLeftRadius,
HistoryOutline: cs(q('[slides-history]')).outlineWidth + ' ' + cs(q('[slides-history]')).outlineStyle, WinW: innerWidth}
})()`
// TestTidyBarPills (spec §2): from 800px the bar's buttons are estilo's
-// 28px pills — Format tinted while its card shows, Share… outlined,
+// 28px pills — Format tinted while its card shows, Share… estilo's
+// plain pill (no border, as in Docs),
// Present filled — and undo and redo are one pill: two buttons side by
// side with no gap, one outline round the pair, each at least 24×24.
// Narrower, every one of them is still there and at least 24×24.
@@ -2111,8 +2113,8 @@ func TestTidyBarPills(t *testing.T) {
if b.FormatBg == "rgba(0, 0, 0, 0)" {
t.Errorf("1280: Format, its card shown, has no tint")
}
- if b.ShareBorder != "1px solid" {
- t.Errorf("1280: Share's border is %q; want it outlined, 1px solid", b.ShareBorder)
+ if b.ShareBorder != "0px 0px 0px 0px" || b.ShareBg != "rgba(0, 0, 0, 0)" {
+ t.Errorf("1280: Share's border is %q and its fill %s; want estilo's plain pill as in Docs: no border, transparent at rest", b.ShareBorder, b.ShareBg)
}
if b.PresentBg == "rgba(0, 0, 0, 0)" || b.PresentBg == b.PageBg {
t.Errorf("1280: Present's fill is %s on a %s bar; want it filled", b.PresentBg, b.PageBg)