Spec: Docs editor layout I2 (stacked header, floating inspector, share popover)
Paul's choices from the layout mock-ups (design/editor-looks, local), with every measured value and ruling, and where each piece lives: estilo bar-stack for the shared header and account pieces, Docs for the inspector, Format toggle and share panel. For review before building.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+181
−0
docs/superpowers/specs/2026-11-11-editor-i2-design.md+181 −0
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| new file mode 100644 |
| index 0000000..5bb7602 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/2026-11-11-editor-i2-design.md |
| @@ -0,0 +1,181 @@ |
| +# Docs editor, layout I2: stacked header, floating inspector, share popover |
| + |
| +Status: draft for review (Claude Fable 5.1), 2026-11-11. |
| +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. |
| +It moves the chrome with script at load. The build must render it server-side. |
| + |
| +## Why |
| + |
| +Paul asked on 2026-11-07 for Docs to feel "rich, inviting, assertive", and "less Docs clone, definitely not Word clone". |
| +He then worked through five layouts and four riffs on one of them in the live mock-up, and chose I2. |
| +Every ruling quoted below is his, from that session. |
| + |
| +## What I2 is |
| + |
| +### Header: one 56px block |
| + |
| +- **Icon:** 32px, 12px from the inline start. The app name is dropped beside it. |
| +- **Title and menus:** stacked to the right of the icon. |
| + - The title row is 24px: 16px type, weight 600, letter-spacing -0.01em. |
| + - The menu row is 20px: 13px type, muted. |
| + - Both start on one edge at 56px (12px padding, 32px icon, 12px gap). |
| +- **Optical balance, measured at 2x in WebKit:** |
| + - The title's capitals start at the icon's top (11px). The title row sits 2.5px below its box. |
| + - The menu row sits low in the header (1px offset). Its 24px highlight pill stops 3px above the header's bottom edge. |
| + - An open menu's panel starts 1px above that edge, hanging from it. |
| + - Rulings: "the top of the menu should hug the bottom of the header", then "a smidge", then "1px up and 1px down". |
| +- **Menu bar:** |
| + - estilo's 32px minimum height is dropped. |
| + - Menu titles get `cursor: pointer`. |
| + - The highlight is a 24px pill, 6px radius, made by 2px negative block margins so it takes no room. |
| + - Panels have 28px rows, 13px type, muted shortcut keys, 4px padding and a 10px radius. |
| +- **Title field:** |
| + - As wide as its title, never full width ("It should grow according to the title, not start out full-width"). |
| + - Sized from the field's own `scrollWidth` at zero width, plus its end padding and border. `field-sizing: content`, a canvas and a mirror span all came up short in WebKit. |
| + - Re-measured on input, on resize, after load and on `document.fonts.ready`. |
| +- **Rename:** shown only while the title is being edited. It is a 22px accent-soft pill inside the title row, not estilo's 2rem button. |
| + |
| +### Header controls: one set |
| + |
| +- **Sizing:** all 28px tall, pill-shaped, 13px type at weight 600, 8px apart. |
| +- **Order:** undo/redo, Format, Share, then a divider, then the avatar. |
| +- **Undo/redo:** one grey pill holding two 24px icon buttons, with a hairline between them. |
| + - It is lit from the top: a gradient, a 1px inner highlight and a contact shadow. |
| + - A hovered button lifts within it. |
| + - These are the editor's own undo/redo buttons, so they need the toolbar's command binding (below). |
| +- **Format:** a quiet pill that toggles the inspector. |
| + - It is accent-soft with accent text while the inspector is open. |
| + - It has `aria-pressed` and a pencil icon. |
| +- **Share:** the one filled pill, the page's main action. |
| + - It has a 1px top highlight and an accent-tinted shadow (`0 5px 12px -5px`), the index's New document at header scale. |
| +- **Avatar:** a 28px circle and nothing else ("It should just highlight the circle"). |
| + - Hover darkens the circle. While its menu is open it gets a 2px ring. |
| +- **Divider before the avatar:** |
| + - A 1px line, 20px tall, with 12px either side. |
| + - Only when actions precede it: there is none on the index ("We don't need the divider if there are no other header buttons"). |
| +- **Depth:** everything follows the index's treatment ("should they get something of the 3D / highlight treatment"). |
| + |
| +### Inspector, replacing the formatting bar on wide screens |
| + |
| +- **Panel:** |
| + - 248px wide, floating 12px below the header and 12px from the inline end. |
| + - 12px radius, glass background (backdrop blur), 12px padding. |
| + - Its sections sit 14px apart. Section labels are 11px, weight 650, muted. |
| +- **Sections:** |
| + - **Style:** the paragraph style picker full width, then font and size on one row (size column 64px). |
| + - **Text:** bold, italic and code. |
| + - **Alignment:** left, centre and right. |
| + - **Lists:** bulleted, numbered and quote. |
| + - Text, Alignment and Lists are joined segmented rows of 28px buttons. Undo/redo moved to the header ("History buttons probably should stay in the main header"). |
| +- **Light:** |
| + - It is a rastrillo card, lit by `light.js`: a rim and wash near the pointer. |
| + - The glow is drawn from a reshaped `--rst-card-lit`, `max(0, lit × 1.43 − 0.43)`, so it disappears about 0.5s after the pointer leaves, not about 2s ("taking slightly too long"). |
| + - The rim is accent 70% mixed into the line colour (30% in dark). The wash is accent 9% (4% in dark). |
| +- **Back-lit hover:** a hovered control brightens to the surface with an accent halo: |
| + - `0 0 0 1px accent 22%, 0 0 12px 1px accent 26%`, lower in dark. |
| + - It sits above its segment neighbours. |
| + - Ruling: "need a sort of back-light hover state to compensate for the background glow". |
| +- **Format toggle:** |
| + - The open/closed state persists in a cookie and is rendered server-side. |
| + - First paint is already right. No flash, the same rule `docs-view` follows. |
| +- **The sheet stays centred unless the inspector needs the room:** |
| + - `padding-inline-end: max(16px, 16px + 816px + 2R − 100vw)`, where R is the inspector width plus 12px margin plus a 16px gap. Measured at 1800px, 1440px and 1280px. |
| + - Ruling: "the inspector shouldn't push the sheet to the left unless there's not enough space". |
| + - With the inspector closed, the sheet is plainly centred. |
| +- **Below 64rem:** no inspector. The existing toolbar strip and its phone rules stand, with undo/redo back in the strip, because the header controls collapse there. |
| + |
| +### Share as a popover |
| + |
| +- **Opening:** Share… opens a popover anchored under its button (`top`: header bottom + 6px; `right`: the button's end), 420px wide. |
| + - No-JS fallback: the share page as it is now. |
| +- **Contents, composed server-side as a fragment of the share page** (a new GET variant, for example `/d/{sqid}/share?panel=1`, rendering only the panel): |
| + - **Head:** "Share “title”" and a close button. |
| + - **Invite row:** one rounded field holding the email input ("Add people by email"), a compact Can read / Can edit select and an Invite button. |
| + - **People with access:** the owner first ("(you)", Owner), then each grant with an initial avatar, its access, and an × to remove it. |
| + - **General access:** two rows with an icon, a one-line state and a rastrillo `rst-switch`. The switches are real checkboxes: click, drag (rastrillo.js) or Space. |
| + - **Your team:** private or team. |
| + - **Anyone with the link:** published or not. When just published it shows the one-time URL, a Copy link button and "Copy it now: the link is shown only this once". Later it offers "Make a new link". |
| + - **Errors:** a negative callout under the head. Only the page's own error; the link's once-only warning lives with the link. |
| +- **Actions:** every one posts to the existing endpoints with fetch, and the panel is redrawn from the fragment the 303 lands on. |
| +- **Dismissal:** |
| + - The popover is `manual`, with its own dismissal: a pointerdown outside it closes it, except on Share. |
| + - Share while open does nothing ("should do nothing. It's causing a flash"). |
| + - Esc closes it and returns focus to Share. |
| +- **Phones:** below 36rem it is a full-width sheet from the top, with focus kept inside it. |
| +- Owners only, as the share page is. |
| + |
| +### Appearance: three-way selector, switched in place |
| + |
| +- **In estilo's account menu:** Light, Dark and System as three equal segments in one well, an icon (sun, moon, display) over each word. The current one is raised (surface, or #2f333d in dark), with an accent icon. |
| +- **Switching:** |
| + - The page switches at once (`data-theme`, as `chrome.ThemeAttr` writes it) and saves the choice by POSTing `/appearance` in the background. |
| + - No busy spinner, no reload ("They're not doing an action ... they should just switch immediately"). |
| + - Without script, the form posts and redirects as now. |
| + |
| +### Dark mode |
| + |
| +Every glow is far fainter in dark ("a lot more subtle"). Landed on the branch: 489163a. The inspector, halo and Share values above follow it. |
| + |
| +## Where each piece lives |
| + |
| +The shared pieces go to estilo once, so every app gets them; that is Paul's stated direction. |
| + |
| +**estilo, branch `bar-stack`:** |
| +1. `chrome.Bar` gains a stacked variant: a template slot under the title for the app's menu bar. |
| + - Docs passes its menubar markup, rendered by `estilo-menubar` from Docs' `menuView` as now. |
| + - When the slot is filled, the bar draws the 56px stacked header above; otherwise the one-row bar is unchanged. |
| + - The 52px public `--estilo-bar-block-size` becomes 56px in the stacked variant, and is published as such. |
| +2. Bar actions accept an app-rendered leading slot (the undo/redo pill). Docs fills it with its `data-docs-command` buttons, which the editor's toolbar plugin must bind (below). |
| +3. The controls-set styling, the avatar circle highlight and the conditional divider. |
| +4. Menu bar title pointer cursor, the highlight pill, and the tighter menu panel inside the stacked bar. |
| +5. The title field's sizing script (in `chrome.js`) and the compact Rename. |
| +6. Appearance as the segmented selector, switched in place (`chrome.js`), with the form marked `data-busy="false"`. |
| +7. Upstream note, not this branch: rastrillo's `scheme-menu` could take the same selector. |
| + |
| +**Docs, on `design/richer-ui`:** |
| +1. Pin the estilo `bar-stack` branch. Pass the menubar into the bar's slot and the undo/redo buttons into the actions slot. |
| +2. **Toolbar binding:** `fixtures/toolbar.mjs` binds buttons found under `[docs-toolbar]` at mount. |
| + - It must also bind the header's undo/redo, by `data-docs-command` under the bar's slot, and keep them in `sync`. |
| + - The roving tab stop covers only the inspector or strip, not the header pair. |
| +3. **Inspector markup** in `show.html`: an `<aside>` holding the toolbar's groups as labelled sections, each section a `role="group"` with an accessible name. |
| + - The groups stay inside one `role="toolbar"` so the existing plugin, roving focus and tests bind unchanged. |
| + - The strip toolbar and the inspector are the same element, laid out by width: a column in the aside at 64rem and above, the strip below. |
| +4. Format toggle: a cookie (`docs-inspector`), server-rendered state, and the pressed button state. |
| +5. The share panel fragment route and template, the popover script (a new bundle or brand script; no inline script, under the CSP), and the share page unchanged for no-JS. |
| +6. The sheet centring rule and the inspector's light and back-lit hover (`brand/light.css`, `show.html`). |
| +7. Serve rastrillo's current `ui.ShimJS()` in place of estilo's older `busy.ShimJS()`. It is busy-less too and adds the switch drag the share switches need. |
| + - Check first that nothing in Docs depends on the old shim's behaviour. |
| + - Better: estilo re-vendors the shim from Fiesta 1.3.0's rastrillo, and Docs keeps taking it from estilo. |
| + |
| +## Constraints that already bind, and how I2 meets them |
| + |
| +- **No layout shift on load.** The inspector and the strip are server-rendered at their final size. The Format state is server-rendered. The title width is set before first paint where possible (initial width from the server's measurement is not possible, so the field starts at `max-content` via CSS and the script corrects by a few pixels at most). |
| + - `TestFontTheFirstRevealIsTheFinalLayout` and the CLS checks must stay green. |
| +- **Never FOUT** (Paul, 2026-10-24). The header and inspector use the system UI face. The style list's previews use the chrome face, already landed. |
| +- **SC 1.4.10 at 320px.** Below 64rem nothing changes from today. The popover becomes a sheet. |
| +- **Touch targets.** Header controls are 28px and segmented buttons 28px: above 24px. |
| +- **Keyboard and accessibility:** |
| + - The popover gives focus to the email field on open, Esc returns focus, and Tab stays inside it on phones. |
| + - Switches are checkboxes with names. |
| + - Appearance buttons keep `aria-pressed`. |
| + - The Format toggle has `aria-pressed` and `aria-controls` on the aside. |
| +- **Busy rule:** POST actions keep the 650ms hold. Appearance and Format are view switches with no request held. Share's fetches carry no busy spinner unless slow, which is the GET rule's shape (landing in Fiesta 1.3.0). |
| + |
| +## Tests |
| + |
| +- **Go:** the stacked bar renders the slot and keeps the one-row bar when empty (estilo); the share fragment route is owner-only and 404s for others, as the page does; the Format cookie is rendered (Docs). |
| +- **Browser (Chromium and WebKit):** |
| + - header measurements: the edges at 56px and the 28px controls; |
| + - the inspector at 64rem and above versus the strip below; |
| + - sheet centring at three widths; |
| + - popover: open, invite, both switches, remove, Share-while-open does nothing, Esc; |
| + - Appearance switches in place with no navigation; |
| + - undo/redo from the header stay current (130eeeb); |
| + - the existing toolbar, font and zoom suites. |
| + |
| +## Out of scope |
| + |
| +- 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. |