Skip to content

Let sections, articles and disclosures share the column's room, and let a page float its own sidenotes - #6237

Merged
max-sixty merged 5 commits into
mainfrom
sections-share-the-column
Nov 17, 2026
Merged

max-sixty merged 5 commits into
mainfrom
sections-share-the-column

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Two changes Max picked, one commit each:

  • Sections share the column's room. A plain <section>, <article> or <details> now passes the reading column's room to its children, so a data-width block inside one breaks out as it would directly in layout-column, and the layout-flow class leaves the author's vocabulary. A box carrying a Layout (layout-tiles and the rest) keeps its blocks, and so does a section with its own data-width. A tab set that should share the page's flow says flow="page" (a conditional x-flow, read the same way in Python and the browser), replacing --lf-views-flow. The outside-frame advice, which had recommended a declaration that does nothing since Use one browser rendering lifecycle and native document layout #4724, now says what works: take the frame out of the flow or give it data-width.
  • Margin note rows go. layout-note, layout-notes, aside.note, --lf-note and the margin's note avoidance are removed; page-layout.md shows a page floating its own sidenote into the margin, un-floated below 75rem.

Before this, 32 wide blocks on about 12 real pages sat in plain sections or disclosures where data-width did nothing; stills show the security example's state diagram, cut off at the column's edge on main, now whole. Lost: a page's own framed section lets its wide block run over its border (no tracked page does; outside-frame reports it), and the feature gallery's column re-centres without layout-notes. leaf-dev bench: keystroke and wheel step unchanged on every page shape, e.g. document 7.4 → 7.3 ms and 4.4 → 4.2 ms at 256 sections.

Scored on the nine layout and tab-set eval cases against main, Opus 5.5 author and judge: 18 of 18 pass. Tests: pnpm run check, the focused browser and model tests, and stills over the catalogue. An independent review's one finding (a tiles section passing room on) is fixed with a test.

This was written by Claude Code on behalf of max-sixty

`layout-notes`, `layout-note` and the `aside.note` idiom are gone, with the
`--lf-note` token, the column's note arithmetic, the note arms of the flow and
reach rules, and the margin layout's note avoidance. A note beside its passage
is now the page's own CSS: `page-layout.md`, "Document flow", gives a float
with a negative end margin, as Tufte CSS sets sidenotes, un-floated below the
window width whose margin holds it, and says Leaf's comment markers don't
avoid it, so a page whose notes fill the margin gives it to them with
`data-rail="none"`.

What changes for a reader: a `layout-notes` column no longer shifts left to
make room for notes, a note no longer wraps under its passage by flex, and a
comment marker level with a page's note stands in the rail over it rather than
pinning on its passage. The feature gallery's comparison section loses its
note, and `leaf-dev stills` gains a `gallery-comparison` state for it. The
reading theme drops its `aside.note` face, so an `aside class="note"` is the
page's own class.

Tests: the note tests go with the feature (the rail's note posture, note rows
across widths and directions, a note beside a change, the export's reseated
note, the catalog sidenote's aim, a callout beside a note, a note in a closed
disclosure, a wide widget leaving a note its margin). Tests that only carried
a note drop it: the native sidebar before activation, a column part and a
child-of-main column against a page's own, reading through a width reflow, the
gate's one light page, and the clipping journey.

Survey item #10, picked by max-sixty.

> _This was written by Claude Code on behalf of max-sixty_
…e tab set says `flow="page"`

A `section`, `article` or `details` in the column's flow now hands the page's room on
to what it holds, as `class="layout-flow"` did, so a wide table or board in a plain
section breaks out with no class of the author's. `layout-flow` leaves the vocabulary,
and every example, site page, eval fixture and test drops it. One carrying a page
Layout, or a `data-width` of its own, stays a box: it arranges what it holds, or takes
the room itself and holds its children inside it. A `div` keeps what it holds, as
before. Probed in Chromium, Firefox and WebKit: breakouts in a section, an article, a
`details` and nested sections land where `layout-flow` put them, a heading still opens
its section's box, and a nested `article.layout-column` keeps its measure.

