Editor: Size on a phone has a row of its own
Beside Order on a phone, the Size select was 107px and estilo cut its "Same as desktop" to "Same as…". The two phone fields now take a row each.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+25
−12
internal/slides/templates/editor.html+11 −12internal/slidestest/browser_quieter_test.go+14 −0
diff --git a/internal/slides/templates/editor.html b/internal/slides/templates/editor.html| index 5e45779..a4453d5 100644 |
| --- a/internal/slides/templates/editor.html |
| +++ b/internal/slides/templates/editor.html |
| @@ -815,18 +815,17 @@ |
| <div rst-field> |
| <label rst-switch><input type="checkbox" name="rst-block-phone-hidden" data-phone="hidden"><span rst-switch-track aria-hidden="true"></span> {{.L "block.phone.hidden"}}</label> |
| </div> |
| - <div rst-field-row> |
| - <div rst-field> |
| - <label rst-field-label for="rst-block-phone-order">{{.L "block.phone.order"}}</label> |
| - <input rst-input="short" id="rst-block-phone-order" name="rst-block-phone-order" type="number" step="1" data-phone="order"> |
| - </div> |
| - <div rst-field> |
| - <label rst-field-label for="rst-block-phone-size">{{.L "block.phone.size"}}</label> |
| - <select rst-input="short" id="rst-block-phone-size" name="rst-block-phone-size" data-phone="size"> |
| - <option value="">{{.L "block.phone.same"}}</option> |
| - <option value="s">{{.L "size.s"}}</option><option value="m">{{.L "size.m"}}</option><option value="l">{{.L "size.l"}}</option> |
| - </select> |
| - </div> |
| + {{/* One field a row: "Same as desktop" is cut short beside another. */}} |
| + <div rst-field> |
| + <label rst-field-label for="rst-block-phone-order">{{.L "block.phone.order"}}</label> |
| + <input rst-input="short" id="rst-block-phone-order" name="rst-block-phone-order" type="number" step="1" data-phone="order"> |
| + </div> |
| + <div rst-field> |
| + <label rst-field-label for="rst-block-phone-size">{{.L "block.phone.size"}}</label> |
| + <select rst-input="short" id="rst-block-phone-size" name="rst-block-phone-size" data-phone="size"> |
| + <option value="">{{.L "block.phone.same"}}</option> |
| + <option value="s">{{.L "size.s"}}</option><option value="m">{{.L "size.m"}}</option><option value="l">{{.L "size.l"}}</option> |
| + </select> |
| </div> |
| </div> |
| </form> |
diff --git a/internal/slidestest/browser_quieter_test.go b/internal/slidestest/browser_quieter_test.go| index 501ec9d..de976af 100644 |
| --- a/internal/slidestest/browser_quieter_test.go |
| +++ b/internal/slidestest/browser_quieter_test.go |
| @@ -1672,6 +1672,20 @@ func TestQuieterPhoneOnly(t *testing.T) { |
| } |
| } |
| + // Size on a phone has the group's whole row: its choices ("Same as |
| + // desktop") were cut to "Same as…" beside the order field. |
| + var row string |
| + te.rig.Run(chromedp.Evaluate(`(() => { |
| + const size = document.querySelector('#rst-block-phone-size').getBoundingClientRect(), order = document.querySelector('#rst-block-phone-order').getBoundingClientRect() |
| + const group = document.querySelector('[data-group="phone"]').getBoundingClientRect(), out = [] |
| + if (size.top < order.bottom) out.push('Size on a phone shares a row with Order on a phone') |
| + if (size.width < group.width - 1) out.push('Size on a phone is ' + size.width + 'px of the group\'s ' + group.width) |
| + return out.join('; ') |
| + })()`, &row)) |
| + if row != "" { |
| + t.Errorf("a selected box in phone view: %s", row) |
| + } |
| + |
| // Narrow windows (the stage bar is a three-column grid): in Phone |
| // view the line stays inside the bar and the window, all its words |
| // shown on one line, and clear of the view switch, with the box |