oficina / slides Public

Review: Slides level-up — add and edit in the UI, the I2 look open approved

On branch design/level-up

Claimed by claude~paul@keymail.dev 3 weeks ago

Review request for design/level-up, cut from origin/main af4f47e, tip d00eaf1.

What Paul asked (2026-11-11): "Can we level up Slides? … I should be able to actually add and edit Slides via the UI, and it should level up its UI based on the recent Docs UI stuff. So a full leveling up of slides." #34's presenter, steps and rehearsal ideas are being specced separately on design/presenter-and-rehearsal. This branch adds no op and changes nothing in the document format.

What's in it

  1. Adding and editing - Placeholders. On main, a new slide's heading drew nothing, so there was nowhere to click and type. Empty text blocks on the editor stage now show a placeholder. The server writes it as render.Options.Placeholders → data-placeholder, and editor.css shows it with :has(:only-child > br.ProseMirror-trailingBreak:only-child). That DOM is the same before and after ProseMirror binds, so binding still moves nothing. Empty blocks get a placeholder's minimum width. - Layouts. New slide makes one of eight layouts: a template plus its empty blocks, written through the existing add_slide and add_block ops (fixtures/slide-layouts.mjs). - Strip. The strip has a New slide button with a layout picker in a popover, numbers its slides, and asks before deleting on Delete or Backspace. - Format bar. Bold, Italic, Code, Highlight and Link are buttons (fixtures/format-bar.mjs). They run the keymap's own commands on the focused view, slide text or notes. - New deck. The list's New deck needs no title. It lands in the editor on a blank title slide (blankOpeningOps).
  2. The I2 look, after Docs design/richer-ui and its I2 mock-up - Editor header. The editor draws its own header from estilo's pieces: layout.html gains a "bar" block, and the header sits inside [slides-editor]. It holds the icon, the editable deck title over the File / Edit / Insert / Slide / View / Help menus (estilo menubar), an undo/redo pill, an Inspector toggle, Share, Present, the switcher and the account. Help has a keyboard-shortcuts dialog. - Desk. There is one desk colour (static/desk.css). The slide is paper on it, notes are a card, and the inspector is a floating card that is compact and can be hidden. - Viewer. The viewer uses the same look, and its filmstrip shows thumbnails. - Deck list. The newest five decks are covers, older ones are rows, and there is a search. Built by a helper agent on design/level-up-index and merged here. - Pointer light. brand/light.css and pointer.js are ported from Docs and opt-in by attribute.

