Editor: the phone line shows in Phone view only, on its own row narrow
In Both view the editable stage is the desktop's, and dragging or placing a box there edits the desktop layout, so "Editing the phone layout" was untrue there (ruling R18). The line is now drawn in Phone view alone; the On a phone field and group still show in Both, since they do write phone settings. Below 560px the line takes a row of its own under the view switch rather than wrapping onto four lines in the third column. The spec's §3.4 says the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 files changed,
+78
−50
docs/superpowers/specs/2026-11-17-quieter-editor-design.md+6 −3internal/slides/static/editor.css+21 −7internal/slides/templates/editor.html+3 −2internal/slidestest/browser_quieter_test.go+35 −30internal/slidestest/quieter_test.go+13 −8
diff --git a/docs/superpowers/specs/2026-11-17-quieter-editor-design.md b/docs/superpowers/specs/2026-11-17-quieter-editor-design.md| index c463bf2..642c1a4 100644 |
| --- a/docs/superpowers/specs/2026-11-17-quieter-editor-design.md |
| +++ b/docs/superpowers/specs/2026-11-17-quieter-editor-design.md |
| @@ -177,9 +177,12 @@ In these two views, and only in them: |
| choice (canvas slides, as today); |
| - with a box selected, the card adds the **On a phone** group (hidden, |
| order, size, reset, and today's override badge); |
| -- the stage carries one line of text beside the view switch saying |
| - that the phone layout is being edited, so a person knows why an |
| - edit there differs. |
| +- in Phone view only, the stage carries one line of text beside the |
| + view switch saying that the phone layout is being edited, so a |
| + person knows why an edit there differs. In Both view the editable |
| + stage is the desktop's, and dragging or placing a box there edits |
| + the desktop layout, so the line is not drawn (ruling R18, from the |
| + whole-branch review). |
| In Desktop view none of the three shows. |
diff --git a/internal/slides/static/editor.css b/internal/slides/static/editor.css| index a08549b..c034055 100644 |
| --- a/internal/slides/static/editor.css |
| +++ b/internal/slides/static/editor.css |
| @@ -1535,14 +1535,28 @@ summary[slides-card-row]::-webkit-details-marker { |
| justify-self: start; |
| min-inline-size: 0; |
| } |
| +/* Narrow, the third column is too slim for the phone line (at 320px it |
| + wrapped onto four lines): in Phone view, the one view that draws it, |
| + it takes a row of its own under the switch. */ |
| +@media (max-width: 559px) { |
| + [slides-editor][data-view="phone"] [slides-stage-bar] > [slides-phone-status] { |
| + grid-column: 1 / -1; |
| + justify-self: center; |
| + } |
| +} |
| -/* On a phone (spec §3.4): the slide's phone field, the box's On a |
| - phone group (the whole group, so no label is left showing) and the |
| - line saying the phone layout is being edited are drawn in Phone and |
| - Both view alone. The server paints Desktop and the view is applied |
| - after the editor mounts, so nothing is drawn at the first paint and |
| - nothing moves at mount. */ |
| -[slides-editor]:not(:is([data-view="phone"], [data-view="both"])) :is([data-group="phone"], [data-phone-only], [slides-phone-editing]) { |
| +/* On a phone (spec §3.4): the slide's phone field and the box's On a |
| + phone group (the whole group, so no label is left showing) are drawn |
| + in Phone and Both view alone; the line saying the phone layout is |
| + being edited in Phone view alone (ruling R18: in Both the stage is |
| + the desktop's, and placing a box there edits the desktop layout). |
| + The server paints Desktop and the view is applied after the editor |
| + mounts, so nothing is drawn at the first paint and nothing moves at |
| + mount. */ |
| +[slides-editor]:not(:is([data-view="phone"], [data-view="both"])) :is([data-group="phone"], [data-phone-only]) { |
| + display: none; |
| +} |
| +[slides-editor]:not([data-view="phone"]) [slides-phone-editing] { |
| display: none; |
| } |
| /* Three radios drawn as estilo's segmented control ([estilo-seg]): it |
diff --git a/internal/slides/templates/editor.html b/internal/slides/templates/editor.html| index 76a00ff..abd2023 100644 |
| --- a/internal/slides/templates/editor.html |
| +++ b/internal/slides/templates/editor.html |
| @@ -421,8 +421,9 @@ |
| </fieldset> |
| {{/* The line that says the phone layout is being edited (spec |
| §3.4). Its wrapper is in every view, so a change of view is |
| - announced; the line itself is drawn in Phone and Both alone |
| - (editor.css), and sits beside the switch without moving it. */}} |
| + announced; the line itself is drawn in Phone view alone |
| + (editor.css; ruling R18: in Both, placing a box edits the |
| + desktop), and sits beside the switch without moving it. */}} |
| <span slides-phone-status role="status"><span slides-phone-editing>{{.L "phone.editing"}}</span></span> |
| </div> |
| {{/* The stage and the notes are always here, an empty deck's |
diff --git a/internal/slidestest/browser_quieter_test.go b/internal/slidestest/browser_quieter_test.go| index 7efe256..a34e15c 100644 |
| --- a/internal/slidestest/browser_quieter_test.go |
| +++ b/internal/slidestest/browser_quieter_test.go |
| @@ -1475,13 +1475,14 @@ const phoneDrawnJS = `(() => { |
| return [drawn('#rst-slide-phone'), drawn('[data-group="phone"]'), drawn('[slides-phone-editing]')].join(',') |
| })()` |
| -// TestQuieterPhoneOnly (spec §3.4, Q6): the slide's On a phone field, |
| -// the box's On a phone group and the line saying the phone layout is |
| -// being edited are drawn in Phone and Both view and in no other; the |
| -// line says Editing the phone layout, sits in a live region that is |
| -// there in every view, and does not move the view switch; and a change |
| -// of view with a box selected changes the card at once, the selection |
| -// kept. |
| +// TestQuieterPhoneOnly (spec §3.4, Q6, ruling R18): the slide's On a |
| +// phone field and the box's On a phone group are drawn in Phone and Both |
| +// view and in no other; the line saying the phone layout is being |
| +// edited is drawn in Phone view alone (in Both, placing a box edits the |
| +// desktop layout); the line says Editing the phone layout, sits in a |
| +// live region that is there in every view, and does not move the view |
| +// switch; and a change of view with a box selected changes the card at |
| +// once, the selection kept. |
| func TestQuieterPhoneOnly(t *testing.T) { |
| te := openTidyEditor(t, 2, 1280, 720) |
| canvas := te.addCanvasShape(t) |
| @@ -1508,10 +1509,10 @@ func TestQuieterPhoneOnly(t *testing.T) { |
| if live != "status|Editing the phone layout" { |
| t.Errorf("the stage bar's live region is %q, want role=status holding Editing the phone layout", live) |
| } |
| - for _, v := range []string{"phone", "both"} { |
| - te.view(v) |
| - drawn("false,false,true", "a flow slide in "+v+" view") |
| - } |
| + te.view("phone") |
| + drawn("false,false,true", "a flow slide in phone view") |
| + te.view("both") |
| + drawn("false,false,false", "a flow slide in both view") |
| te.view("desktop") |
| // A canvas slide, nothing selected. |
| @@ -1520,7 +1521,11 @@ func TestQuieterPhoneOnly(t *testing.T) { |
| drawn("false,false,false", "a canvas slide in Desktop view") |
| for _, v := range []string{"phone", "both"} { |
| te.view(v) |
| - drawn("true,false,true", "a canvas slide in "+v+" view") |
| + if v == "both" { |
| + drawn("true,false,false", "a canvas slide in both view") |
| + } else { |
| + drawn("true,false,true", "a canvas slide in phone view") |
| + } |
| var text string |
| te.rig.Run(chromedp.Evaluate(`document.querySelector('[slides-phone-editing]').textContent`, &text)) |
| if text != "Editing the phone layout" { |
| @@ -1544,10 +1549,7 @@ func TestQuieterPhoneOnly(t *testing.T) { |
| drawn("false,false,false", "a selected box in Desktop view") |
| for _, v := range []string{"phone", "both", "desktop", "both", "phone"} { |
| te.view(v) |
| - want := "false,false,false" |
| - if v != "desktop" { |
| - want = "false,true,true" |
| - } |
| + want := map[string]string{"desktop": "false,false,false", "both": "false,true,false", "phone": "false,true,true"}[v] |
| drawn(want, "a selected box in "+v+" view") |
| var kept bool |
| te.rig.Run(chromedp.Evaluate(selected+` && document.querySelector('[slides-editor]').dataset.inspect === 'box'`, &kept)) |
| @@ -1556,22 +1558,23 @@ func TestQuieterPhoneOnly(t *testing.T) { |
| } |
| } |
| - // Narrow windows (the stage bar is a three-column grid): the line |
| - // stays inside the bar and the window, all its words shown, and |
| - // clear of the view switch, with the box still selected. |
| + // 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 |
| + // still selected; in Both it is not drawn. |
| for _, size := range [][2]int64{{1000, 800}, {320, 700}} { |
| te.size(size[0], size[1]) |
| - for _, v := range []string{"phone", "both"} { |
| - te.view(v) |
| - drawn("false,true,true", fmt.Sprintf("a selected box in %s view at %dx%d", v, size[0], size[1])) |
| - var got string |
| - te.rig.Run( |
| - chromedp.Evaluate(`document.querySelector('[slides-stage-bar]').scrollIntoView({ block: 'center', inline: 'nearest' })`, nil), |
| - chromedp.Evaluate(phoneLineJS, &got), |
| - ) |
| - if got != "" { |
| - t.Errorf("in %s view at %dx%d: %s", v, size[0], size[1], got) |
| - } |
| + te.view("both") |
| + drawn("false,true,false", fmt.Sprintf("a selected box in both view at %dx%d", size[0], size[1])) |
| + te.view("phone") |
| + drawn("false,true,true", fmt.Sprintf("a selected box in phone view at %dx%d", size[0], size[1])) |
| + var got string |
| + te.rig.Run( |
| + chromedp.Evaluate(`document.querySelector('[slides-stage-bar]').scrollIntoView({ block: 'center', inline: 'nearest' })`, nil), |
| + chromedp.Evaluate(phoneLineJS, &got), |
| + ) |
| + if got != "" { |
| + t.Errorf("in phone view at %dx%d: %s", size[0], size[1], got) |
| } |
| } |
| } |
| @@ -1595,5 +1598,7 @@ const phoneLineJS = `(() => { |
| out.push('the line\'s words are cut off (' + box.scrollWidth + 'x' + box.scrollHeight + ' in ' + box.clientWidth + 'x' + box.clientHeight + ')') |
| if (l.left < s.right && s.left < l.right && l.top < s.bottom && s.top < l.bottom) |
| out.push('the line ' + at(l) + ' overlaps the view switch ' + at(s)) |
| + const lines = new Set([...line.getClientRects()].map(r => Math.round(r.top))).size |
| + if (lines > 1) out.push('the line wraps onto ' + lines + ' lines') |
| return out.join('; ') |
| })()` |
diff --git a/internal/slidestest/quieter_test.go b/internal/slidestest/quieter_test.go| index 7a4f302..b555817 100644 |
| --- a/internal/slidestest/quieter_test.go |
| +++ b/internal/slidestest/quieter_test.go |
| @@ -311,12 +311,13 @@ func childrenOf(el string) []string { |
| // openTag is el's opening tag. |
| func openTag(el string) string { return el[:strings.Index(el, ">")+1] } |
| -// TestQuieterPhoneOnlyMarkup (spec §3.4, Q6): the slide's phone field, |
| -// the box's On a phone group and the stage's one line are in the page |
| -// for every view, and the stylesheet draws them in the phone views |
| -// alone: the server paints Desktop (the view is applied after mount), so |
| -// at the first paint none of the three is drawn and nothing moves when |
| -// the bundle mounts. |
| +// TestQuieterPhoneOnlyMarkup (spec §3.4, Q6, ruling R18): the slide's |
| +// phone field, the box's On a phone group and the stage's one line are |
| +// in the page for every view, and the stylesheet draws the field and |
| +// the group in the phone views alone and the line in Phone view alone |
| +// (in Both, placing a box edits the desktop layout): the server paints |
| +// Desktop (the view is applied after mount), so at the first paint none |
| +// of the three is drawn and nothing moves when the bundle mounts. |
| func TestQuieterPhoneOnlyMarkup(t *testing.T) { |
| a := newApp(t) |
| cookies := signedIn(t, a, allowedAddress) |
| @@ -331,9 +332,13 @@ func TestQuieterPhoneOnlyMarkup(t *testing.T) { |
| t.Errorf("the phone-only parts are marked %d times, want the slide's field and the box's group:\n%s", n, parts) |
| } |
| css := readStatic(t, "editor.css") |
| - rule := regexp.MustCompile(`(?s)\[slides-editor\]:not\(:is\(\[data-view="phone"\], \[data-view="both"\]\)\)\s+:is\(\[data-group="phone"\], \[data-phone-only\], \[slides-phone-editing\]\)\s*\{[^}]*display:\s*none`) |
| + rule := regexp.MustCompile(`(?s)\[slides-editor\]:not\(:is\(\[data-view="phone"\], \[data-view="both"\]\)\)\s+:is\(\[data-group="phone"\], \[data-phone-only\]\)\s*\{[^}]*display:\s*none`) |
| if !rule.MatchString(css) { |
| - t.Error("editor.css has no rule hiding [data-group=\"phone\"], [data-phone-only] and [slides-phone-editing] outside the phone and both views") |
| + t.Error("editor.css has no rule hiding [data-group=\"phone\"] and [data-phone-only] outside the phone and both views") |
| + } |
| + only := regexp.MustCompile(`(?s)\[slides-editor\]:not\(\[data-view="phone"\]\)\s+\[slides-phone-editing\]\s*\{[^}]*display:\s*none`) |
| + if !only.MatchString(css) { |
| + t.Error("editor.css has no rule hiding [slides-phone-editing] outside Phone view (ruling R18: not in Both, where placing a box edits the desktop)") |
| } |
| bar := extent(live, strings.Index(live, "<div slides-stage-bar>")) |
| line := regexp.MustCompile(`<[a-z]+ [^>]*slides-phone-editing[^>]*>([^<]*)<`).FindStringSubmatch(live) |