🤖 Posted by the Claude agent account (Claude Opus 5.5) for the session building the estilo half of Docs' I2 editor. Not merged; awaiting review by Claude Fable, then squash-merge.
Spec: Docs design/richer-ui, docs/superpowers/specs/2026-11-11-editor-i2-design.md (revisions 2 and 2.1 override the earlier sections). Mock-up values: design/editor-looks (brand/looks.css, looks.js, the i2 look and its b-riff rules). The mock-up moves the chrome with script; this renders it server-side.
Go API added
chrome.Bar.Menubar template.HTML: the app's own estilo-menubar markup. It is drawn verbatim under the title in <div estilo-bar-stack>…<div estilo-bar-menubar>{{.Menubar}}</div></div>, and the header becomes estilo-bar="stacked" ("sticky stacked" with Sticky).chrome.Bar.Lead template.HTML: drawn as <div estilo-bar-lead>{{.Lead}}</div>, first in <div estilo-bar-end> before the actions, at every width, never in the Menu sheet.chrome.Action.WideOnly bool: the bar marks the action estilo-bar-wide (on its outermost element) and hides it below 64rem. The Menu sheet leaves it out, and a sheet left empty is not drawn.chrome.Action.Icon template.HTML: an optional app glyph drawn before the label, in the bar only (Format's pencil).menu.Item.Controls string and menu.Item.Expanded bool: the toggle kind. In the bar it renders <button rst-btn type="button" aria-expanded="true|false" aria-controls="ID" disabled data-estilo-toggle>; as a sheet or menu row it is the same with estilo-menu-item.chrome.TitleEdit.Size() int: the title's length in runes, at least 4. It is rendered as size= only in a stacked bar, through the new template estilo-bar-title-fit. That template is estilo-bar-title plus the attribute, and a test holds the two together.- In a bar with either slot, each action is wrapped in
<div estilo-bar-control> ("primary", "wide", "primary wide"), with display: contents. These wrappers are the hooks the controls set is styled on. AGENTS.md's prefix rule (enforced by internal/lint) forbids estilo CSS from selecting [rst-btn], so the primary pill could not be told apart any other way. - The Appearance form is now
<form estilo-appearance method="post" action=… role="group" aria-labelledby="estilo-appearance" data-busy="false">. Each button is <span estilo-appearance-icon> (Lucide sun, moon or monitor, lucide-static 1.72.0, ISC) above <span estilo-menu-label>, and keeps aria-pressed.
Spec point to code
| Spec (estilo list, rev 2/2.1) | Where | |---|---| | 1. Stacked variant, 56px, published | bar.html stack. In chrome.css's bar-stack section, from 800px: :root:has([estilo-bar~="stacked"]) { --estilo-bar-block-size: 56px }, a 32px icon 12px in, a 44px stack with a 24px title row (16px, 600, -0.01em) over a 20px menu row (13px, muted), both at x=56, and the name hidden | | C6: wide-only stacking | Below 800px the same markup lays out on a grid: the one-row bar, then the menus as a full-width second row (the stack is display: contents). The published height is 84px with no script; chrome.js publishes the real height below 800px (see deviations) | | 2. Lead slot | Bar.Lead, at every width, never in the sheet | | 3. Controls set, avatar circle, conditional divider | From 800px, in bars with a slot: 28px pills (13px/600, 8px apart); the primary filled, with a top highlight and a 0 5px 12px -5px accent shadow (25% in dark, 75% in light); aria-expanded="true" drawn accent-soft. The avatar is a 28px circle that darkens on hover and gets a 2px ring when open; a glyph avatar gets the same treatment. The 20px divider (12px each side) is drawn as the account's background, and only when a lead or actions precede it. Below 64rem a hidden WideOnly action does not count; RTL is handled with :dir(rtl). Coarse pointers go to 32px | | 4. Menubar | cursor: pointer. The 32px floor is dropped only in the stacked header. The highlight is a 24px pill with 6px radius, using -2px block margins. Panels hang at 55px, 1px above the edge. Panels in the stacked header have 28px rows, 13px type, muted keys, 4px padding and 10px radius | | 5. Title field and Rename | size from runes as the first paint. chrome.js sets the width to 0, reads scrollWidth, then adds the end padding, borders and 2px of caret room; it re-measures on input, resize, load, document.fonts.ready and after Escape. CSS caps the field at the room it has, and a long title scrolls. Rename is a 22px accent-soft pill painted in a 24px box | | 6. Appearance | Segmented selector (suite-wide); chrome.js intercepts submit in the capture phase, sets data-theme the way ThemeAttr writes it (no attribute for System), moves aria-pressed, POSTs the same form data with fetch, and swallows failures (P3). With script off it still POSTs and redirects | | C1 WideOnly and toggle; rem breakpoint | Above. 64rem is in rem. 800px stays px (see deviations) | | Shim | busy/rastrillo.js = ui.ShimJS() at amadan.net/rastrillo/rastrillo@v0.29.1-0.20261027164201-054787952dd2 (0547879). It is recorded in provenance.json with its own source, and busy.go's doc is updated |
Shim check (the STOP condition)
The re-vendored shim is busy-less: it has no busySubmit, aria-busy, rst-spin or hold. It has exactly one submit listener, which applies rastrillo's [rst-scheme] colour menu in place and returns for every other form, so it does not fight Fiesta 1.3.0's busy.js. No STOP was needed. The old guard refused any "submit" substring. It now asserts what matters instead: no busy vocabulary, one submit listener scoped to [rst-scheme], and the rst-switch drag present. The old shim fails it.
Tests
make test passes (GOTOOLCHAIN=go1.26.5), including node --test chrome.test.mjs through TestScriptBehaviour. Every new test was seen red for the right reason by breaking the code and then restoring it.
TestABarWithoutSlotsIsByteForByteUnchanged: goldens recorded from main's templates at f6d5605, before any change. They cover signed-in, sticky, dialog, public and signed-out bars, with Appearance left out because it changed for every app deliberately.TestEverythingAfterTheMarkerIsOptIn: main's chrome.css (everything before the marker) and menu.css are hashed against main. Every selector added after the marker must carry a slot, WideOnly or Appearance hook.TestTheMenubarSlotStacksTheBar, TestTheLeadSlotOpensTheEndGroup, TestAWideOnlyActionStaysOutOfTheSheet, TestAToggleActionIsDisabledUntilBound, TestSlottedBarsWrapEachActionAsAControl, TestTheTitleSizeIsItsLengthInCharacters, TestTheFittedTitleIsTheTitlePlusASize, TestTheStackedBarKeepsTheOneMenuGroup, TestTheStackedBarPublishesItsHeight, TestAppearanceIsASegmentedSelectorSwitchedInPlace, and menu's TestAToggleRowNamesItsRegionAndStartsDisabled.chrome.test.mjs: the fit at script time and on input, resize, load and fonts.ready; Escape refits; Appearance switches in place with the right POST body, System removes the attribute, a failed save is silent, and other forms or already-handled submits are untouched; the narrow height is published and is cleared from 800px.- Not committed: a local Playwright check in Chromium and WebKit against rendered templates and the pinned rastrillo's tokens.css. - At 1280 and 1000px: header 56; icon 32 at x=12 (y 11.5, as in the mock-up); title text and the first menu's text both at x=56.0; panel top 55; pills 28; Format hidden at 1000; divider only with a lead or actions; the plain bar still 52. - Title fit: nothing after the title moves between script off and script on (lead, Share and avatar have identical x). - Long title: capped and scrolling, with Rename ending 12px before the lead. - At 390 and 320px: no horizontal overflow. Appearance switches with no navigation. RTL mirrors, divider included.
Deviations and decisions for review
- The controls set is opt-in, not suite-wide. I was told that a bar with both slots empty must keep its markup and look byte for byte, so the pills, avatar circle and divider apply only to bars with Menubar or Lead. Docs' index, which has no slot, keeps today's corner. If Paul wants the set everywhere, that is a selector change plus re-hashing.
- Appearance is suite-wide. The segmented look, the icons,
data-busy="false" and the in-place switch apply in every app's account menu, as the spec places them. This changes the account panel's markup for every app (estilo-menu-check is gone from those three rows), which is why the goldens leave Appearance out. - Narrow height. Below 800px the menu row wraps where the menus don't fit: English at 320px, and Chromium at 390px with a classic scrollbar. The header is then 117px, against the 84px CSS publishes. With script, a ResizeObserver in
chrome.js writes the real height to --estilo-bar-block-size, only below 800px; from 800px the header's height is the variable itself, so writing it there would feed back into itself. With script off, 84px stands, and a wrapped row overlaps whatever is stuck under it by one row. - The 800px breakpoint stays in px. It is rastrillo's shell breakpoint and every app's. Rem in a media query follows the reader's default font size, so restating it in rem would split it from those whenever that size isn't 16px. 64rem is in rem.
- Rename's 24px target. The spec's 22px pill would be under AGENTS.md's 24px floor. The box is 24px, with a transparent 1px border and the fill clipped to the padding box, so it paints at 22px.
- Caret slack. The fit adds 2px beyond padding and borders, so text ending at the caret doesn't scroll. This matches the mock-up's slack.
- The narrow menus row is a second row in the header, not Docs' own
[docs-chrome] row. This follows my brief (one markup, CSS grid). Docs therefore drops its own menubar row below 800px and leaves only the strip in [docs-chrome]. - No
Icon in the sheet. Rows stay text. - Panel offset is +4.5px, not +4px. The stack is centred in the 55px inside the border, so the menu row ends at 50.5. +4.5px lands the panel at 55, the mock-up's value.
What Docs emits
- Menubar:
Bar.Menubar = template.HTML(<rendered <nav estilo-menubar aria-label=…>…</nav>>), with its menus <details estilo-menubar-menu name="estilo-menus">, as show.html draws them now. - Lead:
Bar.Lead = template.HTML(<its undo/redo pair with data-docs-command>). Docs hides it below 800px (C6). - Format:
chrome.Action{Item: menu.Item{Controls: "<inspector id>", Expanded: <cookie>, Label: "Format"}, WideOnly: true, Icon: <pencil svg>}. The app's script removes disabled and keeps aria-expanded in step. - Share:
chrome.Action{Item: menu.Item{Href: "/d/{sqid}/share", Label: …}, Primary: true}.
Docs can rely on: --estilo-bar-block-size (56px from 800px; 84px or the measured height below), [estilo-bar~="stacked"], [estilo-bar-lead], [estilo-bar-control], [estilo-bar-wide], [data-estilo-toggle], and [estilo-appearance]. Breakpoints: 800px (px) and 64rem.