Editor: Position and size says its numbers are percentages again
The line "Position and size, as a percentage of the frame" became screen-reader only, so 60.0 and 30.0 had no visible unit. It is now a quiet line over the four fields, and still their group's name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+27
−4
internal/slides/static/editor.css+8 −0internal/slides/templates/editor.html+1 −1internal/slidestest/browser_quieter_box_test.go+16 −1internal/slidestest/quieter_test.go+2 −2
diff --git a/internal/slides/static/editor.css b/internal/slides/static/editor.css| index 3d9ab77..8b75a2c 100644 |
| --- a/internal/slides/static/editor.css |
| +++ b/internal/slides/static/editor.css |
| @@ -1355,6 +1355,14 @@ summary[slides-card-row]::-webkit-details-marker { |
| min-inline-size: 0; |
| padding: 0; |
| } |
| +/* The numbers' unit, in sight: one quiet line over the four fields, |
| + which is also their group's name. */ |
| +[slides-box-fields] > legend { |
| + font-weight: 400; |
| + line-height: 1.35; |
| + margin-block-end: 6px; |
| + padding: 0; |
| +} |
| [slides-phone-badge] > [slides-card-row] { |
| inline-size: auto; |
| } |
diff --git a/internal/slides/templates/editor.html b/internal/slides/templates/editor.html| index abd2023..5e45779 100644 |
| --- a/internal/slides/templates/editor.html |
| +++ b/internal/slides/templates/editor.html |
| @@ -785,7 +785,7 @@ |
| <details slides-place data-layout="canvas"> |
| <summary slides-card-row id="slides-g-place"><span>{{.L "place.title"}}</span><span aria-hidden="true">{{icon "chevron-down"}}</span></summary> |
| <fieldset slides-box-fields> |
| - <legend class="rst-sr-only">{{.L "block.box"}}</legend> |
| + <legend>{{.L "block.box"}}</legend> |
| <div rst-field> |
| <label rst-field-label for="rst-block-x">{{.L "box.x"}}</label> |
| <input rst-input="short" id="rst-block-x" name="rst-block-x" type="number" min="0" max="100" step="0.1" data-box="x"> |
diff --git a/internal/slidestest/browser_quieter_box_test.go b/internal/slidestest/browser_quieter_box_test.go| index d6117ff..107e5c7 100644 |
| --- a/internal/slidestest/browser_quieter_box_test.go |
| +++ b/internal/slidestest/browser_quieter_box_test.go |
| @@ -580,7 +580,8 @@ func TestQuieterDeleteKey(t *testing.T) { |
| } |
| // TestQuieterPlaceClosesOnReload (spec §4.3): Position and size, opened, |
| -// stays open while the page is open and is closed again after a reload. |
| +// says its numbers are percentages of the frame, stays open while the |
| +// page is open and is closed again after a reload. |
| func TestQuieterPlaceClosesOnReload(t *testing.T) { |
| te := openTidyEditorOn(t, 1280, 720, func(a *testApp, cookies []*http.Cookie) string { return quieterDeck(t, a, cookies, boxMenuDeck) }) |
| te.openOn("boxcanvas001") |
| @@ -589,6 +590,20 @@ func TestQuieterPlaceClosesOnReload(t *testing.T) { |
| pressBoxMenuRow("block-place"), |
| waitFor(`document.querySelector('[slides-place]').open`), |
| ) |
| + // The numbers' unit is in sight (review: they had none): the group's |
| + // one quiet line says they are percentages of the frame, and is |
| + // still the four fields' group name. |
| + var unit struct { |
| + Shown bool |
| + Text string |
| + } |
| + te.rig.Run(chromedp.Evaluate(`(l => ({ Shown: l.checkVisibility() && l.getBoundingClientRect().height >= 8 && getComputedStyle(l).clipPath === 'none' && getComputedStyle(l).position !== 'absolute', Text: l.textContent.trim() }))(document.querySelector('[slides-box-fields] > legend'))`, &unit)) |
| + if !unit.Shown || unit.Text != "Position and size, as a percentage of the frame" { |
| + t.Errorf("Position and size open: its line is %+v; want it drawn, saying the numbers are percentages of the frame", unit) |
| + } |
| + if got := axName(t, te.rig, `[slides-box-fields]`); got != unit.Text { |
| + t.Errorf("the four fields' group is named %q, want %q", got, unit.Text) |
| + } |
| // Another box: still open. |
| te.selectBoxByID(t, "cedge0000001") |
| var open bool |
diff --git a/internal/slidestest/quieter_test.go b/internal/slidestest/quieter_test.go| index b555817..8a3f335 100644 |
| --- a/internal/slidestest/quieter_test.go |
| +++ b/internal/slidestest/quieter_test.go |
| @@ -809,8 +809,8 @@ var quieterStrings = []struct{ key, english string }{ |
| // reuses are still there; every key in editorStrings is read (as |
| // TestEditorTidyStrings counts reading) and defined; and the keys the |
| // quieter editor retired are gone from both, except block.level (the |
| -// heading level's legend) and block.box (the position fields' hidden |
| -// legend), which the finished markup still reads. |
| +// heading level's legend) and block.box (the position fields' legend, |
| +// a quiet line), which the finished markup still reads. |
| func TestQuieterStrings(t *testing.T) { |
| catalog := editorCatalog(t) |
| src := readSource(t, "editor.go") |