Repository navigation
Take no room for a sidebar the contents map has left, and drop the retired column variables - #1273
Merged
Merged
Conversation
…tired column variables 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 default package now owns this beside the rule that moves the map: 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 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 outline width. `--lf-sidebar-claim` was an alias for `--sidebar-max` with one reader, 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. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # TODO.md
leaf-agent
previously approved these changes
Sep 27, 2026
# Conflicts: # TODO.md
leaf-agent
previously approved these changes
Sep 27, 2026
# Conflicts: # skills/leaf/packages/default/theme.css
leaf-agent
approved these changes
Sep 27, 2026
max-sixty
added a commit
that referenced
this pull request
Sep 27, 2026
…d render where it changes (#1297) One measurement now decides what stands in a column page's margin: the rail, the contents map, the first sidebar and the sidenotes. The column moves off centre where a sidebar or note needs the room, and the render gate renders each page at the widths where its margin content changes. **Before**, each resident moved into the margin at its own threshold: - the rail was measured by script (about 960px); - the contents map was a container query at 848px; - a sidebar was a container query at 1296px; - a note was a container query at 1536px. The sidebar and note thresholds were pixel copies of tokens that assumed the default column, so a page that widened its column got a sidebar positioned off the window's edge. The gate reads at 1200px, so it never saw a sidebar or note in the margin. **Now**, `settleResidency` (margin-layout.js) reads the room beside `main` once a frame and writes the answer on `main`: - `data-lf-margin` holds one token per posture standing: `rail`, `map`, `sidebar` or `note`; - `--lf-shift` holds the column's offset, which the column Layout applies as a relative offset (layouts.css). It admits residents in order: 1. The rail stands where the room right of the centred column holds `--rail`. It never moves the column. 2. The first sidebar stands where the room on both sides together holds the rail and `--sidebar`. With a fine pointer, a sidebar holding the contents map stands as the map's spine (`--map`, 48px) where a full sidebar does not fit. It does the same where the map is all it holds, since a float would hold nothing. A map-only sidebar left in the flow takes no room there (#1273's rule, now keyed on the `map` token). 3. The notes stand where the room holds everything admitted so far and `--note`. Each element declares its postures in CSS (`--lf-resident`), so the media and Layout conditions stay in the stylesheet. The widths the script reads are registered lengths, so a page may restate them in any unit. A resident that a closed disclosure or an unchosen view hides takes no room, and a toggle asks for a new reading. One the page hides itself stays a resident, so a page can show it only once it stands in the margin. The stylesheet keys every posture on the tokens instead of `@container lf-shell` queries, and chrome-layout's `syncLayout` asks for the reading. With the default column (768px box), a sidebar reaches the margin from 1130px and a note from 1152px. A sidebar and a note together need 1416px. The column moves over by what one side lacks, so at 1200px a note page's text sits 168px left of centre. A page that changes its column's width gets thresholds that follow it. **First paint.** Residency is now decided by script, so a page whose residents stand in the margin paints with them in the flow and moves them on the first rendering frame. That is the trade chosen when measuring won over fixed widths ("layout waits one frame for script"). The bootstrap can't take the reading earlier: it is a classic script, and its first frame can come before the residents are parsed. Page CSS can follow the margin by keying on the tokens. The feature gallery's copied 1151px width became `main:not([data-lf-margin~="map"], [data-lf-margin~="sidebar"]) #bg-sidebar`. page-authoring.md documents the tokens, and the registry's sidebar and sidenote descriptions say when each stands. **Render gate.** The sweep now runs from 360 to 1920px and records the page's own residents at each width, without the rail, which holds only Leaf's markers. For each step where they change, the gate halves the step to the exact width and renders the page there in the light scheme. That is where each resident has the least room it will ever have. `version check --render` names those widths when it passes. The sidenote-in-a-clipping-box test that was strict xfail now passes, and the static test that compared the gate's 1200px to the theme's container floors is deleted. **Comment bar.** Above or below a passage, the bar's lane started at its first measured width, which a restored draft's words widen. A reloaded draft opened 292px further left than the same draft typed fresh. The start is now the compact control's minimum, so one draft opens in one lane. **The corpus is unchanged.** It still sets each example's body in one column page. Every example already gets the full gate, sweep included, in its own Layout through the nightly `test_page_fixture_renders`. A multi-Layout corpus would need the wide and workspace Layouts to work below `main`. TODO.md now says exactly this. Behaviour the tests pin moved: - `test_margin_residents_stand_where_the_room_beside_the_column_holds_them` derives each threshold from the tokens and checks one pixel either side. - `test_a_note_hangs_in_the_margin_where_the_room_holds_it`: at 1190px the note now hangs, with the column moved left. - `test_a_left_sidebar_uses_the_margin_until_the_page_needs_it_back`: its sidebar holds a line beside the map, so it still floats. A map-only copy checks that sidebar takes no room at 1100 and 1400px. - The contents-map widget test expects a map-only sidebar not to float. - `test_unchanged_margin_refresh_cost_is_bounded_by_refresh_count` allows one more read of `main` per refresh, for the residency reading. - `test_a_thread_beside_its_cluster_takes_the_room_to_the_visible_edge` removes the gallery's note, which would otherwise move the column at the width the case was picked for. - `test_the_render_gate_exercises_both_schemes_at_both_viewports` expects the margin renders after the four fixed ones. - New: `test_a_note_the_page_does_not_show_takes_no_room`, `test_the_render_gate_renders_where_the_margin_content_changes` and `test_a_draft_below_its_passage_keeps_its_lane_whatever_it_holds` (bug-back checked). Still open, in TODO.md: `data-rail="right"` reserves the rail at every width, so a phone keeps a 295px column. > _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]>
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 first sidebar that holds only an
lf-tocstays 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 aflow-rootbox it also kept the blocks on eitherside of it from collapsing their margins. On
feature-galleryat 1200px, the rendergate'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-tocisdisplay: blockwith no block margins, so the blocks on either side meet as they dowhen 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 docscopy 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-sidebarbelow a 1152px shell (its own@container lf-shell (max-width: 1151px), from #237), so there the gap only showsfrom 1152 to 1295px. Any other page with this shape has the gap from 848px.
layouts.cssno longer pins--lf-shift: 0pxand--lf-gutter-l. These were leftover from the column model #1246 retired, and they only fed
--lf-sidebar-free-left,which nothing read, and a
+ 0pxterm in the default package's outline width. The coretheme's
mainrule that set those two properties and--lf-sidebar-claimis gone.--lf-sidebar-claimwas an alias for--sidebar-maxwith one reader, the map's width,which now reads
--sidebar-maxdirectly.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_backnow 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_backassertedthe wrapper's display was
flow-root, which only stood in for "the wrapper cameback". It now asserts that the display is not
none.layouts.cssstill selectslf-paneby tag. The survey read this as a pane-depthinconsistency 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_flowsgoes red if the depthlimit is dropped. The tag is also the only mark present at first paint: on
alert-reviewthe runtime paintsdata-lf-reading-role450-650ms after first paint.That needs a first-paint, authored-versus-generated mark, so it is a
TODO.mdentryunder Shared definitions.
🤖 Generated with Claude Code