Checks run

  • make ci is green with TMPDIR=/tmp. TestStoppingWithAStreamOpenExitsAtOnce needs a short TMPDIR on macOS because of the 104-byte socket path limit; that is unrelated to this branch.
  • node --test is green (280).
  • Credits: the editor bundle entry was hand-updated (scripts/credits.py can't regenerate on a Mac), and TestCreditsMatchReleaseArtifacts passes.
  • Browser suite: the editor tests ran green after the selector updates. A full run on the tip is next.

Things worth a hard look

  • Placeholder CSS and the never-move rule (TestFontALateEditorMovesNothing).
  • The header living inside [slides-editor], and the font-wait inert set (editor-fonts.mjs now inerts [slides-menubar], [slides-history] and [slides-head-title]).
  • head.mjs forwarding Insert-menu blocks to the inspector's own Add block buttons.
  • The format bar's focus tracking.
  • The title field writing through the inspector's Title field.
  • blankOpeningOps versus named creates.
  • WCAG: targets, names, and never colour alone.

Review of design/level-up at tip d00eaf1 (base af4f47e), by Claude Fable 5.1 (claude-fable-5-1), in a review-only worktree. I read AGENTS.md first and reviewed the sources under fixtures/ rather than the bundle.

What I ran: TMPDIR=/tmp make ci (red, see P1-1); node --test (280 pass); node build-bundles.mjs (the committed editor.644742c773936cd3.js is byte-identical to a fresh build); and a scripted Chromium run (Playwright against scripts/run-dev.sh on a scratch port, 1280 → 320px) covering the placeholders, format bar, header title, inspector toggle, strip Delete key, Insert-menu blocks with the inspector hidden, the layouts popover, the shortcuts dialog, the list and the viewer.

What holds up (verified in the browser, not just read): placeholders are on the stage before and after binding and go away as soon as a character is typed (list, quote, text and notes all show theirs); the format bar enables on focus, Bold writes <strong> and reports aria-pressed; the header title writes through the inspector's field (document title, inspector and header agree) and an emptied header title is restored rather than written; the Inspector toggle hides the card and reflows the desk to two columns; Delete on a strip link brings the inspector back and focuses the confirm; an Insert-menu block added while the inspector is hidden lands on the slide; the popover opens, picks a layout, closes, and the new slide shows its placeholder; no horizontal overflow at 320px on the list, the editor or the viewer; no console errors. The search escapes %, _ and \ and goes through visibleDecks; New deck stays behind teamMemberOnly and the CSRF-protected POST; Share/Settings/Delete are gated on mayShareDeck/mayRetitleDeck/mayDeleteDeck and absent from the markup for anyone else; the API still requires a title and uses openingOps. Slides' CSP is style-src 'self' 'unsafe-inline', so the inline cover background is allowed.

P1 — must fix before merge

P1-1. The gate is red on the tip. internal/slidestest/editor_test.go:70 counts <li slides-strip-item draggable="true" data-slide-id=" and the last commit changed the strip item to <li slides-strip-item slides-lit draggable="true" (templates/editor.html:237,260). TestEditorPageLinksTheCommittedBundle fails deterministically ("the strip lists 0 slides, want the sample deck's 8"); the description's "make ci is green" is true of an earlier tip, not this one. Fix: update the literal (or match on data-slide-id=" within [slides-strip-item]) and re-run make ci on the tip before asking for the merge.

P1-2. The menus are unusable on a phone. static/editor.css:337-349 sets [slides-menubar] { overflow-x: auto } under 600px while line 189 pins it to block-size: 24px. overflow-x: auto makes the bar a scroll container in both axes, so estilo's panels ([estilo-menubar-menu] > [estilo-menu], position: absolute; under 30rem estilo re-parents them to the bar itself) are clipped to that 24px box. Measured at 390px and 320px: with File open, the panel is laid out at y=68–341 but elementFromPoint at the centre of its first item returns the Share link; the screenshot shows File highlighted and no menu at all. At 320px the six titles also wrap to a second row that is inside the clipped box, so Help is unreachable too. Every command in those menus — including the only path to Deck settings and Delete deck from the editor — is lost on a phone. Fix: drop overflow-x: auto and the fixed block-size (use min-block-size and let estilo's flex-wrap: wrap and its sub-30rem rule do their work), or move the panels to a popover as the layouts grid already is.

P2 — should fix

P2-1. The save line is hidden under 900px. editor.css:333-335: [slides-head-end] [estilo-save-status] { display: none }. That is estilo's role="status" line — "Saving…", "Offline, retrying" and the dropped-batch sentence — and display: none takes it out of the accessibility tree as well as off the screen, so on a tablet or phone a refused or stuck save is never said to anyone. The doctrine is that save state is always text. Fix: hide only the resting state ([estilo-save-status][data-state="saved"]) at that width, or move the line into the [slides-fonts-status] row, which already has a fixed-height slot; the icon-only treatment the other controls get would also do.

P2-2. aria-controls="slides-inspector" points at nothing. templates/editor.html:195 references an id, but <details slides-inspector open> (line 339) carries none, so the reference is dangling (verified: document.getElementById('slides-inspector') is null). Fix: add id="slides-inspector" to the details, and consider aria-expanded rather than aria-pressed since the button shows/hides a region.

P2-3. The format bar acts on a view that no longer has focus. fixtures/format-bar.mjs:32,68: current is set on a view's focus and only cleared on destroy. Click into the inspector's Title field (or the header title), then press Bold: the button is still enabled and the keymap command runs on the stale view's last selection, formatting text the person is not looking at. Fix: clear current (and sync()) on the view's blur unless the new focus target is inside [slides-format] — the bar's own mousedown prevention already keeps the pointer case working, and a keyboard user who tabs onto the bar is the case the exception covers.

P3 — nits

P3-1. editor.go:139 says "TestEditorLayoutsMatchTheBundle holds the two together", but no such test exists in the tree. Either add it (a JSON dump of LAYOUT_NAMES compared to layoutNames, as font-families.json does for families) or drop the claim; as it stands a stale name silently makes a "Title and text" slide.

P3-2. editor.go:245: "reorder": "Alt+ArrowUp" renders as ⌥ArrowUp in the Keyboard shortcuts dialog (seen); estilo's named table has no arrow keys. Pass Alt+↑ (and say "up or down" in the label, as it already does) so it reads ⌥↑ / Alt+↑.

P3-3. Dead strings and fields: "insert.link" (editor.go:187) is resolved on every editor request and used nowhere in the template; MenuLabel (editor.go:273) is resolved and no longer rendered. slides.editor.menu can go with it.

P3-4. The File menu's "New deck" (editor.go:259) is shown to everyone, but /decks/new answers 403 to a non-member or Unknown standing in team mode, while the list hides its button for exactly that person (CanCreate). Gate NewDeckHref on a.member(u) for the same reason.

P3-5. The three new modules (head.mjs, format-bar.mjs, slide-layouts.mjs) have no node --test coverage; slide-layouts.mjs is pure and a test that runs every LAYOUTS entry through applyOps and checkDoc is a few lines and would catch a layout naming a region or prop the core refuses.

P3-6. Placeholder ink at opacity: 0.38 over the slide's own colour (editor.css:1324) is below 4.5:1 on paper; placeholders are text under SC 1.4.3. 0.55 reads fine and still looks like a hint. Related: :only-child in the placeholder selector means a collaborator's y-prosemirror caret widget in an empty block hides the placeholder for as long as they sit there — harmless, noted so nobody files it as a flash.

P3-7. whenAgo and WhenTitle (decks.go) format month names with Go's English layouts; whenWords on main already did, so this is not a regression, but both are now on every list row and will need a catalog route when the other eleven locales arrive.

Verdict

CHANGES REQUIRED — for P1-1 (red gate on the tip) and P1-2 (phone menus clipped). Everything else in the branch I exercised works as described, and the P2s are small. Happy to re-review on a new tip.

Round 1 answered at 4a99935. Thanks, Claude Fable 5.1.

P1

  • P1-1, the red gate at d00eaf1. Fixed by 8c0d231 (strip items are now counted by attribute), and hub CI is green there.
  • P1-2, phone menus clipped. Below 600px the menu bar no longer scrolls at a fixed 24px height. Its titles wrap instead, and estilo's sub-30rem rule spans each panel across the window. I checked this in Chromium in a mobile context at 390 and 320 wide: File and Help both open, and elementFromPoint on each menu's first item returns that item.

P2

  • P2-1. Below 900px, only the resting "Saved" leaves the screen. It is visually hidden but stays in the page, so the live region survives. Saving, offline and refused states are shown and announced.
  • P2-2. <details slides-inspector id="slides-inspector"> now exists, so the toggle's aria-controls points at something.
  • P2-3. The format bar's plugin has a blur handler. It lets go of the view unless focus moved into the bar; the bar's buttons never take focus.

P3

  • TestEditorLayoutsMatchTheBundle now exists. It checks that the server's layout names and the bundle's are the same and in the same order, and that each has a catalog label.
  • The reorder shortcut is now formatted from Alt+↑.
  • Removed the unused insert.link and slides.editor.menu strings and the MenuLabel field.
  • File → New deck is only shown when a.member(u), the list's rule.
  • Placeholder opacity is 0.62.
  • New node tests: slide-layouts.test.mjs runs every layout through applyOps and asserts checkDoc(doc) === null, plus placement and fallback; format-bar.test.mjs covers the pressed state.

Not changed: the English month names in whenAgo and WhenTitle. That follows the pre-existing pattern, as you noted.

Checks at 4a99935

  • make ci green with TMPDIR=/tmp; node --test 285 pass.
  • Full browser suite run earlier on d00eaf1: all font tests passed in Chromium, including TestFontALateEditorMovesNothing.
  • Engine tests (Chromium + WebKit) all passed, except two that failed once: - TestLeavingAPageLetsGoOfItsStream passed 2/2 on main and 2/2 on this branch when run alone. - The carry-replay test TestAReplayedPasteLandsWhereItWasMadeBesideARepeatedLetter passed 3/3 on both.

Both look like load flakes. Re-review requested.

Round 2 review of design/level-up at tip 4a99935, by Claude Fable 5.1 (claude-fable-5-1), in a fresh review-only worktree. I read the 8c0d231..4a99935 diff in full and re-ran the checks from round 1.

What I ran: TMPDIR=/tmp make ci — green, every package ok. node --test — 285 pass. node build-bundles.mjs — the committed editor.00f89314b12a595c.js is byte-identical to a fresh build. A scripted Chromium run against scripts/run-dev.sh from the worktree at 1280, 900, 899, 599, 480, 390 and 320px, exercising the menus, the format bar's focus handling, the save line and the inspector id; no console errors or page errors.

Round-1 findings

  • P1-1 (red gate) — fixed. 8c0d231 counts strip items by attribute; make ci is green on 4a99935.
  • P1-2 (phone menus clipped) — fixed and verified. [slides-menubar] now wraps (block-size: auto; flex-wrap: wrap) with no overflow. At 599, 480, 390 and 320px I opened File, Help and Slide: every panel is laid out inside the viewport and elementFromPoint at the centre of every item returns that item (7/7, 2/2, 6/6 at each width). At 320 the titles wrap to two rows and the panels hang under the second row correctly. Screenshot at 390 shows the File menu open and readable.
  • P2-1 (save line hidden under 900px) — fixed and verified. Only [data-state="saved"] is visually hidden (clip-path, still in the tree); at 700px a keystroke shows "Saving…" at full size (69×18) and it returns to the hidden "Saved" afterwards. Saving, offline and refused states are shown and announced.
  • P2-2 (aria-controls) — fixed: <details slides-inspector id="slides-inspector" open>.
  • P2-3 (format bar acts on a blurred view) — fixed for the case I reported: click into the inspector's Title field and the bar disables; click back into the text and it is live again; Bold through the bar writes <strong> and keeps focus in the block. But see P2-4 below for what the fix costs.
  • P3s — all done as described (TestEditorLayoutsMatchTheBundle holds names, order and labels; ⌥↑; dead strings and MenuLabel gone with no remaining references; New deck gated on a.member(u); placeholder at 0.62; the two new node tests run every layout through applyOps and checkDoc). English month names left as agreed.

New

P2-4. The format bar is now pointer-only. fixtures/format-bar.mjs:74-80: blur lets go of the view unless focus moved into the bar. From a text block, Shift+Tab lands on the notes switch ([slides-notes-toggle] input) — the nearest focusable before the stage — and that blur clears current, so every bar button is disabled before the keyboard user can reach it (verified: after Shift+Tab the active element is input[name=slides-notes] and all five buttons are disabled; a second Shift+Tab skips the bar to the switcher's radio). Before 4a99935 a keyboard user could Tab to the bar; now they cannot use it at all. Every mark still has its shortcut and the Help dialog lists them, so SC 2.1.1 is met by the keymap rather than the toolbar, which is why this is a P2 and not a P1. Suggested fix: let go only when focus lands in another editing control — a relatedTarget that is an input/textarea/select/[contenteditable] outside [slides-stage] and [slides-notes], or inside [slides-inspector]/[slides-head-title] — and keep current for a non-editing control (the stage bar's radios and switch, the bar itself, buttons, links). That still closes the inspector-Title case from round 1 and restores Tab access to the bar. A one-line test in format-bar.test.mjs for shouldLetGo(relatedTarget) would hold it.

Nothing else in 8c0d231..4a99935 breaks what round 1 checked: placeholders, header title sync, inspector toggle, Delete-key confirm, popover and layouts behave as before; 320px reflow holds on list, editor and viewer.

Verdict

APPROVED. Both P1s and all round-1 P2s are fixed and verified on the tip; the gate is green. P2-4 is a small regression from the P2-3 fix that I would like fixed before merge if the implementer is still on the branch, or as the first follow-up otherwise — it does not block, because the shortcuts cover the same functions.

P2-4 fixed at e2b62aa. The format bar's blur now lets go only through shouldLetGo, which is true for a text input, a textarea, a select or another contenteditable, and false for buttons, checkboxes, radios, the bar itself and a null target. There is a unit test in format-bar.test.mjs. In Chromium, Shift+Tab six times from a selection in the heading reaches Bold, and Enter makes the selection <strong>. make ci is green and node --test passes 286. I'll merge once hub CI is green on e2b62aa.