oficina / slides Public
The editor, tidied — implementation plan
> For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.
Goal: The Slides editor gets Docs' grey desk, a floating inspector that follows the selection, floating notes, a pinned New slide pill, a three-icon view switch and a phone-shaped phone frame, with no change to any document state.
Architecture: The shared look (floating card, labelled groups, segmented control, desk colour) becomes a new estilo part, desk, written from Docs' rules; Slides pins it and uses it. In Slides the server renders the final layout (the card's open or closed state comes from a cookie); one root attribute, data-inspect, says what the card shows, and CSS does the showing. Three small new JS modules own the new behaviour (inspect.mjs, notes-card.mjs, phone-frame.mjs); editor-entry.js only wires them.
Tech Stack: Go templates and CSS in internal/slides; the editor bundle in fixtures/*.mjs (built to internal/slides/static/editor.<hash>.js); estilo as a Go module; chromedp browser tests in internal/slidestest (build tag browser); node --test for the JS modules.
Spec: docs/superpowers/specs/2026-11-16-editor-tidy-design.md (cited as §n). The mockup beside it shows where things go, not which fields exist; the spec wins.
Global Constraints
- No document state changes (§ intro). No field, op, migration, Rust core or renderer change. If a task seems to need one, stop and report.
- Two repos, two branches. estilo: worktree
~/amadan.net/oficina/estilo-desk, branchdesk, cut fromorigin/mainaftergit fetch(head was4d5b935). Slides: worktree~/amadan.net/oficina/slides-editor-tidy, brancheditor-tidy, cut fromorigin/mainaftergit fetch(wascb30df5), thengit cherry-pickthe commits ofdesign/editor-tidy(docs only) so the spec, mockup and this plan travel with the code. - Nothing is pushed, merged or posted without Paul's word. Each branch needs an amadan discussion before merge, posted as the agent account, never as Paul; squash merge only on green
amadan ci status -branch <name>(AGENTS.md). Tasks A1 and B10 stop at "ready to push" and ask. - Every string is a catalog key in
internal/slides/locales/en.toml(the only locale) and listed ineditorStrings(internal/slides/editor.go:183). The strings table below is a proposal: run the copy-review skill once with Paul before Task B4 and use his wording verbatim. - Icons are lucide, inline, added to
internal/slides/icons/icons.gowith the same<svg class="icon" …>wrapper as its neighbours, and to the credits inventory (make cirunscredits-check). - Never a flash; the stage is not a second renderer (
AGENTS.md). The font-wait inert list (fixtures/editor-fonts.mjs:168-175) is not edited: every new control lives inside one of its six selectors. - Accessibility: WCAG 2.2 AA; targets at least 24×24 CSS px; icon-only buttons carry
aria-label; no information by colour or dot alone; 320px reflow below 1100px as today. - JS house rules:
editor-entry.jsis wiring only; every other module stays under 300 lines; each new module has a*.test.mjsrun bycd fixtures && node --test *.test.mjs. - The bundle is committed. After any
fixtures/change:cd fixtures && npm ci && node build-bundles.mjs, delete the oldinternal/slides/static/editor.<hash>.js, commit the new one. The gate rebuilds and diffs. - Gates. While iterating:
go test ./internal/slidestest/ -run <Test>and the one JS test. Before each commit:make ci. Once before handing off:./.amadan/ci.d/10-gate, thengo test -tags browser ./internal/slidestest/(outside the gate; Chromium needs its sandbox off). LeaveGOCACHEat its default; theGOCACHEline in earlier plans is superseded. - Shared machine. Scratch under
$TMPDIR; bind any server to127.0.0.1or100.119.180.57; stop what you start; nosudo. - Commits: subject under 80 characters, blank line, body; end with
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>.
Names every task shares
| Name | Meaning | |---|---| | --estilo-desk, --estilo-desk-ink | Desk ground and the muted ink on it. | | [estilo-card] | The floating surface: 12px radius, Docs' background, border and shadow. | | [estilo-inspector] | A card's inside: 13px type, a column of groups 14px apart, scrolls inside itself. | | [estilo-inspector-group], [estilo-inspector-label] | A labelled group and its label. | | [estilo-seg], [estilo-seg-item] | Segmented control and one segment (button, or label wrapping a radio). | | --estilo-inspector-inline-size (248px), --estilo-inspector-inset (12px) | The card's width and its gap from the desk's edges. | | [slides-editor][data-inspect="box\|notes\|slide"] | What the card shows. Server renders slide. | | <aside slides-inspector id="slides-inspector" data-state="open\|closed"> | The card. Replaces <details slides-inspector>. | | Cookie slides-inspector=open\|closed; Path=/; Max-Age=31536000; SameSite=Lax | The card's remembered state; absent means open. | | [slides-notes-pane][data-state="open\|closed"], [slides-notes-open], [slides-notes-close], [slides-notes-resize] | Notes card, the icon that opens it, its ×, its top edge. | | NOTES_KEY (exists), NOTES_HEIGHT_KEY = 'slides.editor.notes.height' | localStorage keys for notes open/closed and height in px. | | [slides-phone-screen], --slides-phone-scale | The 390×844 screen inside [slides-stage-phone] and its scale. |
Strings (proposal for copy review)
| Key (under slides.editor.) | English | Note | |---|---|---| | head.format | Format | Bar button. Replaces head.inspector; the View menu row keeps its own key, view.inspector. | | notes.title | Notes | Notes card heading. | | notes.close | Close notes | The ×. | | notes.open | Show notes | The icon, slide without notes. | | notes.open.has | Show notes (this slide has notes) | The icon, slide with notes. | | notes.resize | Resize notes | The top edge. Not in §8's list; needed for its accessible name. | | view.both.title | Both, side by side | Tooltip and name of the third icon; view.both stays for the menu. | | group.style, group.image, group.description, group.place, group.boxes, group.slide | Style, Image, Description, Place, Boxes, This slide | Group labels. Reuse an existing key instead wherever its English is identical (format.label is already "Text"; Alignment, On a phone and the Deck heading have keys). |
Removed: head.inspector, the inspector's summary title, inspector.empty, slide.notes.show (the View menu row reads view.notes).
Review Focus
- A window under 1100px, down to 320px, and a short one (1280×600). The card is in the flow under the stage, regrouped; Format still shows and hides it; no sideways scroll; at 1280×600 the card and notes scroll inside themselves. Pinned in B6 (
TestTidyNarrowAndShortWindows). - The selected box disappears (a collaborator deletes it, or this person undoes its creation). The card returns to the slide's options; it never shows an empty box. Pinned in B7 (
inspect.test.mjs,TestTidyCardSurvivesBoxRemoval). - An old preference, and cookies blocked. A
localStorageinspector preference from before is honoured once and moved to the cookie; with cookies blocked, Format still toggles for the session. Pinned in B6 (head.test.mjs). - A deck with no slides. The card shows the deck's options only, the notes icon is disabled, New slide is still pinned and works. Pinned in B7 (
TestTidyEmptyDeck). - Fonts still loading. The card, the notes card, its icon and the New slide pill are inert with the rest, and nothing moves when the fonts arrive. Pinned in B5 and B6 (assertions added beside
fonts_browser_test.go:746,982).
---
File map
| Path | Change | |---|---| | estilo desk/desk.go, desk/desk.css, desk/desk_test.go | New part. func CSS() []byte. | | go.mod, go.sum, internal/slides/render.go, templates/layout.html | Pin estilo; serve and link static/estilo/desk.css. | | internal/slides/static/desk.css, decks.css | Desk colour from the token; deck list ground. | | internal/slides/icons/icons.go | monitor, smartphone, monitor-smartphone, notebook-pen. | | internal/slides/templates/editor.html | Bar, strip foot, stage bar, notes card, inspector card. | | internal/slides/static/editor.css | Page grid, strip, switch, phone frame, notes, card. | | internal/slides/editor.go | inspectorState, editorStrings, the template's Inspector field. | | fixtures/inspect.mjs, notes-card.mjs, phone-frame.mjs (+ .test.mjs) | New modules. | | fixtures/head.mjs, format-bar.mjs, inspector.mjs, inspector-block.mjs, switcher.mjs, editor-entry.js | Changed as each task says. | | internal/slidestest/editor_tidy_test.go | HTML tests (in the gate). | | internal/slidestest/browser_editor_tidy_test.go (//go:build browser) | Browser tests (outside the gate). | | internal/slidestest/harness_test.go | deckWithSlides(t, a, cookies, n int) string. |
---
Part A: estilo
Task A1: The desk part
Files: Create desk/desk.go, desk/desk.css, desk/desk_test.go in the estilo worktree. Reference (read only): Docs internal/docs/views/show.html at Docs' origin/main (b45b7b2), the inspector rules near lines 1365-1420 and the --docs-desk declarations.
Interfaces:
- Produces: package
deskwithfunc CSS() []byte; the tokens and attributes in "Names every task shares".
- [ ] Step 1: Write the failing tests in
desk/desk_test.go, in the style ofmenu/menu_test.go:25(TestFloatsAreRoundedAndMenubarTitlesSquare):TestDeskTokensAreDefined(tokencheck.Undefined(CSS())is empty) andTestCardAndSegAreDocs, which assertsCSS()contains each of these literals, onet.Errorfper miss:
var pins = []string{
"--estilo-desk: light-dark(#e3e7ee, #0e1015)",
"--estilo-desk-ink: light-dark(#586070, #9aa1ad)",
"--estilo-inspector-inline-size: 248px",
"--estilo-inspector-inset: 12px",
"border-radius: 12px",
"padding: 12px",
"light-dark(rgb(255 255 255 / 0.92), rgb(32 35 43 / 0.92))",
"0 28px 56px -20px light-dark(rgb(23 32 60 / 0.28), rgb(0 0 0 / 0.7))",
"backdrop-filter: saturate(1.4) blur(14px)",
"font: 650 11px/14px",
"block-size: 28px",
"box-shadow: inset 0 0 0 1px color-mix(in oklab, currentColor 45%, transparent)",
"outline: 2px solid Highlight",
}- [ ] Step 2: Run
go test ./desk/— fails: package has noCSS. - [ ] Step 3: Write
desk.goanddesk.css. Copy Docs' values exactly, renamingdocs-inspector→estilo-card+estilo-inspector,docs-toolbar-group→estilo-inspector-group,docs-toolbar-label→estilo-inspector-label,docs-tool→estilo-seg-iteminside[estilo-seg]. Decisions the copy does not make: -[estilo-card]is the surface only (background, border, radius, shadow, the::beforebackdrop). It sets no position: the app places it. -[estilo-inspector]setsfont-size: 13px, a column withgap: 14px,overflow-y: auto,overscroll-behavior: contain, and[data-state="closed"] { display: none }. - A segment is selected when[aria-pressed="true"]or:has(input:checked), so one control serves toggles and radios. Focus ring on:focus-visibleand on:has(input:focus-visible). A segment is at least 28px tall and 24px wide. - A group with nothing showing is not shown:[estilo-inspector-group]:not(:has(> :not([estilo-inspector-label], [hidden]))) { display: none }. - Selects, text and number fields inside[estilo-inspector]take Docs' select rule (block-size: 28px; border: 1px solid var(--rst-line); border-radius: 8px; font-size: 13px; font-weight: 500). - Norst-selectors (internal/lint/prefix_test.gofails on them);rst-custom properties are read, aschrome.cssreads them. - A header comment names the Docs commit the values came from. - [ ] Step 4: Run
make test— passes, including the prefix lint. - [ ] Step 5: Commit (
desk: the floating card, its groups, the segmented control). Report "ready to push" and ask Paul before pushing and opening the estilo discussion. Part B may start on the pushed commit; it does not wait for the merge.
---
Part B: Slides
Task B1: Pin estilo, the desk colour, the deck list ground
Files: go.mod, go.sum, internal/slides/render.go:75-83, templates/layout.html, static/desk.css, static/decks.css:13-20, static/theme.css and the other files scripts/writeestilo rewrites; test internal/slidestest/editor_tidy_test.go.
Interfaces:
- Consumes: A1's pushed commit.
- Produces:
static/estilo/desk.cssserved and linked on every page that linkschrome.css;--slides-desknowvar(--estilo-desk).
- [ ] Step 1: Failing tests.
TestEditorTidyServesEstiloDesk:GET /static/estilo/desk.cssis 200 and contains--estilo-desk:; the editor page and the deck list each link it.TestEditorTidyDeskIsEstilos:static/desk.csscontainsvar(--estilo-desk)and not#ebe7e2;static/decks.csscontains nogradientinside thebody:has([slides-decks])rule. - [ ] Step 2: Run
go test ./internal/slidestest/ -run TestEditorTidy— fails. - [ ] Step 3: Implement.
go get amadan.net/oficina/estilo.git@<A1 commit>;go run ./scripts/writeestilo; adddesk.csstostaticFiles()and a<link>afterchrome.css;--slides-deskreads the token (keep its@propertyregistration, with initial value#e3e7ee); the deck list's ground isvar(--slides-desk). - [ ] Step 4: Run the two tests, then
go test ./internal/slides/ -run 'TestThemeIsEstilosForSlides|TestBusyFilesAreEstilos', thengo test -tags browser ./internal/slidestest/ -run 'Head|Bar|Menu'. The pin moves estilo from260f98cto head, which also brings the stacked-bar changes: fix what breaks in Slides' own header CSS (editor.css:152-395) and list every visible difference in the commit body. - [ ] Step 5: Commit (
Editor: estilo at head with the desk part; Docs' grey desk).
Task B2: The page never scrolls; the strip and the pinned New slide
Files: static/editor.css (root grid 38-46, desk 74-84 and 1285-1304, strip 455-500, 563-655, 1306-1321), templates/editor.html:317-355, harness_test.go, browser_editor_tidy_test.go.
Interfaces:
- Produces:
deckWithSlides(t, a, cookies, n)returning the editor path of a deck withnslides, the first carrying 400 words of notes;[slides-strip-foot], a non-scrolling foot of[slides-strip-nav]holding[slides-strip-add].
- [ ] Step 1: Failing browser tests.
TestTidyPageNeverScrolls: for a 40-slide deck at 1280×720 and at 1920×1080,document.documentElement.scrollHeight === window.innerHeightandscrollWidth === innerWidth. (B5 and B7 extend this test with notes open and a box selected.)TestTidyNewSlideStaysInView: with the strip scrolled to its top and to its end,[slides-strip-add]'s rect is inside the viewport and inside[slides-strip-nav]; clicking it adds a 41st slide; the layouts popover's bottom edge is at or above the pill's top edge. - [ ] Step 2: Run
go test -tags browser ./internal/slidestest/ -run TestTidy— fails. - [ ] Step 3: Implement. From 1100px:
[slides-editor] { block-size: 100dvh; overflow: hidden }, the desk rowminmax(0, 1fr), every panemin-block-size: 0;[slides-strip]is the only scroller in the strip (overflow-y: auto). Under 1100px the stacked column scrolls the page as today.[slides-strip-add]moves out of the<ol>into<div slides-strip-foot>; the button and[slides-layouts-toggle]render as one pill (shared border, a hairline between them, radius on the outer ends only);#slides-layoutsopens upward. The strip's ground is the bar's surface with a 1pxvar(--rst-line)on its desk edge. - [ ] Step 4: Run the two tests and
-run Strip(existing strip browser tests) — pass. - [ ] Step 5: Commit (
Editor: a page that never scrolls; New slide pinned to the strip).
Task B3: Icons and the view switch
Files: icons/icons.go, the credits inventory, templates/editor.html:357-381, static/editor.css:982-1016, fixtures/switcher.mjs (only if a selector changes), editor_tidy_test.go, browser_editor_tidy_test.go.
Interfaces:
- Produces: icons
monitor,smartphone,monitor-smartphone,notebook-pen;fieldset[slides-switcher][estilo-seg]whose threelabel[estilo-seg-item]each wrap a visually hiddeninput[type=radio][name="slides-view"]and an icon.
- [ ] Step 1: Failing tests.
TestEditorTidyViewSwitchIsThreeIconRadios: the editor HTML has exactly threename="slides-view"radios (desktop,phone,both), each inside anestilo-seg-itemlabel with anaria-labeland atitlefromview.desktop,view.phone,view.both.title, and each label contains<svg class="icon". Browser,TestTidyViewSwitch: clicking each icon, and ArrowRight from the first, lights exactly one and shows the frames it names (desktop: only[data-vp="desktop"]; phone: only[slides-stage-phone]; both: both); the View menu's three rows still do the same. - [ ] Step 2: Run — fails (icons missing; markup is text radios).
- [ ] Step 3: Implement. Add the four icons from lucide's current release and their credit lines. Restyle the fieldset with
[estilo-seg]; keep the<legend>visually hidden. No behaviour change inswitcher.mjs. - [ ] Step 4: Run both tests,
make ci(credits-check) — pass. - [ ] Step 5: Commit (
Editor: the view switch is three icons).
Task B4: The phone frame
Run the copy review of the strings table with Paul before this task.
Files: create fixtures/phone-frame.mjs, fixtures/phone-frame.test.mjs; templates/editor.html:388-393, static/editor.css:1020-1050, fixtures/editor-entry.js (wiring); browser_editor_tidy_test.go.
Interfaces:
- Produces:
mountPhoneFrame({ stagesEl }) → { destroy() }, which keeps--slides-phone-scaleon[slides-stage-phone]equal tomin(1, availableBlockSize / 844)through aResizeObserver;phoneScale(available: number): numberexported for the unit test.
- [ ] Step 1: Failing tests.
phone-frame.test.mjs:phoneScale(844) === 1,phoneScale(2000) === 1,phoneScale(422) === 0.5,phoneScale(0) === 0. Browser,TestTidyPhoneFrame, at 1280×720 in phone view and in both: the frame's rect haswidth / heightwithin 1% of390 / 844; its bottom is at or above the stage's bottom; the HTML inside[slides-phone-screen]equals what the stage showed in phone view before this task (capture the string frommaininto a testdata file first); a slide taller than 844px scrolls inside[slides-phone-screen]and not the page; the slide's offset from the screen's top equals its offset from the page's top in the viewer loaded at 390×844. - [ ] Step 2: Run — fails.
- [ ] Step 3: Implement.
[slides-stage-phone]is390 × 844px scaled by--slides-phone-scalefrom its top centre, with a 28px corner radius and the paper shadow the desktop frame has; its layout box is the scaled size so Both sits side by side without overlap.[slides-phone-screen]isinline-size: 390px; block-size: 844px; overflow-y: auto, on the viewer's page ground and with the viewer's phone placement (read both from the viewer's stylesheet; reuse its custom properties, do not copy values). The fetched phone HTML goes in the screen unchanged. - [ ] Step 4: Run both tests and
-run Phone(existingbrowser_phone_test.go) — pass. - [ ] Step 5: Rebuild the bundle; commit (
Editor: the phone view is a phone).
Task B5: Floating notes
Files: create fixtures/notes-card.mjs, fixtures/notes-card.test.mjs; templates/editor.html:357-397, static/editor.css:682-709, fixtures/editor-entry.js:79,563-573 (the notes code moves out; wiring stays), fixtures/head.mjs (View → notes calls the module), editor.go (editorStrings), en.toml; tests in both tidy files and beside fonts_browser_test.go:746.
Interfaces:
- Produces:
mountNotesCard({ root, storage = localStorage, hasNotes: () => boolean }) → { open(), close(), toggle(), isOpen(): boolean, refresh() }.refresh()re-readshasNotes()and updates the icon's dot (data-has-notes) andaria-label; editor-entry calls it on slide change and on every notes change.clampHeight(px: number, deskPx: number, lineHeightPx: number): numberexported. - Consumes:
NOTES_KEYsemantics as they are ineditor-entry.js:563-573today (same stored values).
- [ ] Step 1: Failing tests.
notes-card.test.mjs:open/close/togglesetdata-stateand writeNOTES_KEYwith today's values; a stored closed state mounts closed;clampHeightreturns at least two lines plus the head and at most half the desk;refresh()swaps the label betweennotes.openandnotes.open.hasand setsdata-has-notes; ArrowUp and ArrowDown on[slides-notes-resize]change the height by 16px, Home and End go to the limits, and each writesNOTES_HEIGHT_KEY. HTML,TestEditorTidyNotesMarkup:[slides-notes-pane]is inside[slides-stage-pane], carriesestilo-card, holds anh2(notes.title),button[slides-notes-close]witharia-label,[slides-notes-resize]withrole="separator",aria-orientation="horizontal",tabindex="0"andaria-label, and<div slides-notes(the line-358 assertion ineditor_test.gostays true);button[slides-notes-open]exists;name="slides-notes"andslides-notes-toggleare gone. Browser,TestTidyNotes: × closes; the icon and View → Show notes reopen; the dot shows exactly when the slide has notes, across a slide change and after deleting the notes' text; dragging the top edge resizes within the limits and the height survives a reload; with notes open the stage frame's bottom is at or above the notes card's top. ExtendTestTidyPageNeverScrollswith notes open on the 400-word slide. Font-wait: the notes card and its icon are inert while fonts load. - [ ] Step 2: Run — fails.
- [ ] Step 3: Implement. The notes card is the last child of
[slides-stage-pane], in the flow (so the stage gives up its height by layout, with no reserve arithmetic), inset 12px,[estilo-card], default height 144px, its body the only scroller. Closed, it isdisplay: noneand[slides-notes-open]shows at the pane's bottom start corner (position: absolute, 12px in, 32×32, iconnotebook-pen, a 6px accent dot whendata-has-notes).[slides-notes]keeps its attribute, its binding and its plugins untouched. Focus: closing by × moves focus to the icon; opening moves it into the notes. - [ ] Step 4: Run the new tests, then
-run 'Saving|SaveStatus|Leaving|Fonts'under-tags browserunchanged — pass. - [ ] Step 5: Rebuild the bundle; commit (
Editor: notes float at the foot of the desk).
Task B6: The inspector is a floating card, shown by Format
Files: templates/editor.html:203,166-171,400-713 (the wrapper and the button only; fields move in B8), editor.go, static/editor.css:785-967,1285-1304,1396-1460, fixtures/head.mjs, fixtures/head.test.mjs (new), en.toml; editor_test.go:212 (TestEditorInspectorMarkupIsFormsWithLabels slices from <aside slides-inspector), both tidy test files.
Interfaces:
- Produces:
func inspectorState(r *http.Request) string("open"unless the cookie saysclosed), rendered asdata-stateon the aside andaria-expandedon the button; the Format button<button estilo-bar-control slides-press data-view-toggle="inspector" aria-expanded aria-controls="slides-inspector">with iconpenciland visible texthead.format;mountHead(...)additionally returnsshowInspector(on: boolean, { focus = false } = {})andinspectorShown(): boolean. - Consumes: A1's
[estilo-card],[estilo-inspector].
- [ ] Step 1: Failing tests. HTML:
TestEditorTidyInspectorState(no cookie →data-state="open"andaria-expanded="true"; cookieslides-inspector=closed→closedandfalse; any other value → open); the aside hasestilo-card estilo-inspector, anaria-label, no<summary>and no element whose text is the old Inspector title; the Format button precedes Share.head.test.mjs: toggling writes the cookie string in "Names"; a storedlocalStorage['slides.editor.inspector']('on'or'off', ashead.mjs:42writes today) with no cookie is applied once, written to the cookie asopenorclosedand removed; the View menu's[data-view-toggle="inspector"]row keepsaria-pressedin step with the button'saria-expanded; whendocument.cookiecannot be written the toggle still flipsdata-stateandaria-expanded;showInspector(true, { focus: true })focuses the first focusable control in the card, and hiding it restores focus to the element focused before. Browser,TestTidyCardFloatsat 1280×720: the card's rect is inside the desk, 12px from its top and end edges, 248px wide; its bottom is at least 12px above the desk's bottom; with every Block group showing it scrolls inside itself; the desktop frame's right edge is left of the card's left edge while it shows, and the frame's centre moves to the desk's centre when it hides; no reload flash (the first paint with theclosedcookie has no card: screenshot before scripts run, with the bundle request blocked).TestTidyNarrowAndShortWindows(Review Focus 1): at 1000×800, 320×700 and 1280×600 as described there. - [ ] Step 2: Run — fails.
- [ ] Step 3: Implement.
<details>/<summary>become the aside. From 1100px the desk grid is"strip stage"only; the card isposition: absolutein[slides-desk]with the insets and size above andmax-block-size: calc(100% - 24px);[slides-editor]:has([slides-inspector][data-state="open"]) [slides-stage-pane]getspadding-inline-end: calc(var(--estilo-inspector-inline-size) + var(--estilo-inspector-inset) + 16px), which also keeps the notes card clear of it (§5). Under 1100px the aside is in the flow under the stage with no shadow.data-inspector-offgoes, and so doesaria-pressedon the bar button (the View menu's checkable row keeps it). One owner foraria-expanded: read estilo'schrome.js; if it handlesdata-estilo-toggle, add that attribute and lethead.mjsonly write the cookie and manage focus; otherwisehead.mjsdoes all three. The actions that force the inspector open today (head.mjs, the delete-ask handler) callshowInspector(true, { focus: true }). - [ ] Step 4: Run the new tests,
TestEditorInspectorMarkupIsFormsWithLabels, and the Fonts browser tests (the card is still[slides-inspector], so the inert list is unchanged; assert it) — pass. - [ ] Step 5: Rebuild the bundle; commit (
Editor: the inspector is a floating card, shown by Format).
Task B7: The card follows the selection
Files: create fixtures/inspect.mjs, fixtures/inspect.test.mjs; fixtures/format-bar.mjs, selection.mjs, inspector.mjs, inspector-block.mjs, editor-entry.js:765 and the selection wiring; templates/editor.html (root attribute); static/editor.css; both tidy test files.
Interfaces:
- Produces: -
mountInspect({ root, onChange = () => {} }) → { selection(ids: string[]), caret(where: 'stage' | 'notes'), reset(), current(): 'box' | 'notes' | 'slide' }. It writesroot.dataset.inspectand callsonChange(kind)only when the kind changes. Rules:selection(ids)with ids →box; with none →slideunless the current kind isnotes;caret('notes')→notes;caret('stage')leaves the kind toselection;reset()→slide. -mountFormatBar({ root, keys, onCaret = () => {} })andplugin(where = 'stage'); the bar callsonCaret(where)when a view carrying that plugin takes focus.editor-entry.jspassesplugin('notes')asnotesPlugins. - Consumes: B6's
showInspector;mountSelection'sonChange.
- [ ] Step 1: Failing tests.
inspect.test.mjs: the rules above, one case each, plus: ids then[]→slide(Review Focus 2);caret('notes')thenselection([])staysnotes; thenselection(['a'])→box;onChangenot called for a repeat. Browser:TestTidyCardFollowsSelection: for one box of each of the eleven kinds, clicking it setsdata-inspect="box"and the visible named controls in the card are exactly that kind's set (compare against thedata-typesattributes, read from the DOM); the caret in the notes →notesand only the marks show; clicking the desk, clicking a slide in the strip and Esc in a box →slideand the Slide, Boxes and Deck groups show; a second browser session selecting a box leaves the first session'sdata-inspectunchanged.TestTidyCardSurvivesBoxRemoval: session B deletes the box session A has selected → A's card shows the slide's options within one second.TestTidyEmptyDeck(Review Focus 4). - [ ] Step 2: Run — fails.
- [ ] Step 3: Implement. The server renders
data-inspect="slide". Which form shows is CSS ondata-inspectalone:box→ the block form;notes→ the block form with every child but the marks group hidden;slide→ the slide form then the deck form.inspector.mjsandinspector-block.mjsstop settinghiddenon the three forms and keep setting it on controls.selection.mjs'sonChangefeedsinspect.selection; a desk click and a strip click callreset(); Escape in the notes callsreset(). ExtendTestTidyPageNeverScrollswith a canvas shape selected. - [ ] Step 4: Run the new tests and the existing editor browser tests (
-run 'Editor|Presence|Modal') — pass. - [ ] Step 5: Rebuild the bundle; commit (
Editor: the card shows the selection's options and no others).
Task B8: The card's contents, regrouped
Files: templates/editor.html:357-381 (the marks leave the stage bar), 400-713 (regrouped); static/editor.css:969-977,1464-1504; fixtures/head.mjs, commands.mjs:58-70, inspector.mjs, editor-entry.js:939; en.toml, editor.go; editor_tidy_test.go, browser_editor_tidy_test.go.
Interfaces:
- Consumes:
data-inspect(B7),showInspector(B6),[estilo-inspector-group],[estilo-seg](A1). - Produces: inside the block form, in this order, groups named by
data-group:style,text,alignment,image,description,place,phone, then[slides-block-delete]; inside the slide form:[slides-confirm]first, thenslide,boxes; the deck form under a rule with one group,deck. Each group is<div estilo-inspector-group role="group" aria-labelledby="slides-g-<name>" data-group="<name>">with<span estilo-inspector-label id="slides-g-<name>">.
- [ ] Step 1: Write the "nothing is lost" test from
main, before touching the template.TestEditorTidyNothingIsLostholds a table{needle, section, group}built fromorigin/main'seditor.html: everyname="rst-deck-*",name="rst-slide-*",name="rst-block-*", everydata-commandin the three forms, the fivedata-markbuttons, the elevendata-add-block, the[slides-blocks-buttons]template,[slides-unused-assets],[slides-phone-badge],[slides-confirm]. It asserts each needle appears inside the aside, inside the form forsection, inside the group forgroup(per §4.2 and §4.3;rst-block-radiusunderimage,rst-block-citeunderstyle,block-move-upandblock-move-downunderplace). It asserts five commands are absent from the aside and present elsewhere:slide-move-up,slide-move-down,slide-add-after,duplicate-slide,slide-delete-askof which the Slide menu in[slides-menubar]still holdsduplicate-slide,slide-move-up,slide-move-down,slide-delete-askandnew-slide(adding), and the strip item template still holdsdata-slide-commandadd-after,duplicate,move-up,move-down,delete. It asserts[slides-stage-bar]containsslides-switcherand nodata-mark. Commit this test alone first, failing only on grouping. - [ ] Step 2: Failing browser tests.
TestTidyMarksInCard: with text selected in a box and in the notes, each of the five marks in the card toggles the mark, shows it pressed, is disabled where the pill was (a code block), and the shortcuts inKeys(editor.go:283-287: Mod+B, Mod+I, Mod+E, Mod+Shift+H, Mod+K) still work; clicking a mark does not move the caret out of the text.TestTidyKeyboardOnlyBox: on a canvas slide with one shape, using the keyboard alone, with the card showing and again starting with it hidden (View → Inspector): reach the Boxes list, choose the shape, change its fill, press Esc (the card returns to the slide's options and focus is on that box's list button), choose it again, Delete block.TestTidyDeleteSlideConfirmsInCard: with the card hidden, Slide → Delete slide and a strip menu's Delete each show the card on the slide's options with focus on the confirmation; Cancel hides nothing, deletes nothing and returns focus to the invoking control; Delete deletes. - [ ] Step 3: Run — fails.
- [ ] Step 4: Implement. Move the fields into the groups; no
name,data-prop,data-types,data-layoutor command changes.[slides-format]becomes thetextgroup's body (a[estilo-seg]of fivebutton[estilo-seg-item][data-mark], stillrole="toolbar"), somountFormatBar's one-bar lookup still finds it;shouldLetGotreats the whole card as the bar. Segmented controls replace radio rows where the choices are short (slide layout, alignment, image fit); selects stay selects.x,y,w,hsit two by two. The five slide commands leave the slide form; the Insert menu's[slides-inspector] [data-add-block]lookup still resolves. Escape inside the card withdata-inspect="box"clears the selection and focuses[data-select-block="<id>"]; choosing from the list focuses the first control of the box's options. - [ ] Step 5: Run steps 1 and 2,
TestEditorInspectorMarkupIsFormsWithLabels(still three forms, at least 30 labelled named controls, elevendata-add-block), and the whole browser suite once — pass. - [ ] Step 6: Rebuild the bundle; commit (
Editor: the card's fields regrouped; marks in the card; slide actions out).
Task B9: The bar's buttons, and the deck cover centred
Files: templates/editor.html:90-272, static/editor.css:152-395; for the cover, wherever the fault is: static/decks.css:140-156, templates/decks.html:40, or internal/slides/layout/layout.go:227,329-331 and regions.go:109 against static/slides.css:222-226; tests in the tidy files and, if the engine is at fault, internal/slides/layout.
Interfaces:
- Consumes: estilo's controls set at head (
chrome.css:495-550):[estilo-bar-control],~="primary".
- [ ] Step 1: Failing tests.
TestEditorTidyBarControls: in[slides-head-end], in order: save status,[slides-history](undo and redo in one pill), Format, Share, Present, switcher, account; Format and Share carryestilo-bar-control, Present carriesestilo-bar-control="primary". Browser,TestTidyCoverIsCentred: for a deck whose first slide is atitleslide with a heading only, fetch the tile's….svg?w=480, inline it, and assert the union of its text elements'getBBox()is centred in the frame within 2% on both axes; and the tile'simgrect is centred in[slides-cover]within 1px. - [ ] Step 2: Run — record which of the two cover assertions fails. Use superpowers:systematic-debugging; do not guess between the candidates.
- [ ] Step 3: Implement. Bar: swap Slides' own pill rules for estilo's controls set; delete the CSS that becomes dead. Cover: fix the layer the failing assertion names. If it is the layout engine, add a
layouttest for thetitletemplate with no body region first, then fixplace(), and regenerate only the golden files that case touches (list them in the commit body; the PDF and thumbnails change for those slides, which is the bug being fixed and not a rendering change this slice forbids). - [ ] Step 4: Run both tests,
go test ./internal/slides/layout/,-run 'Thumb|Export|Decks'— pass. - [ ] Step 5: Commit (
Editor: estilo's pills in the bar; a deck's cover is centred).
Task B10: Strings, dead code, the full gate, the handoff
Files: en.toml, editor.go:183, static/editor.css, AGENTS.md (only where it names the inspector, the pill or the notes switch), go.mod.
- [ ] Step 1: Failing tests.
TestEditorTidyStrings: every key in the approved strings table is inen.tomlandeditorStrings; no key ineditorStringsis unread byeditor.html; the removed keys are gone.TestEditorTidyNoDeadSelectors:editor.cssandfixtures/*.mjscontain none ofdata-inspector-off,slides-notes-toggle,slides-head-tool,details[slides-inspector]. - [ ] Step 2: Run — fails; fix; run — passes.
- [ ] Step 3: Full verification, once.
./.amadan/ci.d/10-gate;go test -tags browser ./internal/slidestest/;cd fixtures && node --test *.test.mjs. Paste the three summaries into the report as they are, failures included. - [ ] Step 4: The side-by-side screenshot (§7): the open card in Slides (a heading selected) and in Docs, at 1280×720, light and dark, into
$TMPDIR, for the discussion. - [ ] Step 5: Review. An Astra review of the whole branch against the spec's anti-goals (§0.3) and this plan's Review Focus; fix what it finds or record why not.
- [ ] Step 6: Commit; report "ready to push" for both branches and stop. On Paul's word: push estilo, open its discussion, squash-merge on green;
go get amadan.net/oficina/estilo.git@<merged commit>,go run ./scripts/writeestilo, re-run step 3, commit; then push Slides and open its discussion with the screenshot, the list of visible changes from B1, and §11's open questions. Clean up: scratch files, any server, both worktrees once merged.
---
Self-review
- Spec coverage. §2 page, strip, New slide → B2; bar → B6, B9; view switch → B3. §3 → B1 (ground), B9 (cover). §4 card, §4.4 → B6; §4.1 → B7; §4.2, §4.3, E10 → B8. §5 → B5. §6.1 → B4; §6.2 → B8 (the field moves, unchanged). §7 → A1, B10 step 4. §8's twelve tests → B2 (scroll, New slide), B8 (nothing lost, marks, keyboard, delete), B7 (selection), B5 (notes), B3 (switch), B4 (phone), B9 (cover), A1 (numbers).
- Calls this plan makes that the spec left open (§10): the card is 248px, as Docs'; notes default to 144px; the phone is 390×844 with a 28px radius, scaled to fit; the page stops scrolling from 1100px and the stacked column below that scrolls as today; the notes card sits in the flow of the stage pane; one extra string, Resize notes.
- Risk to watch. B1 moves estilo across every change between
260f98cand head, and B9 may change golden files if the cover fault is in the layout engine. Both are named in their tasks and reported in the discussion.