What changes for a reader: six blocks in Leaf's own examples newly break out of plain
sections and disclosures (the four workbenches in `developer/worktree-diffs.html`, the
proposed states diagram in `security-boundary.html` and the release diff in the first
version of `live-progress.html`), and a page's own framed section now widens
with a wide block in it, the block running over the frame's border and padding, where
it used to stay inside; no tracked page does this, and `outside-frame` names it.

The class also chose a tab set's unframed face. That is now `flow="page"` on
`lf-tabs`, declared in its registry entry, and the set's panels share the page's room
without a class of their own: `lf-tab` declares `x-flow`, and `lf-tabs` declares it
`{when: {flow: ["page"]}}`, the conditional form `x-exhibit` already takes, which
delivery paints and `page check` reads per occurrence (`registry.contract.holds_for`,
`authored_inert`, moved beside it from `registry.kernel`). `lf-tabs.js` reads the
attribute rather than `--lf-views-flow`, which is gone.

The `outside-frame` advice recommended `--lf-block-frame: 1`, which has withheld no room
since #4724; it now says to put `data-width` on the frame or draw the frame on a div.
`contained-space` and `words-off-column` stop teaching the class, and the stale claims in
`base.css` and `layout.js` go. The render check asks a box whether it is a flow by the
`--lf-flow` the stylesheet states, rather than a copy of its selector.

