Repository navigation
Lay out a page Layout's box by its parent, not body > main - #3110
Conversation
A Layout's box is now `main`, or a child of a `main` that carries no Layout, and its parent is the shell it is placed in. This separates the two jobs `body > main` did: the root of the page's content stays `pageDocument`, and the box the Layout arranges is `layoutBox`. It is the first step toward pages of several views, each with its own Layout. - layouts.css: Layout rules match `:is(main, main > *).layout-*`. The box declares itself (`--lf-layout-box`) and is the `lf-content-frame` style container margin residents ask; a `main` holding it is its shell and the size its `cqi` measure. The column's shell grid is `[data-lf-column-shell]` on whichever element holds the column, and the first sidebar's margin slot moves from the theme into the column Layout. - prepaint.js: `layoutBox()` finds that box from CSS's declaration; the margin pass, breakouts and sidebar tracks read it and its parent instead of `main` and `body`, measuring room inside the shell's border, and a column that moves to another shell clears the old one's tracks. The column shift stays on `body`, root state a revision keeps, and the shell inherits it. - The margin layout, the Layout's reading regions and the render checks that read the column, the workspace or the column's shell read `layoutBox`. - Delivery's root `data-lf-layout` also names the Layouts on `main`'s children. Nothing changes on a page whose `main` carries its Layout. A new test holds a column (shifted for its sidebar, and with a contents map) and a workspace on a child of `main` to the same geometry as on `main`, and a child column inside a narrowed or bordered `main` to that `main`'s content box; it fails on main. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The shipped page-layout reference still says the three page Layouts “go on main.” This change makes a Layout on a child of main a supported page-authoring route, so an agent following that reference cannot discover the new route. Please update the owning authoring reference with when and how to place a Layout on a child, as required by AGENTS.md’s “Working on the repository” feature guidance.
The margin pass and the breakout render check measured the shell inside its border only, so a `main` with scrollbar gutters admitted a sidebar that the gutter then clipped. Both now read the shell's client box (clientLeft, clientWidth), which excludes its border and gutters and keeps its padding, where the rail stands under data-rail="right". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
clientLeft and clientWidth are in the shell's own pixels, while its
bounding rectangle is in the window's, so a transform on the shell or
around it (body { transform: scale(.8) }) admitted a rail the room could
not hold, and the breakout check reported false past-room findings.
Both readings now scale the client box by the rectangle's width over
offsetWidth.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The owner-index test reads every code span in an owner cell as an export of its module, so the parenthetical naming prepaint.js failed it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A page with a shown layout-column child beside a hidden layout-workspace one named both on the root, so the workspace's body rules, such as the rail strip's exclusion, applied to the column. page_layout now skips a child of main the page hides, as layoutBox does. page-layout.md says a page Layout can go on a child of a main that carries none. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The “Rail and the margin” section of page-layout.md still tells authors to read main’s data-lf-margin and gives a main:not([data-lf-margin~="sidebar"]) selector. On the newly documented child Layout route, prepaint.js writes those tokens to the Layout child, so that selector always takes its no-sidebar branch even when the sidebar stands in the margin. Please make this guidance target the Layout box and give a selector that works for both placements.
The column's data-lf-margin is on whichever box carries layout-column, main or a child of it, so the example selector keys on that class. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/kernel/kernel.json
The banner, chrome-layout.js, queue-panel.js, test_banner.py and
test_shortcut_bar.py stay deleted; main's changes to them move to where
that code now lives. The approval refusal ("Answer every open widget
before approving this work", #3112) is in page-status.js, and the
Layout-box wording of #3110 in page-layout.js's header. queue-panel.js's
row word has no successor, since the On view's cards name no kind, so
askWord serves the walk and the ask view only. test_banner's agent
question and test_shortcut_bar's walk words ("· Options", "Next item
waiting on me") are carried into test_key_surfaces.py.
In conflicted tests the branch's panel selectors stand and main's
fixtures and words apply: lf-ask questions in place of `ask: true`
replies, and walk positions naming the widget ("Options", "Question").
The registry and events.md keep the branch's panel wording with #3114's
x-awaits `reply`/`yields` and question-in-words rows. The status
explanation the leaf's menu shows counts what waits on the user as
"N to answer" rather than "N asks", which #3112 left only because the
banner was going. The kernel and the layer-contract snapshot are
regenerated.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A page Layout's box is now
main, or a child of amainthat carries no Layout, and the box's parent is the shell it is placed in. This separates the two jobsbody > maindid:pageDocumentstays the root of the page's content, andlayoutBoxis the box the Layout arranges. It is the first step toward pages of several views, each a child ofmainwith its own Layout.:is(main, main > *).layout-*. The box declares itself with--lf-layout-boxand is thelf-content-framestyle container that margin residents (the contents map) query. Amainholding a Layout child is an inline-size container, so the child column'scqimeasures thatmain. The column's shell grid is[data-lf-column-shell]on whichever element holds the column, and the first sidebar's margin slot moves from theme.css into the column Layout.layoutBox()finds the box from CSS's declaration. The margin pass, breakouts and sidebar tracks read the box and its parent instead ofmainandbody, and measure room inside the shell's border and scrollbar gutters (a resident may still stand in its padding, as the rail does in the stripdata-rail="right"gives up). A column that moves to another shell clears the old one's tracks. The column shift stays onbody, root state a revision keeps, and the shell inherits it.layoutBox.data-lf-layoutalso names the Layouts onmain's children, except a child the page hides.mainthat carries none.Nothing changes on a page whose
maincarries its Layout; none of the 64 tracked HTML pages puts a Layout on a child ofmain. A new browser test holds a column (shifted for its sidebar, and with a contents map) and a workspace on a child ofmainto the same geometry as onmain, and a child column inside a narrowed, bordered or scrollbar-gutteredmainto thatmain's inner edges; it fails on main.