oficina / docs Public

Spec: Docs editor I2, revision 2 after Fable's review (#105)

One-shot link only in the fragment the popover shows (panel=1 303 and
Sec-Fetch-Dest); one undo/redo pair outside the toolbar, bound
separately, not roving; breakpoints aligned with estilo's 800px; the
estilo slot API as Bar.Menubar/Bar.Lead data; Format as aria-expanded,
default open, disabled without script; shim via estilo re-vendor; P3s
as implementation notes; measured values demoted to references.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev c03ac72267976b5333facbdefb61004404dfa713 parent a10811c
1 file changed, +74 −1
  • docs/superpowers/specs/2026-11-11-editor-i2-design.md +74 −1

CI passed — run details

diff --git a/docs/superpowers/specs/2026-11-11-editor-i2-design.md b/docs/superpowers/specs/2026-11-11-editor-i2-design.md
index 5bb7602..1fefee3 100644
--- a/docs/superpowers/specs/2026-11-11-editor-i2-design.md
+++ b/docs/superpowers/specs/2026-11-11-editor-i2-design.md
@@ -1,6 +1,6 @@
# Docs editor, layout I2: stacked header, floating inspector, share popover
-Status: draft for review (Claude Fable 5.1), 2026-11-11.
+Status: revision 2, 2026-11-11, after Claude Fable 5.1's review (oficina/docs #105: CHANGES REQUIRED). The section "Revision 2: decisions from the review" at the end overrides anything above it that it contradicts.
Branch: `design/richer-ui` (Docs) plus a new estilo branch, `bar-stack`.
Mock-up: `design/editor-looks`, local only (`../docs-editor-looks`, `brand/looks.js` and `looks.css`).
It is the reference for every measurement here and is never merged.
@@ -179,3 +179,76 @@ The shared pieces go to estilo once, so every app gets them; that is Paul's stat
- Sheets, Slides and other apps: they take the estilo pieces when they re-pin. Their own passes follow.
- The share email notification: offered, not yet asked for.
+
+## Revision 2: decisions from the review (#105)
+
+These override the sections above.
+
+### P1.1: the one-time link reaches the person who sees it
+
+- **Redirect:** a share POST sent from the popover carries `panel=1` (a hidden field). When it is present, the handler's 303 goes to `/d/{sqid}/share?panel=1`, not to the full page.
+ - So the render that calls `oneShots.take` is the fragment the popover shows.
+- **Rendering:** the fragment goes through `renderShare`, so it keeps the `Cache-Control: no-store` rule whenever it carries the URL. It uses a fragment template in place of the page.
+- **Direct navigation:** a request for `?panel=1` with `Sec-Fetch-Dest: document`, or with no `Sec-Fetch-*` at all, gets the full page.
+ - So a typed or reloaded URL is never a bare fragment, and a fetch never gets a page.
+- **Test:** after a publish from the popover, the URL appears in exactly one response body: the fragment. A following GET of the page or the fragment does not show it.
+
+### P1.2: one undo/redo pair, outside the toolbar
+
+- **Placement:** undo and redo leave `[docs-toolbar]` at every width. The strip loses its History group. There is one pair, in the bar's lead slot, visible at every width the editor is.
+ - The lead slot does not collapse into estilo's Menu sheet (see P1.3).
+- **Binding:** `fixtures/toolbar.mjs` binds the pair separately by `data-docs-command` under the bar's lead slot. They are bound and kept in `sync` like the rest, but are not in `setupRoving`'s controls: they are two ordinary tab stops.
+ - `fixtures/browser-drive.mjs` and every test that clicks the strip's undo move to the header pair.
+- **Inspector keyboard:** the inspector's `role="toolbar"` stays the one roving toolbar, with `aria-orientation="horizontal"`. Left and Right move as today.
+ - The vertical layout is visual only: its order is the reading order, so Left/Right still walk it.
+ - Up/Down are not claimed.
+
+### P1.3: breakpoints aligned with estilo's
+
+| Width | Lead slot (undo/redo) | Actions (Format, Share) | Formatting |
+|---|---|---|---|
+| 1024px and wider | visible | shown | inspector; Format toggles it |
+| 800–1023px | visible | Share only; Format is not rendered visible (no inspector to toggle) | today's strip under the header |
+| Below 800px | visible, before Menu | Share is a row in estilo's Menu sheet (estilo's existing rule) | today's strip |
+
+- **Share below 800px:** the popover script listens on every Share link in the bar, the sheet's row included. Below 36rem it opens as a full-width sheet.
+- **Format:** the toggle is an estilo action. Docs gives it `data-wide-only`, and estilo hides wide-only actions below 1024px in the bar and omits them from the sheet.
+
+### P2 decisions
+
+- **estilo slot API, as data:**
+ - `Bar.Menubar template.HTML` is rendered under the title and makes the bar `[estilo-bar~="stacked"]`.
+ - `Bar.Lead template.HTML` is rendered before the actions, at every width.
+ - Both are rendered by Docs from `views/` partials, so `TestOurTemplatesUseTheAttributeGrammar` and the markup tests still see them.
+ - In the stacked variant the bar's height is published as `--estilo-bar-block-size` (56px) through `:root:has([estilo-bar~="stacked"])`.
+ - No template redefinition.
+- **Title width:**
+ - The server renders the input with a `size` attribute derived from the title's length, as a first approximation that cannot shift layout by more than a few pixels. Script corrects it.
+ - It is capped at the space between the brand and the bar's end.
+ - A title longer than the cap scrolls inside the field, as today.
+- **Font wait:** the header pair and Format join `setInert`'s set (`editor-entry.js:521`), and `fonts_browser_test.go`'s inert checks extend to them.
+- **Busy rule in the popover:** the popover's script cancels each submit and does its own feedback. A request taking more than 500ms puts a spinner on the pressed control, mirroring the GET rule.
+ - It does not depend on Fiesta's busy.js.
+- **Shim:** estilo re-vendors rastrillo's current `ui.ShimJS()` (busy-less, with the switch drag) into `busy/rastrillo.js` with provenance, in the `bar-stack` branch or its own. Docs keeps taking it from estilo, and `TestBusyRuleIsLinkedAndServed` follows.
+- **Format toggle:**
+ - The cookie `docs-inspector` defaults to open.
+ - Without script, the button is rendered `disabled` and the inspector stays open, since a disabled control cannot claim to toggle.
+ - It uses `aria-expanded` and `aria-controls`, not `aria-pressed`: it shows and hides a region.
+
+### P3 notes for implementation
+
+- **Popover:**
+ - Position with logical insets, so RTL mirrors it.
+ - Use CSS anchor positioning where supported, with the script's placement as the fallback.
+ - On phones, use a modal `<dialog>` rather than a hand-made focus trap.
+ - Honour `defaultPrevented` after chrome.js's capture-phase Esc.
+- **Print:** the inspector and popover are hidden.
+- **Inspector light and back-lit hover:** under `(hover: hover)`, and with no transition under reduced motion.
+- **Sheet centring:** use the container's width (a container query unit or `100%` of the canvas), not `100vw`, which counts a classic scrollbar (show.html's own warning).
+- **Coarse pointers:** header controls and segments rise to 32px.
+- **Appearance:** if the background POST fails, the page stays switched for the visit and the selector says nothing. The next load shows the saved choice. Acceptable for a view preference; noted, not solved.
+- **Native wrappers** (`native/`) are unaffected: they render the same pages.
+
+### Reference values, not requirements
+
+The sub-pixel optical offsets, shadow strings, the glow-fade curve, glow percentages, icon drawings and the title-measuring technique above are the mock-up's values. They are references to match by screenshot comparison against `design/editor-looks`, not mechanisms to copy.