Skip to content

Set lf-grid at the column's width; let a stacked workspace scroll; trim edges through bare wrappers - #1178

Merged
max-sixty merged 23 commits into
mainfrom
how-it-works-one-layout
Sep 25, 2026
Merged

max-sixty merged 23 commits into
mainfrom
how-it-works-one-layout

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Three layout defects the blind arrangement comparison (#1172) found on Leaf pages, after #1171 made the page one kind.

A grid takes the column's width in a column page. lf-grid no longer declares x-space: "wide", so in a column page it lines up with the prose, as a paragraph does; data-width="wide" or "available" asks for more, as on a figure. On a wide page nothing changes. Tiles and figures running past the prose's right edge was the defect the judge named most on Leaf documents (7 of 12 judgments). At 720px a counted grid of plain cells fits three 224px tracks, so columns="4" of sections lays out three and one; a row of lf-metric tiles keeps four on the metric row's 9rem floor; 1fr 2fr (stacks below 43.5rem = 696px) stays side by side. The registry entry and page-authoring.md "Composing a page" say so; the feature gallery's three charts take data-width="wide".

A stacked workspace scrolls instead of splitting the window. A root workspace holds the window from 720px, but its template grid stacks at its own width (1fr 2.4fr below ~786px). Between the two, the stacked panes shared the window height: at 820px the queue showed two tickets and the detail pane was cut off at its first fields. A stacked lf-grid now passes no held height on (--lf-passes-hold: 0), so its panes take their natural height and the page scrolls, as the workspace entry already promised.

A frame trims the edge margin through bare wrappers. A frame trimmed its first and last child's margin, but a bare wrapper there (a section with no inset) passed its own first child's margin to the frame's edge, so a detail pane that wrapped each ticket in a section opened on a 48px empty band. The trim now follows the edge down through registered, non-inherited --lf-edge-start / --lf-edge-end. This replaces #1173's lf-ask-specific rule with the general one. Across the corpus 59 elements lose an edge margin, among them an Ask's options at the foot of a page (14px) and a first heading inside a wrapper at a frame's top.

notes/workspace-followups.md drops the three findings from #19's follow-ups; the rail findings stay. The catalog stills are refreshed.

Tests: uv run pytest tests and npm run test:runtime pass; pre-commit clean. Tests that measured a grid wider than the column now declare the width; the stacked-workspace and edge-trim cases have their own tests, and #1173's Ask tests pass on the general rule.

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

🤖 Generated with Claude Code

max-sixty and others added 23 commits September 24, 2026 13:25
A research note: what layout Leaf has to own (frame, margin, scrolling,
block room, preferences) versus composition, five options from a bare
frame to templates, a recommendation for agent CSS with declared roles,
and the authoring comparison that would decide it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A Leaf page is now one kind: a stack of blocks in the reading column, where
a block that needs room declares it, `data-width` on `main` widens the whole
page, and a workspace that is main's only block holds the window.

Behavior that moved:

- `lf-workspace` declares `x-space: "available"`, so it takes the room the
  page shell leaves wherever it stands. A page whose `main` holds only a
  workspace now holds the window with no width on main; `version check` no
  longer refuses it (`workspace_sheet_errors` is gone). The held-workspace
  rules key on main's only block rather than on `main[data-width]`. A page
  that declares `main[data-width]` keeps its presentation (wider pad, 1600px
  cap, larger title). An embedded workspace among other blocks now grows past
  the column like a diagram.
- An `lf-grid` track template stacks exactly where its narrowest track would
  fall below 16rem: 16rem x (sum / narrowest fr) plus its gaps. The grid
  states that width as its font-size and one container query asks
  `width < 1em`; the cells take back the font-size of the grid's parent.
  Before, templates were rounded up to integer scales, so `3fr 2fr` and
  `5fr 3fr` stacked at 51rem like `2fr 1fr`, and `2fr 1fr` itself stacked at
  51rem rather than 49.5rem. The playground split and swipe deck restate
  49.5rem.
- `version check`'s layout advice reads stylesheets the page links from
  `page/` (and what they import), through the revision capture's new
  `RevisionArtifact.page_stylesheets`, and names the file in each line.

The guide's "Composing a page", SKILL.md, the glossary (which also drops the
Threads panel's stale strip beside a wide page), registry descriptions,
package guidance, theme comments and tests say "wide page" where they said
"sheet". The How it works Layout tab is rewritten around one page kind, the
chrome's fixed reservations and overlays, and element / attribute / class
roles, drawn as inline SVGs with commentable parts. notes/layout-approach.md
is retired now that its decision has landed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The tab's drawings used page-local classes for every mark; #1155 put the
generic set in the theme. They now take svg.drawing's classes, and keep
page-local rules only for the marks particular to them: the rail, a surface
drawn over the page, an attribute's outline, a split and a scroll thumb.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Behavior that moved:

- lf-grid templates stack at the grid's own floor, `--lf-grid-min` (14rem),
  the least a counted grid's column takes, rather than a separate 16rem:
  below floor x (sum / narrowest fr) plus gaps. `2fr 1fr` and `1fr 2fr` now
  stack below 43.5rem (were 49.5rem), `3fr 2fr` below 36.5rem, so a body
  beside its rail stays side by side in a 900px window with the margin rail
  showing. The playground split and swipe deck restate 43.5rem.
- The stacking decision moves out of CSS. The font-size / `width < 1em`
  container query leaked the stacking width into every direct cell whose
  own rule used em, % or `font: inherit` (a `.875em` cell rendered 693px
  text; lf-code, lf-chart and lf-diagram computed 792px). lf-grid.js now
  reads the grid's width through the runtime's size observer and marks
  `data-lf-grid-stacked` in the next rendering pass (writing it in the
  observer's own delivery raised ResizeObserver loop errors); the theme
  spans cells on that mark. A template painted at upgrade is judged before
  the frame paints it; a resize is judged one frame later.
- A page whose only block is a workspace is a wide page: the default
  package states the kernel's new `--lf-page-width` on body, and the kernel
  draws the wide frame (gutter, 1600px cap, larger title) once, from a
  style query on body, for either producer. The frame no longer depends on
  `main[data-width]` alone. Guides and the sole-workspace examples and
  fixtures now write a plain `<main>`.
- The covered-words render probe no longer stops at an absolutely
  positioned run: it goes on from the containing block, so a board that
  scrolls a column's count out of view also clips it. The triage board,
  side by side at 1200px now, was reported as drawing its count over a
  metric it never reaches.
- live-progress's checks table folds each verdict under the check's name,
  two columns instead of three, so it fits the rail at the 14rem floor.

The guide and How it works no longer say Leaf's chrome never moves the
page's content: a margin entry with no rail to stand in (one for a passage
in a pane, or a package's controls below the rail's breakpoint) still docks
into the flow.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…limb

Behavior that moved:

- Paper stacks every lf-grid template. The stacked mark is the screen's
  reading and no observer runs for the print layout, so a `3fr 1fr` grid
  that stood side by side on screen printed a ~190px rail below the floor.
  A container query cannot hold each template's own width without the
  font-size leak the previous commit removed, so print stacks them all.
- A template in a closed `<details>` is judged while closed: lf-grid.js
  skips only a grid with no width (not laid out), not one that is laid
  out but hidden, so the disclosure opens already stacked instead of
  painting one side-by-side frame.
- The covered-words probe continues from an absolute box's `offsetParent`
  only when that element is positioned. A static table or cell it may
  name stands below the real containing block, and clipping at it could
  hide a real cover; there the climb stops as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/references/page-authoring.md
lf-grid no longer declares `x-space: "wide"`, so in a column page a grid
takes the prose's width, as a paragraph does, and `data-width="wide"` or
`"available"` asks for more, as on a figure. On a wide page nothing changes:
the grid takes the page's width as any block does. In the blind layout
comparison, tiles and figures running past the prose's right edge was the
defect most named on Leaf documents (7 of 12 judgments).

At the column's 720px a counted grid of plain cells fits three 224px tracks,
so `columns="4"` of sections lays out three and one; a row of `lf-metric`
tiles uses the metric row's 9rem floor and keeps four. A `2fr 1fr` or
`1fr 2fr` template (43.5rem, 696px) stays side by side in the column.

The registry description and page-authoring.md say so. The feature gallery's
three charts take `data-width="wide"`; its metric row, template grid and
thread-title pair stay in the column. Tests that measured a grid wider than
the column now declare the width.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A root workspace holds the window from 720px wide, but a template grid in it
stacks at its own width: `1fr 2.4fr` below ~786px. Between the two, the
stacked panes still shared the window's height, so at an 820px window the
queue showed two tickets and the detail pane was cut off at its first
fields. The guide promises that where the window cannot hold the regions
the panes take their natural height and the page scrolls.

Stacked regions are no longer in view together, so a stacked lf-grid now
passes no height on (`--lf-passes-hold: 0`, min-height auto) and the held
grid's shared rows skip it: its panes take their natural height inside the
held workspace, and the page scrolls them. Side by side, nothing changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A frame trims the margin of its first and last child, but a bare wrapper
there (a section with no inset of its own) passed its own first child's
margin straight to the frame's edge. A detail pane whose body wrapped each
ticket in a section opened on the ticket eyebrow's 48px: an empty band
above the pane's first words, in two of three queue pages in the layout
comparison.

The trim now follows the edge down. A block the trim reached marks itself
as standing at that edge (`--lf-edge-start`, `--lf-edge-end`, registered,
not inherited), and its own first or last child is trimmed in turn. A box
that draws an inset declares the frame and trims what it holds the same
way, so following the edge into it trims nothing it would keep.

Behavior that moved: across the corpus 59 elements lose an edge margin,
among them an Ask's options at the foot of a page (14px) and a first
heading or eyebrow inside a wrapper at a frame's top. Two tests stood on
the old margins: the contents-map fixture needed 20px more end room to
scroll its last section to the reading line, and the chrome-collision probe
now keeps its two twins off the section's edge.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The stills follow the column-width grid and the edge trim. The backlog's
#19 follow-ups keep only the rail findings, since this branch fixes the
stacked-workspace split, the pane's empty top band and the grid past the
prose edge.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 93a859f into main Sep 25, 2026
5 checks passed
@max-sixty
max-sixty deleted the how-it-works-one-layout branch September 25, 2026 18:58
max-sixty added a commit that referenced this pull request Sep 26, 2026
…pper declarations (#1203)

Two simplifications of the page layout model, both agreed on the layout
review page.

## Page tabs are sections of one page

A page tab set rebuilt the 720px column on its header, strip and panel,
discarding `main`'s own width. So `data-width` on `main` half-applied to
a page of tabs: the gutters, title and rail changed while the content
stayed in the column. A sidebar beside the tabs demoted them to a framed
section.

Now the first `lf-tabs` placed directly in `main` is page navigation,
whatever else `main` holds. Its strip and panels are blocks of `main`
and take the page's width, column or wide, and a header or sidebar
stands beside them as on any page. A later or nested set is a framed
tabbed section.

- **Measured:** on a wide page with tabs at 1440px, the panel goes from
720 to 1325px and a `2fr 1fr` side track from 232 to 434px, matching the
same page without tabs.
- **`lf-tabs.js`:** root is "the first `lf-tabs` among main's children",
watched on main's children only. The whole-subtree observer goes.
- **Theme:** the column-rebuilding rules and the hand-built breakout for
a workspace-only tab are gone. A workspace alone in `main`, or alone in
a page tab that ends the page, holds the window under one rule.
- **Validators:** `markup.py` counts a page-navigation block anywhere
directly in `main` as the outline, and `misalignedSplits` reads grids
inside the shown page tab.
- **Corpus:** the generated corpus nests its tab set in a section, so
every panel's controls stay pressable.

## The edge trim needs no wrapper declarations

#1185 made a frame's margin trim pass only through wrappers declaring
`--lf-passes-block-edge`, so 14 examples and docs, three fixtures and
five default-theme widgets carried it. The trim now follows the edge
through each first or last child, as #1178 had it.

- **A box that draws an inset:** it declares its frame
(`--lf-block-frame`), as theme boxes already do. The case #1185
protected, a heading's 48px kept inside an undeclared padded section,
trims to 0 as soon as that section declares its frame.
- **A row that lays its children out side by side:** a flex row or grid
at a frame's edge would otherwise lose only its first item's margin. It
declares `--lf-holds-edge: 1` and the trim stops there. A new gate
reading, `splitEdges`, names a row that splits; no shipped or product
page has one.
- **Cleanup:** `--lf-passes-block-edge` is removed everywhere, and the
corpus is regenerated.

## Tests

- The gallery composition test asserts placement (alone, among other
blocks, nested).
- The inline-tab test nests its set.
- New tests cover a wide page's tabs sharing `main`'s width beside a
sidebar, and a page-tab workspace holding only where the tabs end the
page.
- The frame-edge test asserts the trim through bare, boxless and
padded-grid sections, plus the undeclared-padded-box advice.
- A split-row test covers `--lf-holds-edge`.
- Each new test fails without its change.
- The everyday suite, the runtime folds, and the render gate on all 24
authored pages and fixtures and the six product pages pass.

> _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]>
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