Tests that put a block in a plain section to show it stays put now use a div (the
question's evidence, the advice's holders, the framed fixture's nested task rails), the
journey's framed scroller is a section, the tab tests check the face by its border
rather than `--lf-views-flow`, and the inert-allocation test gains a page tab set
(inert) and a boxed one (holds).

Survey item #12, picked by max-sixty.

> _This was written by Claude Code on behalf of max-sixty_
# Conflicts:
#	browser/types/contract.d.ts
#	tests/browser/test_render_aim.py
…he flows

A section, article or disclosure carrying a Layout arranges what it holds, so it hands
the column's room on to nothing. The flow selector excluded the page Layouts
(`layout-column`, `layout-sidebar`, `layout-workspace`) but not `layout-tiles` or
`layout-track`, so a `<section class="layout-tiles">` in the column gave each of its
wide blocks the column's breakout width and negative margin, and two of them drew over
each other instead of standing in their cells. The exclusion now names every Layout
class `layouts.css` defines, and `page-layout.md`, "Document flow", says a section
carrying one keeps what it holds.

`test_a_section_that_carries_a_layout_keeps_its_blocks_in_its_arrangement` puts two
available blocks in a tiles section beside a plain section's; it fails on the previous
selector (the tiles section took the whole room) and passes now. No tracked page writes
a section with either class, so no catalogue still changes.

Found by an independent Codex review.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent
leaf-agent previously approved these changes Nov 17, 2026
#6223 split each rule whose subject was keyed only through a list, so Chromium files it
under one key. The flow rules this branch writes named their subjects as
`:is(section, article, details, [data-lf-flow]):where(:not(…))`, the unkeyed form. Each
now names its kind as a selector of its own (`section:where(:not(…))`, …,
`[data-lf-flow]`), a rule nested under them names its kind again at no weight
(`&:where(section):dir(ltr)`), and lists stay only where they cost nothing: the reset's
`:not()`, ancestors and `:has()` arguments. `test_a_rule_s_subject_names_a_key` passes.

The Layout exception reads the `layout-` prefix (`[class^="layout-"]`,
`[class*=" layout-"]`), as page check and the authoring reading already read a Layout
class, rather than listing the five classes three times over; it keeps a section
carrying `layout-tiles` or `layout-track` a box, as the previous commit's list did.
Weights are unchanged where two rules meet: the reset still weighs a class, and a
nested rule its list's heaviest kind. Probed in Chromium, Firefox and WebKit, every
breakout lands where it did before the merge.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty
max-sixty merged commit 2685a32 into main Nov 17, 2026
5 checks passed
@max-sixty
max-sixty deleted the sections-share-the-column branch November 17, 2026 03:01
leaf-agent pushed a commit that referenced this pull request Nov 17, 2026
…up ask with no attribute (#6234)

A registry entry now holds its attributes' JSON Schema under
`attributes`, which every declaration must have, and groups its other
facts by what they cover: `state`, `markup`, `words`, `paint`, `data`
and `author`. Each fact is declared because some part of Leaf needs it
without running the widget's module. The `x-` prefix is gone, a fact's
name is its path (`state.verbs`), and `$keys` documents each fact and
each group by that path. The page also takes HTML's attribute names, as
#5968 had them: `needed` on `lf-draft` becomes `required` and `chosen`
on `lf-option` becomes `selected`. And an option group now asks with no
attribute at all: an `lf-options` stands on On Me unless it is `settled`
or quoted in a sample, which Max chose over #5968's `required`. Max
chose to do all of it as one sweep, so the interface changes once. This
supersedes #5968.

## One entry, before and after

`lf-options` on `main`:

```json
"lf-options": {
  "description": "Alternatives the user can choose individually or as a set to answer a question.",
  "x-instructions": "…",
  "type": "object",
  "properties": { "id": …, "choose": { "type": "boolean" }, "multiple": …, "closed": …, "across": …, "settled": …, "restated": … },
  "dependentRequired": { "settled": ["id"], "multiple": ["choose"] },
  "additionalProperties": false,
  "x-content": "members",
  "x-awaits": { "value": "choose", "when": { "choose": [true], "settled": [false] }, "retired": "settled", "key": "value", "answered": { … } },
  "x-state": { "choose": { "unit": "widget", "record": { "kind": "attribute", "attr": "chosen" } }, "add": { … }, "answer": { … } },
  "x-example": "…"
}
```

On this branch:

```json
"lf-options": {
  "description": "Alternatives the user can choose individually or as a set to answer a question.",
  "attributes": {
    "type": "object",
    "properties": { "id": …, "multiple": …, "closed": …, "across": …, "settled": …, "restated": … },
    "required": ["id"],
    "additionalProperties": false
  },
  "content": "members",
  "state": {
    "awaits": { "value": "choose", "when": { "settled": [false] }, "retired": "settled", "key": "value", "answered": { … } },
    "verbs": { "choose": { "unit": "widget", "record": { "kind": "attribute", "attr": "selected" } }, "add": { … }, "answer": { … } }
  },
  "author": { "instructions": "…", "example": "…" }
}
```

The verb is still `choose`.

## The groups as built

| Key | What it covers | Declared because, without running the module |
| --- | --- | --- |
| `description` | what the element is for | every reader shows it |
| `attributes` | the attributes' JSON Schema | `page check` and message
markup hold each occurrence to it |
| `content` | `markup`, `members`, `data` or `empty` | the server, `page
check`, the passage reader and first paint all read it |
| `state` | `verbs`, `awaits`, `retired-when`, `encloses`, `exhibit`,
`shows`, `work`, `history`: the widget's verbs, what it asks the user
and how their answers retire | the server admits actions and keeps the
On lists and can't run the module; the browser reads them too |
| `markup` | `owners`, `unique`, `refers`, `reading-role`: where the
element stands and what it names | `page check` and message markup
refuse markup; the server and browser read them too |
| `words` | `says`, `verbatim`, `shadow`, `inline`, `visual`,
`text-format`, `word`: how its words read | the server's passage reader,
the render check, and the browser reading an element no module drew |
| `paint` | `views`, `space`, `height`, `bound`, `spine`, `flow`,
`prepaint`: how its box is laid out before the module draws | the first
paint comes before any module runs; delivery paints most as marks |
| `data` | `inputs`, `outputs`: the typed values it reads and publishes
| the server checks bindings and the browser delivers values |
| `author` | `example`, `instructions` | the agent reads them after
choosing the element |

The group first built as `server`, after one of its readers, is named by
what it covers, and its fact `state` became `verbs`, so no path reads
`state.state`; it sits beside the layer's `$state`, which documents each
verb's fields. `paint.flow` takes `main`'s new conditional form (#6237):
`lf-tabs` declares `{"when": {"flow": ["page"]}}`.

`$keys` is keyed by path (`"state.verbs"`), with an entry of its own for
each group, so its lint is the same set comparison `main` has. `$marks`
names each mark by its fact's path (`paint.space`). Python reads a fact
with `registry.contract.declared_fact(entry, "state.verbs")`, the
browser with `entry.state?.verbs`, and `declarationFor(el)` returns the
whole entry. Two facts read through others are checked explicitly. On
`main` a missing one read "registry extensions are invalid: 'x-owners'
is a dependency of 'x-retired-when'"; it now reads "state.retired-when
needs markup.owners", and a view without its reference "state.shows
needs markup.refers".

## An option group asks with no attribute

The trap #5968's reviewer found is gone: in HTML a group without
`required` can still be picked, while in Leaf it drew cards nobody could
press, and `page check` passed the page. Now `state.awaits.when` for
`lf-options` is `{"settled": [false]}`, `lf-options.js` wires the pick
unless the group is quoted, and `required` on a group is refused as
undeclared. Every group needs an `id`, which the schema now requires in
place of the `dependentRequired` that asked for one on a settled group,
and `multiple` depends on nothing. `required` on `lf-draft` and
`selected` on `lf-option` keep their meaning. This ports
`fable-options-ask-by-default-trial` (da66b7d) onto the grouped
shape; about 580 tags lose the attribute across registries, examples,
docs, notes, evals, instructions, dev tools and tests.

`options.css` drops `[required]` from each selector and gives the
exhibit guard an attribute's specificity, so every rule keeps its
weight. On feature-gallery, alert-review and ship-review, every computed
property of every group and every element inside it (cells, marks,
badges, the add field, their `::before` and `::after`) is the same
before and after: 257, 241 and 43 elements, read with `leaf-dev probe
--authored --base`. The `lf-options` instructions and
`authoring-on-me.md` now say a group asks with no attribute and that
`settled` records the decision and stops it asking.

## Single-declarer keys

| Key | Declared by | Verdict |
| --- | --- | --- |
| `state.encloses` | `lf-ask` | kept: a form or survey widget from
another package can frame questions, and without it core would name
`lf-ask` |
| `state.exhibit` | `lf-sample`, and the feature gallery's page widget |
kept: already has a second declarer |
| `state.shows` | `lf-card` | kept: a timeline or roadmap card could
show an answer the same way |
| `state.work` | `lf-card` | kept: any task-list widget could take the
agent's to-dos |
| `state.history` | `lf-activity` | kept: the server needs it to serve
the history reading only to pages that show it |
| `markup.reading-role` | `lf-pane` | kept: its own contract says
packages contribute panes under their own tags |
| `words.text-format` | `lf-draft` | kept: any widget whose body is
Markdown words needs the server to read it rendered |
| `paint.prepaint` | `lf-text-document` | kept, moved to `paint`: a file
viewer from another package could draw Markdown at first paint |
| `paint.spine` | `lf-toc` | kept: removing it takes away the automatic
narrow sidebar |
| `data.outputs` | `lf-diff`, and three example pages' widgets | kept:
#5981, which replaces it with a property and a `change` event, hasn't
landed |

`paint.flow`, single-declarer when this started, now has `lf-ask`,
`lf-tab` and conditional `lf-tabs`.

## Calls to reverse

- No single-declarer key is removed (table above).
- `elementsDeclaring` is gone from the public API: nothing called it,
and it was `declaredElements` without its root.
- Finding codes: `invalid-declaration` replaces `invalid-extensions` and
`no-description`, which the declaration schema now covers, and
`attributes-schema` replaces `declaration-schema`.
- `attributes` is required, so a declaration without it fails `page
check`.
- Prose that called a verb "a server.state verb" now says "a verb
(state.verbs)", and finding texts name "verb `move` (state.verbs)".
- No page protocol bump: the layer's entries come from the Leaf that
serves the page, and a page's own `page/registry.json` in the old shape
fails `page check` with `invalid-declaration`, which the agent fixes
like any check failure.

## Checks

- `pnpm run check`: pass (998 runtime tests, worker 91, types, build
check).
- `uv run pytest tests/model`: 3,601 passed after each commit and merge.
- Browser, by file or node id: after ask-by-default, the option,
obligation and On panel tests (159 passed); after `main`'s #6237 merged
in, both tab-set files and the three probe tests #6242 touched (48
passed); after the rename, the option, obligation, On panel, board,
playground and command-route files and every browser test whose fixture
the rename changed (247 passed), and the journey tests it changed, by
node id (16 passed). Earlier in the sweep, about 1,300 more across the
files the shape change touched.
- `page check` on all 47 authored sources, built as pages, and `leaf
package check --render` on the 13 bundled packages with a registry: all
pass. No `server.` fact path is left in the tree.
- Evals for ask-by-default, Claude Code, the branch beside the commit
before it, two runs per arm: `thread-choice-takes-a-press`,
`proposals-get-individual-decisions` and
`decision-record-after-its-work` pass 6 of 6 on each arm, $2.67 for the
authors plus grading. No head output writes `required` on a group;
base's proposals pages wrote it on all six groups. In
`thread-choice-takes-a-press`, base's replies wrote `<lf-options
id="yoy-baseline">` without `required` in both runs, which on base draws
cards nobody can press (the rubric is head's, so it passed them). Only
the proposals runs opened the changed instructions (`leaf page
instructions`, `authoring-on-me.md`, `threads.md`), on both arms; the
decision-record runs settled every answered group, and the thread runs
used no tools.
- Evals for the shape, earlier: `package-text-widget-keeps-the-measure`,
`recorded-effect-payloads` and `widget-checked-before-handoff` pass 12
of 12 across both arms, $3.14.

Not run: the rest of the journeys tier and `tests/browser`, Codex evals,
`leaf-dev bench`, Firefox.
max-sixty added a commit that referenced this pull request Nov 17, 2026
#6237 removed the margin's note rows, so the rail no longer reads notes on
its side: rowPlacement drops `noted`, the layout pass its notes reading, and
module-annotations.md its mention of layout-note asides.
max-sixty added a commit that referenced this pull request Nov 17, 2026
Two files conflicted, and main's #6234 broke the page-margin scenario
without a textual conflict.

- annotation-layer.js: this branch moved it from annotation-overlay/ to
  browser/runtime/ and rewrote it around watchAnnotationLayer; main's #6245
  changed it in place so that setAnnotationsHidden toggles
  `data-lf-annotations-hidden` on the chrome's root instead of writing
  `data-lf-annotations="hidden"` on html. The moved file takes #6245's
  write (chromeRoot.toggleAttribute) and its header paragraph saying why,
  and the annotation-overlay/ copy stays deleted. The branch's readers of
  the old html attribute move to the chrome root's, as #6245 moved its
  tests: tests/runtime/annotation-layer.test.mjs, and the two `o` checks
  in test_thread_surfaces.py's page-presentation and gallery tests. The
  gallery's lf-x-margin reads the layer through its watcher, not the
  attribute, so it needed no change.
- feature-gallery.html: main's #6237 took `layout-flow` out of the
  author vocabulary, so the #bg-page-margin section drops the class, and
  #bg-native-replies keeps main's plain section.
- #6234 regrouped registry declarations and removed `choose` from
  lf-options. lf-x-margin's gallery entry moves to the new shape
  (`attributes`, `content`, `author.instructions`, `author.example`), and
  the scenario's and its test's option groups drop `choose`.
max-sixty added a commit that referenced this pull request Nov 18, 2026
…ey read (#6374)

Ten tests under `dev/tests` failed on main because five main commits
changed what they read, and nothing in CI runs `dev/tests`. Each test
still protects behavior that holds, so the fix is in the tests' fixtures
and expectations; no developer tool changes.

- #5964 put a `leaf` command's refusal in its stdout JSON. The desktop
Codex `server start` cases and the unavailable-delivery `start`/`run`
handoffs in `test_interact_preview.py` now read it there.
- #4198 made the preview follow more files in its checkout. The
assets-pin test's fake checkout now creates every file `worker_inputs`
names, so the preview no longer subscribes the whole checkout
recursively.
- #6237 re-indented `docs/index.html`, and the composed-image case in
`test_product_page.py` matched on the old indentation. It now matches on
`alt` alone.
- #5228 changed the journey's page-text read, and #6090 shortened the
release marker to seven characters. `test_website_server.py`'s fake page
and its expected marker follow both.

To weigh: these breaks went unseen for up to three weeks because
`dev/AGENTS.md` keeps `dev/tests` out of every CI selection. This PR
leaves that rule unchanged.

Dispatched by max-sixty from the session that landed #6014. Tests: the
three changed modules, 91 passed on macOS.

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants