Repository navigation
Arrange pages with Layout classes, and let margins claim nothing - #1246
Conversation
A workspace declares `x-measure: group`, but the theme let its `x-space: available` imply `surface` first. That cleared the measure for everything inside, so the lede under a workspace's title ran the full width: 1325px at 1440 on alert-review and wt-merge, where every other wide page holds its text to 720px. A declared measure now outranks the surface an x-space past the column implies. The runtime stops painting the default `group` on members widgets whose x-space already implies a surface (lf-board, lf-roster), so the theme reads a painted measure as an explicit declaration and no other widget's layout moves. Measured in Chrome: the three workspace ledes go to 720px, and the board's measure is unchanged. The root workspace test gains a header lede and asserts it stands at --col; it fails with the old selector (1178px against 720). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A survey of every example and docs page at five widths found four layout defects TODO.md did not name: margins claimed as whole-page strips, a board recipe that clips from about 1300px to 900px, counted grids that wrap into an orphan row, and held workspaces whose header takes the panes' height. It also names the page-built workarounds behind the open named-areas question, and an export bug that shows screen-reader words. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # docs/registry.html # skills/leaf/assets/registry.json
The model the layout review settled (liberal arrangement, Layouts, nine coordination contracts; decisions A to D), put into the layer far enough to judge three pages on it. Not a finished cutover: other examples, fixtures and tests still use what this removes. - main has no layout of its own. Four Layouts are classes in a cascade layer the page's CSS outranks: .layout-column (the column, with its breakout read from room measured beside it), .layout-sidebar (body and side track that wraps where the body cannot keep its content's minimum), .layout-tiles and .layout-workspace (fills --lf-view-height, flows on a short window). --lf-view-height and --lf-top are the chrome tokens a page reads. - Nothing claims a margin. The rail stands where the room between main and the shell's edge holds it, measured; data-rail="right" pads the shell by the rail so the page lays out narrower. A sidebar or sidenote stands in the room free beside the column and never moves it. The wide page frame and --lf-page-width go. - x-measure and its inference go; text elements keep the measure as typography. lf-grid, its module, the hold chain and the stacking and alignment advice go. - lf-board states a minimum width, capped by the shell. - version check reads a column declared inside @layer, which orders rules rather than conditioning them. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The three pages the layout prototype is judged on: - docs/event-log is .layout-column. Its diagram breaks out whole at 1000, 1200 and 1440px, where the sidebar's claim held it to 720px and clipped it at 1200; the column stays centred and the contents spine rests in the margin. - triage-board is .layout-sidebar with its counts as .layout-tiles, no page CSS. The board keeps its 840px minimum: beside the status track down to a ~1250px window, below it on its own row, where 3fr 1fr clipped its fourth column from ~1300px down to 900px. - alert-review is .layout-workspace, its panes in a plain div that ten lines of page CSS lay out. The header lede keeps the measure, and the panes hold the window. The corpus is regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Twenty pages move off lf-grid, lf-workspace and main[data-width]: prose and docs pages take .layout-column, the dashboards .layout-sidebar (with .layout-tiles for metric rows), and rust-sort, wt-merge and notification-playground .layout-workspace. Page registries drop the x-measure key the schema no longer admits. Base fixes the move surfaced: - pre, table, lf-code, lf-diff and lf-call-diff contain their inline size, so a scroller's longest line never becomes a Layout item's minimum; a declared min-inline-size (the board) still reaches it. - A Layout header sets --t-1 rather than an h1 rule, which the unlayered base heading outranked. - The playground's split draws its own grid; it leaned on the deleted grid reading role, which leaves the schema and validator. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/AGENTS.md # skills/leaf/assets/theme.css
Everything Leaf ships (kernel, packages, and the sheets the runtime adopts) now shares one cascade layer, lf-base, so its rules rank against each other exactly as before; the Layouts move to assets/layouts.css in lf-layouts above it, and page CSS stays unlayered above both. A Layout now resets what the base and widgets set on the boxes it arranges, which is what the migrated pages kept working around: titles, item margins, a flowing workspace's padding. The Layouts: - .layout-wide is the page frame on its own; the sidebar, tiles and workspace stand in it, and it sets the wide title on main. - .layout-sidebar grows its body two parts to the track's one and zeroes its items' block margins. - .layout-workspace pads main rather than its header, holds its body's last block to the rest of the window, scrolls generated panes as it does lf-pane, and sets --lf-held for widgets that fill a held height; the playground keys its held rows on that instead of a container that no longer exists. Pages drop the workarounds these cover. The anchor note takes its pixel back from the glyph it follows, so a flush line no longer scrolls an edge-to-edge page sideways, and the demo recorder leaves lf-grid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The MCP snapshot rewrites the theme's :root rules onto its shadow host, and the theme is layered now, so its `position: static !important` beat the containment the app states unlayered. The containment's important rules move into a layer the snapshot names before the theme's own. Chrome fixed in a margin states the room it takes there (`--lf-chrome-l`, `--lf-chrome-r`), and the column Layout takes it off that side's free room: the contents spine sets it from the width it moves into the margin, so a wide catalog stops short of it. The docs package's page-side copy of that arithmetic goes. Tests that read the old shape move with it: the adopted chrome and marks sheets compare against their files inside the base layer, a package's sheet is checked for order rather than for ending the theme, the column is read from the kernel's theme and Layouts together, and the published workspaces are the pages whose main is .layout-workspace. The corpus is regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Independent review found the one-layer cascade put chrome.css and marks.css inside lf-base, so any page element rule repainted the banner, thread filters and margin controls, and wrapped each shadow stage's sheet, so the diff renderer's own layers outranked Leaf's diff styles and its highlighting went to one ink. - chrome.css and marks.css are adopted unlayered again, as their paint must beat page and widget alike; lf-reset, chrome's form clearing, is declared first so it stays below every face. The general text box's face moves page-side into theme.css, where the write-in box's own rule refines it, as chrome.css says every shared face is stated. - Shadow stages keep their sheet unlayered; only a widget module's own sheet joins lf-base. - The contents map states its whole claim as the room it takes, since its resting surface is as wide as its labels. - A workspace keeps its bottom padding when it flows, and no longer imposes a display on its body; an Ask that is the held body arranges its own last block (default package, under --lf-held). - A Layout sets the wide page's title outright, now that it outranks the base heading: size, weight, tracking and leading. A computed-style diff of six pages against the branch before the layering shows only the Layouts' intended changes; the diff's tokens take their palette again. Page element rules still reach the shared control faces in lf-base (decision E on the model page). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
With no sidebar claim the column is centred, and the map's resting surface, as wide as the labels it reveals, lay over the column's left edge on windows under about 1450px: a press on a link or the feature gallery's Play button landed on the map. At rest only a strip one step wide over the spine takes presses; hovering or focusing it opens the whole surface, which keeps the pointer as it moves onto a label. The room the map states to the column's free room is the spine's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The feature gallery takes the column Layout, with plain grids, tiles and a flex row where it had lf-grid, and its layout section shows panes in a bounded box of its own; its earlier versions follow. The visual-review gallery is a workspace Layout holding the widget, which fills a held height under --lf-held as the playground does. lf-workspace leaves the registry, the default theme and the schema's reading roles; the outline advice recognises a workspace page by its Layout class. A specimen's generated document is a column page. The render gate's margin reading treats a fixed overlay that takes no presses at rest, the contents map, as resident in the margin it starts in, and a breakout under it as intended: it reveals over the page, and the room it takes at rest is what it states to the column's free room. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The Layout section described the model this branch replaces. It now states the branch's model and the items that don't block its landing: decision E and what building it found, pages restyling Leaf's own surfaces on purpose, holder-capped widget minimums, the workspace's column setting, contract 8's remaining margins, outcome checks as the gate, and testing the Layouts on agents. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Guidance: SKILL.md, page-authoring.md, packages.md, the package guides, registry descriptions and how-it-works' Layout tab now teach the Layout classes instead of lf-grid, lf-workspace and main[data-width]. A new eval case, page-arrangement-uses-layouts, went from 0/3 on the old guidance to 3/3; the other layout cases held. Behavior that moved: - The Page Map toggle follows the rail the margin measures (railStands, now in geometry.js) instead of an 863px shell query, which left 864-959px with pinned markers and no map. - version check no longer advises against page CSS that places a pane: the page owns arrangement. Scroller advice stays. - Panes scroll only as the workspace body or a cell of it; a pane nested in another pane's body flows. The workspace header is a block frame. - A held Ask gives leftover height only to a heading-plus-answer shape, without a :has() the whole document restyles on. Tests: leaf_page takes layout= and defaults to the column, since a bare main has no Layout. Tests of lf-grid templates, stacking, grid advice, nested workspaces and workspaces in tabs are deleted; workspace, pane and floor tests are rewritten on the Layouts. Two expectations the branch breaks are strict xfails recorded in TODO.md: the render gate's 1200px viewport sees no margin sidebar or note, and a board in a specimen overruns it on a phone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/theme.css # skills/leaf/scripts/leaf/render-checks/layout.js # skills/leaf/scripts/leaf/render_gate/version.py # skills/leaf/scripts/leaf/validation/source.py # tests/test_interact_contract.py # tests/test_render_margin.py
Layering moved the theme and package sheets into lf-base below the unlayered chrome, so rules that used to win or yield on specificity now decide by layer: - The Ask's ring reads --lf-ask-ring, which the default package sets to none inside choose-options, instead of losing an outline:none by layer. - The margin thread's paper yields to shadow.css's focus tint from an lf-base block inside chrome.css. - A pending suggestion's printed "proposed" word is revealed beside .lf-quiet in chrome.css, where the two meet in one layer. - The reaction mark's resting face moved into theme.css beside the margin-entry states. Margins: whatever stands in a margin states the room it takes there (--lf-taken-l/-r, replacing --lf-chrome-l/-r), so a margin sidebar keeps breakouts off its side. The rail reading moved back into the margin pass, read once per pass, and data-rail="none" is honoured again; the pass paints data-lf-pins, which offers the Page Map. lf-board's declared minimum is screen-only. The corpus and five example pages still had a bare main, which is no Layout now; they are column pages. Tests: rail, room, note and sidebar tests are rewritten for residents that claim nothing and stand where the room beside the column holds them. A page's element rules reaching lf-board's controls is decision E, a strict xfail; so is the gate missing a clipped note at 1200px. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/packages/default/registry.json # skills/leaf/scripts/leaf/render_gate/version.py # skills/leaf/scripts/leaf/validation/markup.py # skills/leaf/scripts/leaf/validation/source.py # tests/test_interact_document.py
- layout-sidebar finds its side track as the last element that is not a header, footer, script, style or template: a footer or a trailing script left both tracks at the body's share. - A column Layout on a block inside another Layout keeps the measure and gives no breakout room: its free room was the shell's, so a wide figure in it reached past the Layout around it. - A marker level with a sidenote hanging in the right margin pins on its block, as theme.css already said it did; the rail stood over the note. page-authoring.md no longer asks note pages for data-rail="none". - version check refuses data-width on main, whose width is a Layout class, and advises when main has no Layout class at all. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/chrome.css
- page-authoring.md: the rail stands where the room beside the column holds it (about 960px with a mouse, 1010px with a finger), not from a reserved 863px shell; `available` gives way to a margin resident that takes its side, not to the rail; a column Layout on a block gives no breakout room. - packages.md drops x-measure and data-lf-measure, which the branch removed, and --lf-natural-inline-size, whose gate reading main removed; the theme and diagram stop setting it. - The lf-pane description says which panes a held workspace scrolls. - A change level with a hanging note is decided on the change, as a pin, so its gate test now asserts the pin rather than the overlap. - The left-sidebar test holds the sidebar out of the column instead of the spine's implementation width. - TODO.md records the held workspace's missing end room, which its strict xfail now cites. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The examples' first viewports changed with their Layouts, so the catalog points at a fresh set of stills. TODO.md records that the corpus reads every example as a column page and that the Page Map toggle follows the margin pass by one frame on a phone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The new cascade lets ordinary page CSS restyle Leaf's widget controls. With the expected-failure marker disabled, test_a_pages_own_element_rules_leave_the_layers_controls_alone fails: a page's button, a rule gives the board's grip and destination buttons the page's red ink and cursive face. The mechanism is the move of every package theme into lf-base, below unlayered page CSS.
The PR tracks this in TODO.md, but it changes the ownership boundary for every page with element rules, including pages that use those rules only to dress their own content. The TODO also says the isolation route still needs a way to distinguish Leaf controls from page module controls. That boundary needs settling before this cascade change lands.
|
Landing this with the regression you describe, by the maintainer's decision.
|
…me (#1255) After #1246 the margin rail claims no room: it stands wherever the room beside `main` holds it, and only `data-rail="right"` takes that room. Prose across the tree still described the old model, and the decision E test missed the chrome. ## Prose now describes the current model These sources still described a reserved rail, an 863px floor, `x-measure`, or workspaces inside page tabs: - the developer glossary; - how-it-works; - the theme and runtime comments; - `structure.py`; - test docstrings; - the feature gallery, with the corpus regenerated. They now state what the code does. The glossary's Pin entry lists every case that pins a marker. Its reading-posture entry no longer claims that only a held workspace bounds a region, since a visual review's capture is bounded in any page. `test_check_measures_against_the_column_the_page_sets_for_itself` is deleted. It set `--lf-reading-column`, which nothing has read since #1239 cut the column lint, so it passed however the page was written. ## Decision E also reaches the chrome `test_a_pages_own_element_rules_leave_the_layers_controls_alone` is still a strict xfail, but it now reads the chrome's buttons as well as a widget's controls. A page's bare `button {}` restyles the family, ink, border, background and padding of every button in the banner and thread panel, because `.lf-btn`'s face is in `shadow.css`, inside `lf-base`. On the commit before #1246, only the family leaked into those buttons, through `lf-reset`'s `font: inherit`. `TODO.md` records this, along with the ownership that unblocks the boot-time exclusion: a widget's controls take their face from the sheet of the package that ships the widget. Its Layout intro and `notes/dependency-survey.md` no longer describe cascade layers as untried. ## Testing - `uv run pytest tests`: 1431 passed, 1 xfailed, 1 failed. The failure, `test_a_preview_holds_one_contract_until_it_closes`, passes when rerun alone and touches nothing this change does. - The widened xfail fails on its assertion, not in setup: with `--runxfail`, the board's controls read `cursive` in the page's red. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…tired column variables (#1273) A first sidebar that holds only an `lf-toc` stays in the flow between an 848px shell, where the default package fixes the map into the left margin, and 1296px, where the core theme floats the sidebar. In that band the empty sidebar kept its `margin: var(--sp-4) 0 30px`, and as a `flow-root` box it also kept the blocks on either side of it from collapsing their margins. On `feature-gallery` at 1200px, the render gate's width, that put 54px between the lede and the paragraph after it where the floated posture gives 13px. The docs site patched it for itself (#1246) by zeroing the margins, which still left 23px because the box stayed `flow-root`. The core theme now handles this beside the posture declaration that #1278 moved there: under the margin posture, a first sidebar whose only child is the `lf-toc` is `display: block` with no block margins, so the blocks on either side meet as they do when the sidebar floats. The rule has to be in the core theme, because package CSS is now confined to the package's own widgets and could not reach the `aside`. The docs copy is deleted. From 1296px the core theme's float margins still outrank the new rule, so the floated sidebar is unchanged. The surveyor's reading of no gap at 1000px came from the page, not from Leaf: the feature gallery hides `#bg-sidebar` below a 1152px shell (its own `@container lf-shell (max-width: 1151px)`, from #237), so there the gap only shows from 1152 to 1295px. Any other page with this shape has the gap from 848px. `layouts.css` no longer pins `--lf-shift: 0px` and `--lf-gutter-l`. These were left over from the column model #1246 retired, and they only fed `--lf-sidebar-free-left`, which nothing read, and a `+ 0px` term in the default package's outline width. The core theme's `main` rule that set those two properties and `--lf-sidebar-claim` is gone. `--lf-sidebar-claim` was an alias for `--sidebar-max` with one reader, the map's width, which now reads `--sidebar-max` directly. Behaviour that moved: between 848 and 1296px of shell, on a fine pointer, a page whose first sidebar holds only the contents map loses the gap under the block before it (41px on the feature gallery at 1200px). `test_a_left_sidebar_uses_the_margin_until_the_page_needs_it_back` now checks that band: the block after the sidebar stands where it would with the sidebar gone. `test_the_reading_map_returns_when_a_hidden_sidebar_comes_back` asserted the wrapper's display was `flow-root`, which only stood in for "the wrapper came back". It now asserts that the display is not `none`. `layouts.css` still selects `lf-pane` by tag. The survey read this as a pane-depth inconsistency that the role alone would fix. Keying on the role alone breaks two things the tag carries. An authored pane is held only as the workspace body or a cell of it, and `test_a_pane_inside_a_plain_section_of_a_workspace_flows` goes red if the depth limit is dropped. The tag is also the only mark present at first paint: on `alert-review` the runtime paints `data-lf-reading-role` 450-650ms after first paint. That needs a first-paint, authored-versus-generated mark, so it is a `TODO.md` entry under Shared definitions. > _This was written by Claude Code on behalf of max-sixty_ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The notification playground from [#1246](#1246) labels its slider “Concurrent release events,” while its reading test still searched for “Drag event pressure.” Update the test to assert that the current visible control label is present in both authored and spoken readings. Its layout, scrolling, and keyboard checks remain intact. The focused browser case failed on `main` before this change and passed afterward: `uv run pytest tests/test_render_widgets.py::test_notification_playground_sets_regions_side_by_side_while_its_workspace_is_full_height -q -n0`. This addresses one failure in [main CI run 38013241865](https://github.com/max-sixty/leaf/actions/runs/38013241865). Co-authored-by: leaf-agent <[email protected]>
#2796) How it Works gains "Styles and overrides" on its Pages tab: a figure of the cascade tiers in the document and in a widget's shadow tree, then where CSS goes to override something for one page, for a Layout, and for a widget or package, and what each place can and cannot reach. Every claim was checked by probing rendered pages built from this tree. The survey found two rules that silently did nothing: - The site package's `body.site-page main { padding-top: 28px }` has lost to the column Layout's padding in `lf-layouts` since Layouts moved above `lf-base` (#1246), so site pages started 72px down. It now sets the `--page-pad-start` token the Layout reads; pages start 28px down, as the rule's comment intended. - The extension guide's package CSS began `lf-callout {`, which matches nothing: composition scopes a widget package's sheet to its tags, and a type selector inside `@scope` does not match the root. It now uses `:scope`. `packages.md` adds the page geometry inputs Layouts read (`--col`, `--wide`, `--sidebar`, `--page-pad-*`) to its theme inputs and says a package that declares widgets reaches only inside them. `page-authoring.md`'s example selector `lf-board .lf-btn` matched no control; it is now `lf-board .lf-grip`. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
A page now arranges itself with Layout classes and its own CSS, and Leaf's widgets fill the box they are given.
lf-grid,lf-workspaceand<main data-width>are gone.Why
Pages kept needing arrangements the fixed vocabulary couldn't express, and each new need became another
lf-gridoption, another reserved strip, or another page-CSS workaround. The model this lands, chosen on the layout-survey model page: Leaf supplies starting points and the contracts pages and widgets coordinate through, and the page decides its arrangement.What changes
Layouts.
layouts.css, in a newlf-layoutscascade layer, ships five classes a page puts onmainor on any block:layout-column: the reading column, with a breakout for blocks that ask for width;layout-wide: the page as wide as the window, up to a cap;layout-sidebar: a body beside a side track, with a header and footer across both;layout-tiles: equal cells, as many to a row as fit;layout-workspace: the page fills the window, with a header, one body and a footer. Pane bodies scroll, and--lf-heldtells a widget it has a definite height to fill.A
mainwith no class has no arrangement.version checkadvises whenmainhas none, and refusesdata-widthonmain.Cascade. The kernel and package themes, and each widget module's sheet, share
@layer lf-base. The Layouts sit above that layer, and the page's own CSS, being unlayered, above both. The chrome and marks sheets stay unlayered, so they still paint over the page. Rules that used to win or yield on specificity across those sheets were rewritten to decide the same way under layers:Margins claim nothing. The margin rail stands wherever the room beside the column holds it, measured by the margin pass, from about 960px with a mouse. A sidebar reaches the margin from 1296px and a sidenote from 1536px. Whatever stands in a margin states the room it takes there (
--lf-taken-l/-r), so breakouts stop short of it. A marker level with a hanging note stands as a pin, and so does every marker where the rail does not stand. The banner offers the Page Map wherever markers are pins.Widgets. A widget's minimum content contribution is its declared
min-inline-size:pre,table,lf-code,lf-diffandlf-call-diffcontain their inline size. Page CSS that places a pane is no longer advised against, since arranging is the page's.Guidance and content. The following teach the Layouts:
SKILL.md,page-authoring.mdandpackages.md;A new eval case,
page-arrangement-uses-layouts, went from 0/3 on the old guidance to 3/3; the other layout cases held. Every example, docs page and developer page uses the Layouts, and the catalog stills are refreshed.Known gaps, in TODO.md
button {}, now reach the controls widgets draw inside the page, because page CSS is unlayered abovelf-base. The chrome is unaffected. Decision E, keeping page CSS off Leaf's controls, is deferred.test_a_pages_own_element_rules_leave_the_layers_controls_aloneis a strict xfail on it.Testing
On the merged head:
uv run pytest tests: 1433 passed, 1 xfailed;uv run pytest tests --run-nightly: 3231 passed, 5 xfailed;npm run test:runtime: 126 passed.Tests of the retired vocabulary are deleted:
lf-gridtemplates and stacking, the gate's grid advice, nested workspaces, workspaces in tabs. Workspace, pane, rail, room and margin-floor tests are rewritten on the Layouts. New tests cover:version check'smainLayout checks.A planted fault turns each of the new browser tests red.
🤖 Generated with Claude Code