Aa controls the strip it toggles
Fable on #179 (minor): on a phone Aa shows and hides the formatting strip, but its aria-controls named the inspector. The strip ([docs-bar]) has an id now, docs-strip, and Aa names it. TestAaControlsTheStrip fails without it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 files changed,
+17
−3
internal/docs/i2_test.go+1 −1internal/docs/phone_test.go+14 −0internal/docs/views/partials/editor_bar.html+1 −1internal/docs/views/show.html+1 −1
diff --git a/internal/docs/i2_test.go b/internal/docs/i2_test.go| index f1158e0..ac68a40 100644 |
| --- a/internal/docs/i2_test.go |
| +++ b/internal/docs/i2_test.go |
| @@ -152,7 +152,7 @@ func TestAReaderGetsNoFormattingChrome(t *testing.T) { |
| carol := signInCookies(t, app, "carol@example.com") |
| post(t, app, alice, "/d/"+sqid+"/share", "address=carol@example.com&role=writer") |
| - formatting := []string{"<aside docs-inspector", "<div docs-toolbar ", "<div docs-bar>", "data-estilo-toggle", "<div docs-history", "<div estilo-bar-lead>", "/static/brand/inspector"} |
| + formatting := []string{"<aside docs-inspector", "<div docs-toolbar ", "<div docs-bar", "data-estilo-toggle", "<div docs-history", "<div estilo-bar-lead>", "/static/brand/inspector"} |
| reader := get(t, app, bob, "/d/"+sqid).Body.String() |
| for _, banned := range formatting { |
| if strings.Contains(reader, banned) { |
diff --git a/internal/docs/phone_test.go b/internal/docs/phone_test.go| index 51a8fc6..65d3f45 100644 |
| --- a/internal/docs/phone_test.go |
| +++ b/internal/docs/phone_test.go |
| @@ -243,3 +243,17 @@ func TestATitleIsOneLineOfText(t *testing.T) { |
| t.Error("the large title's field has no maxlength") |
| } |
| } |
| + |
| +// Aa toggles the formatting strip on a phone, so it controls the strip, |
| +// not the inspector it once named (Fable on #179). |
| +func TestAaControlsTheStrip(t *testing.T) { |
| + _, _, pages := people(t, "Minutes") |
| + body := pages["writer"] |
| + aa := section(t, body, "<button estilo-bar-tool type=\"button\" docs-aa", ">") |
| + if !strings.Contains(aa, `aria-controls="docs-strip"`) { |
| + t.Errorf("Aa does not control the strip: %s", aa) |
| + } |
| + if !strings.Contains(body, `<div docs-bar id="docs-strip">`) { |
| + t.Error("the strip has no id for Aa to name") |
| + } |
| +} |
diff --git a/internal/docs/views/partials/editor_bar.html b/internal/docs/views/partials/editor_bar.html| index d0f04cb..b3af869 100644 |
| --- a/internal/docs/views/partials/editor_bar.html |
| +++ b/internal/docs/views/partials/editor_bar.html |
| @@ -91,7 +91,7 @@ |
| mounts, as that item is. Help is a disclosure inside the panel, not |
| in the group: a <details name="estilo-menus"> inside it would close |
| ••• as it opened. */}} |
| -{{define "docs-trail"}}{{if .Aa}}<button estilo-bar-tool type="button" docs-aa aria-controls="docs-inspector" aria-expanded="false" aria-label="{{.AaLabel}}" disabled><span docs-aa-glyph aria-hidden="true">Aa</span></button>{{end}}<details docs-more name="estilo-menus"><summary estilo-bar-tool aria-label="{{.Label}}">{{template "docs-more-icon" "more"}}</summary><div estilo-menu docs-more-panel>{{$checks := .Checks}}{{range .Rows}}{{template "docs-more-row" (moreRowIn . $checks)}}{{end}}</div></details>{{end}} |
| +{{define "docs-trail"}}{{if .Aa}}<button estilo-bar-tool type="button" docs-aa aria-controls="docs-strip" aria-expanded="false" aria-label="{{.AaLabel}}" disabled><span docs-aa-glyph aria-hidden="true">Aa</span></button>{{end}}<details docs-more name="estilo-menus"><summary estilo-bar-tool aria-label="{{.Label}}">{{template "docs-more-icon" "more"}}</summary><div estilo-menu docs-more-panel>{{$checks := .Checks}}{{range .Rows}}{{template "docs-more-row" (moreRowIn . $checks)}}{{end}}</div></details>{{end}} |
| {{/* docs-more-row: one row of •••. Data: moreRowView (a row, and |
| whether its panel draws the check column). */}} |
diff --git a/internal/docs/views/show.html b/internal/docs/views/show.html| index a858cc1..d72f2de 100644 |
| --- a/internal/docs/views/show.html |
| +++ b/internal/docs/views/show.html |
| @@ -1871,7 +1871,7 @@ |
| <div docs-chrome> |
| {{/* A reader cannot format: no strip, no inspector, no undo/redo (review |
| on #106). The editor bundle, which drives them, is the writer's too. */}} |
| -{{if .CanWrite}}<div docs-bar> |
| +{{if .CanWrite}}<div docs-bar id="docs-strip"> |
| {{/* The formatting bar (fixtures/toolbar.mjs). Rendered server-side, |
| with every label resolved from the catalog (render.go's |
| docs.editor.toolbar.*) — the bundle carries no copy of its own, |