Repository navigation
Add a page of parts: lf-parts, each part laid out by its own Layout - #3198
Merged
Merged
Conversation
A page whose subject has several views, such as a playground to try beside the proposal it argues for, now writes one lf-tabs in a main that carries no Layout, and gives each lf-tab one child carrying that view's Layout. The list of views stands in a column down the left, sticky and in one place whichever view is open; the open view takes the rest of the width, and its Layout arranges it as it would main. On a phone the title, the list and the view stack. This replaces the root page tab strip, the sticky row that stood over a column page and made every view share that page's Layout. - layouts.css: a Layout's box may be a child of a view (`main > [data-lf-views] > * > *`), so the view is the shell its column centres in. "A page of views" lays out main as the list column beside the open view, with what the page writes before the set (its title) over the views at the reading measure. - prepaint.js: `layoutBox` finds the shown box in the open view, and the margin pass states the shell's left edge (`--lf-shell-left`) for a resident fixed to the window, as the contents map is. content-layout.js re-reads the margin when a view is shown or hidden. - lf-tabs.js: the root set of a main with no Layout is "views": its list runs down beside the views, and each view keeps its own place, as page tabs did. Every other set, a root set in a main with a Layout included, is a framed box. The page strip's root header (`--lf-root-headers`) and its styles are gone. - lf-toc.js: an outline is of the view that holds it. - structure.py: delivery's root `data-lf-layout` names every view's Layout. - Docs: page-layout.md gains "A page of views"; page-authoring.md and the lf-tabs and lf-tab entries point at it. - how-it-works, the feature gallery and the root-tabs fixture are pages of views now, each view a column; the gallery's views each take their own contents map. Tests: a new browser test holds a column view and a workspace view to the geometry of a page of their own Layout as wide as the room beside the list (it fails without the views level in `layoutBox`), and the tab tests cover switching, places, history, wide evidence and stuck headers in views. The page strip's tests, of a strip over the document, go with it: a box set's strip does not clear landings or pins under it on main either. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The page-of-views arrangement applied to every views holder directly in main, so a second root set's list and panels stood over the first's. It now applies to the first holder, the one lf-tabs and layoutBox read. A revision that takes the Layout off main, or puts one on, left a kept tab set in its old flow until reload. The set now watches main's class, and redraws its strip in the new orientation, keeping the open tab. Tests that built page tabs on a column page now build a page of views (views_page in model_folds.py), and an eval scores agents writing a page of views for a playground beside its proposal (Claude Code: base 0/3, candidate 3/3). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # docs/how-it-works.html # skills/leaf/kernel/kernel.json
A strip redrawn for a new flow dropped the focus of the tab the user stood on, so the arrows stopped walking it; the redraw now puts focus on the same tab in the new strip. A second root set before a third matched the preamble rule and stood over the page's title; the preamble is now only what stands before the first views holder. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # examples/corpus.html # examples/developer/feature-gallery.html # skills/leaf/kernel/kernel.json # skills/leaf/packages/default/styles/tabs.css # skills/leaf/packages/default/theme.css # skills/leaf/packages/default/widgets/lf-tabs.js
…tage still A page of views made every view at least the window's height under the page's title, so every page scrolled, and a full-height workspace stood a title's height below the window's foot. The view now fills the row the title leaves: the list, the window's height, sets the grid's height, a short view leaves nothing to scroll, and a workspace view takes exactly what is left. The open view's row was marked only by the name's raised face, which does not show on the page's ground the list stands on; its whole row is now raised and marked at its edge. A playground's stage centred its artifacts when the rail held it taller, so a control that changed an artifact's height moved every artifact on the stage. The stage now starts them at its top, reversing the centring the stage's header recorded. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…its line A review against the layout and motion rules found the views list's selected row broke the visual grammar: a raised card with a one-sided accent stripe on a rounded box, a second face for the one state every tab strip already shows. The list now stands on the strip's ground like every other set, and the shared open-tab face gains a 1px contour. Its fill alone barely parted from the strip's ground, and in the dark scheme the card is darker than the field, so the open tab of every set was marked only by its ink. The title over a page's views took the page's start padding, 72px above a line whose list starts 16px down; it now starts level with the list, so a workspace view keeps that height. The list keeps its fixed width: sized to its content it would widen when the runtime draws it, moving every view after first paint. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/kernel/kernel.json
main brought the playground-as-workspace change (#3141), which put a playground's supporting reading in page tabs inside a full-height workspace and taught page tabs to pass that height to a one-block tab. This branch removes page tabs, so the merge drops those height rules, and the guidance, the playground's author instructions and code-comparison put the reading in views of its own: the Compare view is the workspace, with density-working on its own box, and the reading view is a column at the column's type. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…aint main's #3143 marked a workspace page tab's only block in prepaint so its first-paint height rule needs no structural selector. This branch has no page tabs, so the merge drops the marker, its rule and its test, and adds the views form of that test: a workspace view fills the height the title leaves before the runtime upgrades the set, and nothing moves when it does. That test failed: the list, whose window height the grid relied on, is drawn only at upgrade, so before it the workspace view collapsed to 8px. main again states the window's height as its own minimum. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…dow's height The user chose to put the page's title atop the list of views rather than over every view. The title now heads the left column and the list stands under it; the open view takes the rest of the width from the top of the window, so a workspace view gets the whole window and every view, whatever its Layout, starts level with the title. Both title and list stick while a long view scrolls. CSS cannot stack one sticking box under another of unknown height, so prepaint measures the title (`--lf-views-title-h`) and the list sticks below it; without that the list rose to the top as the title scrolled away and moved on every switch between a read view and an unread one. The theme sets the title as the column's heading (`--lf-views-title`), as it sizes a wide page's h1. The list stands on the page's ground with the title, and the open view carries the rule between them, from first paint. A view never read now opens at the page's top, beside the title; the landing edge a sticky header pins at is the title's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
main's #3137 drew a page tab's focus ring on a box above what the tab holds, since a playground's stage painted over the ring on the panel itself. A view has the same shape, and the focus-ring sweep found the same fault on code-comparison's Compare view, so views take the same rule. The page-tab height rules main touched stay deleted with page tabs. Two journeys still named the feature gallery's single contents map and sidebar (`#bg-contents`, `#bg-sidebar`), which this branch split into one per view; they now name the open view's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
main's #3158 renamed what Leaf called an ask (protocol 9). The views code and docs take the new names: `itemsIn` and `answerWords` in the list of views' outcome marks, "items" in its comments, and "On me list" where the views share the page's state. how-it-works and the feature gallery take main's prose edits on top of their conversion to pages of views; the words each now differs from main by are exactly the conversion's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
main's #3100 made the floating panel Leaf's only chrome: the banner is gone, its height is now the head room (`--lf-head-room`), and nothing stands over a page's top. The views code takes the new name: the contents map stands under the head room, the page's covered top is the head room alone (page tabs' root headers left with page tabs), and its comments say the title and list stick at the window's top. how-it-works is converted to views again from main's text, and the feature gallery takes main's edits to its chrome guide. The package reference names `--lf-column-shift` as a runtime output, since `--lf-root-headers` no longer exists. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A page whose parts each want a Layout of their own is now `lf-parts`, with `lf-part` members, rather than the first `lf-tabs` in a `main` that carries no Layout. Page tabs are back as they are on main: the first `lf-tabs` in `main` is the page's strip across the top, whatever Layout `main` carries, and `docs/how-it-works.html` is on them again, since its header is the one the site's pages share. The markup now says which arrangement a page uses, so the tab module no longer reads a CSS property on `main` to decide or watches `main`'s class to switch. `lf-parts.js` defines the element as the tab set's class with a different member tag; `lf-tabs.js` keeps the one implementation. The registry's `x-views: "parts"` paints `data-lf-views="parts"`, which is what layouts.css, the prepaint's Layout box and title, the residency watch and the contents map read, so no core file names the package's tag. Behavior changes: - The views tests become parts tests (`root-parts.html`), and the page-tab tests, fixture and helpers return to main's. - A part's list carries summaries but not groups; `lf-part` has no `group`. - A part's start is its own top, so a part left at the top keeps no place. - The feature gallery's three suggestion forms each take a line, which also keeps the Replace suggestion's focus ring clear of "Insert.". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…here as a row The feature gallery's header held its lede and a long guide, so in the list's column it pushed the list of parts below the window's fold, leaving one name in view; they now open its first part. Parts embedded below `main`, as the corpus embeds each example page, drew their list as a window-tall sticky column over nothing; the column, its stickiness and the part's rule now apply only where layouts.css lays the parts out, and elsewhere the list is a strip's row. The parts eval passed 3 of 3. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review findings on the page-of-parts change: - On a phone the list of parts was a static row above the part, so reaching another part meant scrolling above the open one's start, and leaving from there erased its place. The row now sticks over the part as the page tabs' strip does: it joins the root's sticky headers while it stands over the part (`#declareHeader`, measured from the strip's geometry, re-read on resize), what sticks inside the part stacks under it, and a part's start is measured below it. A phone test covers reaching, place and landing. - `page check` refuses `x-views: "parts"` in a `main` that carries a Layout (`parts-in-layout`). The JS took such parts for the page's, the CSS did not, and the render check passed the page. - `page_layout` reads the registry's parts mark rather than lifting every Layout two levels under any child of a Layout-less `main`. - The feature gallery is back on page tabs as on main, since all its views share one column; it gains a live sample of a page of parts. The code-comparison parts' id says parts. - Groups never apply to parts, so their run and label rules name side lists only. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 20, 2026
# Conflicts: # skills/leaf/kernel/kernel.json # skills/leaf/packages/default/widgets/lf-tabs.js
leaf-agent
previously approved these changes
Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 20, 2026
# Conflicts: # skills/leaf/kernel/kernel.json
leaf-agent
approved these changes
Oct 20, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
`test_bundled_widgets_meet_the_widget_quality_checks[default]` fails on main with `keeps-first-box` findings for `lf-parts` and `lf-part`: an embedded page of parts drew every part stacked under its label until the module upgraded it, then collapsed to a row of names over the open part (workspace pane: 1150x105 first, 1150x67 presented). The failure is deterministic and dates from #3198, which added `lf-parts`. The test is in `tests/journeys/`, which only the daily run reaches, and the last daily run predates #3198, so no CI run has hit it yet. ### What changes - **Theme (`styles/tabs.css`, generated `theme.css`).** Before upgrade, every placement shows only the part the module will open, unlabelled and unpadded, with one empty strip row over it, so an embedded `lf-parts` paints its final box. The page's own `main` keeps its layout from layouts.css and drops that row except on a phone, as before. - **`lf-tabs.js`.** Parts are the page's navigation only in a `main` that is no Layout's box, read from `--lf-layout-box` as layouts.css and the prepaint read it. Before, parts in any `body > main` counted as root, so in a Layout `main` (which `page check` refuses, and the report's column wrapper uses) the module drew a vertical list with summaries that the theme laid out as a row. Valid pages are unaffected. ### Checks - The failing test passes for every package parametrization, along with the parts tests in `browser/widgets/test_tabs.py`, `browser/controls/test_rings.py` and `browser/test_render_pages.py`. - `leaf-dev probe` with `leaf.js` held: embedded parts in a column section and in a workspace pane, at desktop and at phone width with touch, paint the same box before and after upgrade. `code-comparison`'s root page of parts paints the same first box as on main, at desktop and phone width. ### Left open The reserved row is `--lf-tabstrip-h`, which resolves on `:root`. A page that overrides `--aim-floor` on an ancestor of the parts would get a taller strip than the reserve. The `lf-tabs` reserve has the same limit, and no shipped CSS overrides `--aim-floor` below `:root`. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
… failures (#3305) `test_page_fixture_renders` failed on main for ten corpus pages with three kinds of finding. Each is fixed at its owner; all ten cases pass here, run one at a time. - **Workspace header past the column** (alert-review, data-explorer, rust-sort, wt-merge, at 360-680px). Under 720px wide or 480px tall the workspace header sticks at the window's top and covers the 12px gutters beside it (#3271). It covered them by widening its box with `margin-inline: -12px` and padding its content back in, so its box stood 12px past the column. #3300's width sweep reported it. The header now paints its ground over the gutters as two shadows offset by the gutter's width, which the workspace names once as `--lf-workspace-gutter` for both its padding and the shadows. Screenshots of the stuck header at 360, 390, 540 and 680px in both schemes, at 800x400, and in Firefox at 390px are pixel-identical to main. A tap in a gutter beside the stuck header now lands on the workspace's own padding rather than the header, and neither does anything. - **A thread opening that never answered** (feature-gallery, and the corpus page that embeds it: 120 s, then a failure). The render gate opens each thread whose messages carry markup with `travel: false`. The gallery's workshop thread has its passage in the Threads tab, which the page doesn't open on. The floating panel declines a thread about a passage, so the margin card took it, and the card's placement waited for a margin row the closed tab hid. `travel: false` promises to keep the page where it is while revealing the destination; the card path was the one path that skipped the reveal (`thread/destination.js`). It now reveals a hidden passage first, unless the caller passes `scroll: false`, since switching tabs scrolls the strip to the new tab's name. Where the passage stays hidden, by a closed tab under `scroll: false` or by the page itself (`hidden`, `visibility: hidden`), as the card reads it (`visibleTargetParts`), the card has nothing to stand beside, so the opening leaves the thread to the floating panel, as it does for any thread nothing on the page shows. Such an opening had waited forever. A passage already in view is not revealed, so an open tab's strip stays where the user scrolled it. - **Held scrollers** (code-comparison, root-parts, the feature gallery's page-of-parts sample). A page of parts' list sticks under the title at the window's height and scrolls its own names (#3198), as a sticking block does, but didn't declare `--lf-holds-height: 1`. It now does. Nothing it draws changes. Tests: the phone workspace test now asserts nothing stands past the column with the header stuck. `test_opening_a_thread_reveals_its_closed_tab` covers both opening routes, `test_a_thread_whose_passage_stays_hidden_opens_in_the_panel` the closed tab under `scroll: false` and a passage the page hides, and `test_a_thread_in_view_opens_beside_it_and_leaves_the_tab_strip` the strip. Each fails with its part of the fix removed. `pnpm run test:runtime` passes. The card's placement itself still waits for a passage that is never drawn when it is opened outside `openPageThread`, as when a revision moves an open card's passage into a closed tab (`margin-projection.js` calls `showPreview` directly there). Letting the card answer "can't stand here" would end that wait at its owner, but a travelling opening opens the card before its trip reveals the passage, so "not drawn now" means "can't stand" only once the trip reveals first, which moves where it captures its return place. That reordering isn't part of this change. review-queue's and rust-sort's resize journeys each failed once under load with a keyboard stop 1px off after a resize, and passed on every other run (review-queue 4 of 5). > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 18, 2026
…waiting row with On Me's tray (#6152) A page of parts lists its parts down the window's left edge, each row with its part's summary. A side list of tabs also shows, under each summary, the state of the questions its panel holds: an open mark while one waits on the user, "On <agent>" while it is the agent's, and a check with the answer's words once answered. The parts list showed none of that, so a page of parts with a question per part read the same untouched, answered, sent back and reopened. This draws the side list's state for parts too. On a phone, where the list is a one-line row of names, it is hidden as the summary already is. It also changes how both lists mark a question waiting on the user. That mark was a lone open circle under the summary, which Max read as an empty list bullet. A waiting row now ends its name's line with On Me's tray, the panel's symbol for what waits on the user, and the line under the summary holds only the answer or whose turn it is. The tray keeps its room in every state, as the line does, so answering moves no row and a long name wraps the same either way. An accent dot (Leaf's mark for an unread reply) and a mark before the name were tried and dropped. The gap was not a decision. Side lists got the line in #2633, before parts existed; #3198 added parts and moved the summary's condition from `side` to `down`, leaving the state line on `side` with no reason given. To weigh: - A page of parts is the page's navigation, and a side list is the documented shape for one decision per item. This puts a second display of what On Me already counts on a surface whose job is to say what each part is. For a part holding many questions the tray stays until the last is answered. - Leaf's symbols otherwise mark controls; the tray here marks state, in the summary's grey, and the row is pressed as before. - Cost on a large page: #6151, now on `main` and merged into this branch, files a reading's obligations under their regions in one pass (`obligationsByRegion`), and the parts list takes that pass. Measured before it landed, with the two combined locally: a part switch on 400 parts with a question each takes 5.7 ms in Chromium, against 3.7 ms with no state line and 36.7 ms on the per-row path this change would otherwise have joined; from 100 to 400 rows the time grows 1.8 times. It came out of comparing the `visual-review` widget with a page of parts for the same six cases, where this gap was most of the widget's lead. Max didn't ask for it; he read the before/after captures, asked for the lone circles to go, and accepted the tray. Checked with `main` merged in, with a new browser test covering an untouched part, one answered through its widget, one the user commented on, one reopened by undo, a part that asks nothing, and the phone row; each piece of the change has an assertion that fails without it. The existing parts and side-list tests, the browser type check and `pre-commit` pass. Before and after captures at three widths in light and dark differ only inside the list column; the desktop pair is in a comment below. > _This was written by Claude Code on behalf of max-sixty_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A page whose parts want different Layouts, such as a playground to try beside the proposal and reasoning behind it, can now be a page of parts. It is a
mainwith no Layout holding aheaderwith the page's title and onelf-parts. Eachlf-partholds one child carrying that part's own Layout (layout-workspace,layout-column,layout-sidebar). The title and the list of parts stand in a column down the left, and the open part is laid out beside them as a page of its own would be at that width, from the top of the window. So a workspace part fills the window and a short part leaves nothing to scroll. Page tabs (the firstlf-tabsinmain) are unchanged, anddocs/how-it-works.htmlstays on them, since its header is the one the site's pages share.This started from the code-comparison example. Its playground was the page's main item but sat in a document layout, broken out of the column above the prose.
How it works
Element.
lf-parts.jsis a dozen lines: it defineslf-partsas the tab set's class (TabSet, exported fromlf-tabs.js) withlf-partmembers. The one implementation inlf-tabs.jsgives parts:summary;Everything else in
lf-tabs.jsis main's.Layout. The registry gives
lf-partsx-views: "parts", which delivery paints asdata-lf-views="parts"before the first paint. Every core reader keys on that mark, so no core file names the package's tag:layouts.csslays out the title, the list and the open part, and treats a part's child as a Layout box;prepaint.jsfinds the Layout box and measures the title, so the list can stick under it;content-layout.jsreads the mark too;lf-toc.jsoutlines the open part;page_layoutreads the mark from the registry.Phone. The title scrolls away, and the list becomes a row that sticks over the part as the page tabs' strip does: it joins the root's sticky headers. So each part keeps the reader's place and links land below the row.
Check.
page checkrefusesx-views: "parts"directly in amainthat carries a Layout (parts-in-layout). That page otherwise renders with two Layouts fighting and passes the render check. Parts placed anywhere else, as the corpus embeds example pages, list their names in a row.Open tab face. A box set's or side list's open tab gains a 1px inset contour, since its fill alone barely parted from the strip's ground, least of all in the dark scheme. Page tabs keep their underline.
Pages and docs
examples/code-comparison.htmlis a page of parts: a workspace part to compare and a column part to comment.#bg-parts).page-layout.mdhas "A page of parts".page-authoring.md, the registry instructions, the playground's author instructions and the glossary say when to use parts and when page tabs.Testing
test_tabs.py, fixtureroot-parts.html) cover:test_render_pages.pychecks the geometry of a page of parts.test_playgrounds.pychecks that an artifact that changes height leaves the stage where it stands.parts-in-layout.parts-take-their-own-layoutspassed 3 of 3; each run wrote anlf-partspage with a workspace to try and columns for the proposal and reasoning. It was 0 of 3 on main for the same request.check:browser, the parts, tab, ring and gallery navigation tests all pass.Left as is
lf-partsinto or out ofmainkeeps the list's first orientation until reload.