Repository navigation
Keep a sidebar page's track in view beside its body, in the Layout - #2636
Merged
Merged
Conversation
`layout-sidebar` left sticking to each page: page-authoring.md told authors to stretch the `aside` and stick the block inside it, and to leave a taller track in flow. Authors never see a short window, so pages stuck a track taller than a 900x600 window and cut off its end. The Layout now owns it. While the track stands beside the body it sticks a gap below the banner and any page tab strip, is held to the window's height, and scrolls what it holds; stacked, it flows with the page. Whether it stands beside depends on flex wrapping, which also follows the minimum the body's content declares, and no query can read that, so prepaint.js `residency` reads it across the boxes and marks the track `data-lf-beside` (the track declares itself with `--lf-resident: track`). Like the column's margin sidebar, the stuck track restarts the sticky-header slot and landing band for what it holds, keeps a focused control's ring room, and anchors no reading. A footer stands over the stuck track as the page's end scrolls up. The instruction no longer asks for page CSS: authors write no position, top, height or overflow for the track. The pr-walkthrough example drops its hand-written sticking, and the three eval rubrics that required it now fail a page that writes its own. A browser test holds the behavior at 900px, on a phone, and where wide body content stacks the track at 1440px; stills gain sidebar pages scrolled into the body in a short window. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…, register it Review of the first commit found four defects in the track's posture: - Two asides sharing the first row read each other as "beside" and stuck over the stacked body. The reading now counts only `main`'s own boxes, not other tracks. - A scroller's automatic minimum width is zero, so a track holding a wide block stayed beside the body after a resize from 1440px to 900px, though the same page opened at 900px stacked it. The stuck track keeps its content's minimum (`min-width: min-content`), so sticking never changes the wrapping it was read from. - The footer layered over the stuck track hid its last lines at the page's end. The reading now measures how far boxes after the track's line reach into `main` (`--lf-track-end`), and the track keeps that margin, so it stops above the footer. The footer layering is gone. - The stuck track, like the column page's margin sidebar, scrolled without being a reading region, so `scrollerFor` answered the page for its words. `syncLayoutRegion` now registers every child of `main` the Layout marks `--lf-reading-region: layout`, each under its element's id or its place, and both sidebars carry the mark while they scroll. The workspace body's region id gains that suffix. One eval rubric also dropped its limit on the aside's height, which the Layout now bounds itself. The browser test adds the two-aside, resize, footer and reading-region cases. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review of the runtime reading that marked a track `data-lf-beside` kept finding cases where a sticky track still reached past the body: a second row of track and body, a footer whose height changed after the reading, and an authored `max-width` that made the reading oscillate once sticking raised the track's minimum width. Each fix needed another measurement, because the track was both the flex item that sets the row and the sticky scroller, and its sticking was contained by all of `main`. The track now runs its line's height, and the one block it holds is what sticks, scrolls and is bounded to the window. Contained by the track, the block can never reach past the body it stands beside, over a footer, or into the next row. Whether it is bounded is a container query on the track: a track beside the body takes about a third of the page, at most about 520px, while a stacked one takes all of `main`, so `width < min(70cqi, 45rem)` holds beside and fails stacked, whatever stacked it. The runtime reading, `--lf-track-end` and the startup work they added are gone; prepaint.js, content-layout.js and the assets AGENTS.md are back to main's. The cost is a markup contract: a track keeps its content in view only when it holds one block, as page-authoring.md's example already did; a track of several blocks flows, as before this branch. The track's size containment also stops a wide block in it from stacking the page; that block scrolls sideways. The instruction and the three eval rubrics now say to hold the track's content in one block. The block registers as a Layout reading region, and the generalised `syncLayoutRegion` reads a marked child of `main` or the only child of an unmarked one. Region ids are `lf-region:layout:<place>[:<element id>]`, so an authored id can no longer collide with a positional one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…n in both postures Review of the container-query posture found it misjudged real arrangements: a track the page widened to 44rem stood beside the body yet read as stacked, a capped track stacked under a wide body yet read as beside, and two tracks sharing a row became bounded scrollers above the body. A track's width does not say which flex line it is on; only the laid-out boxes do, and no CSS query reads them. The container also changed what the track's content measured against and dropped its minimum width. The track is no longer a container. prepaint.js `residency` reads it again (`data-lf-beside`): beside when one of `main`'s own boxes, not another track, stands wholly to one side of it. The structure from the previous commit stays: the track keeps its flex sizing and stretches to its line only while beside, and the one block it holds is what sticks, is bounded and scrolls, so sticking cannot reach past the line or change the wrapping it was read from. The earlier runtime version's footer, later-row and oscillation defects do not arise. The block is a Layout reading region in both postures, flowing when stacked, so the reader's place in it survives a change of posture; the column page's sidebar now is too. Region ids take the element's id where it has one (`lf-region:layout#<id>`), so a neighbour's removal never renames a region, and a place among unnamed ones otherwise (`lf-region:layout@<n>`). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e before a revision restores The final review of the track's posture found three defects and stale text: - Horizontal separation alone read a track wrapped onto the next line as beside the body. The reading now also requires the box to be level with the track, sharing its flex line. - An unnamed block took a positional region id, so removing a neighbouring track renamed it and lost the reader's place. The block now takes its track's id where it has none of its own. - A revision that replaced the track restored the reader's place before residency marked the replacement beside the body, so the block did not yet scroll and the place landed in the page. `land` in version.js now reads residency (`settleResidency`, content-layout.js) before chrome layout registers regions and the view is restored. A browser test holds it, and fails without the call. - The arrangement-eval repair fixture and two eval headers still described hand-written or track-level sticking. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review found border-box overlap still misread flex lines: a body pushed down by its own top margin shares the track's line yet did not overlap it, and a wrapped track pulled up by a negative margin overlapped a line it was not on. A flex line holds its items' margin boxes, so the reading compares those. It also returns before measuring anything on a page with no track. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review found the margin-box reading still missed a shared line and counted boxes that are not flex items: - A track stretched only once marked beside, so where the page left its flex line spare height and aligned the body to its end, the unstretched track and the body were not level and the track was never marked. A track holding one block now always runs its line's height; stacked, alone on its line, that is its own height, so nothing changes there. - A body inside a `display: contents` wrapper was missed, and an absolutely positioned one was counted. The reading now flattens a child that draws no box and skips one taken out of the flow. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… stickiness After merging main, a revision that replaced a sidebar track lost the reader's place in its block again. Main's reading place (#2624) skips words in a stuck box, and `stuckBox` walked up past the scroller being read: the track's block sticks beside the page and is also the region's scroller, so every line in it read as stuck, the place fell back to a raw offset, and a raw offset only returns to the same element. `stuckBox` now takes the scroller it is asked about and stops there, since a sticky box around a scroller rides with none of that scroller's scrolls; `capturePlace` passes it. The column page's margin sidebar, also a sticky scroller and now a region, gets the same. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/assets/runtime/content-layout.js # skills/leaf/assets/runtime/prepaint.js
leaf-agent
approved these changes
Oct 12, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
Only a track block standing beside the body opts out of scroll anchoring, as #2636 set it; the merge of the sticking blocks had moved the opt-out onto every track block, so a phone reader's place in a stacked track jumped when content above it in the block grew. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
With controls beside each item in the preview (#2711), a playground's stage can run several windows tall, as `alert-thresholds` does. On a column page the rail beside it, which holds the page-wide controls, the instruction and the submit button, scrolled away above the stage. At 1024x768 the submit button sat 1,800px above the window once the user reached the last alert. A workspace playground (#3141) already fits the window, so only a stage that runs past the window lost its rail. The rail now sticks as a sidebar page's track block does (#2636), through the same rule rather than a copy of it. The playground wraps its controls and instruction panes in one generated box marked `data-lf-track`, and the Layout's "Sticking blocks" rule now covers a widget's track as well as a column's margin sidebar and a sidebar page's track block. The track sticks below the head room, takes at most the window's height and scrolls what it holds beyond that. The playground registers the rail as a reading region, since it may scroll. A sticking block flows with its holder wherever `--lf-track-posture: flow` holds: - Where the playground stacks the rail with its stage, below 43.5rem and on a phone, as a stacked sidebar track flows. The rail then draws no box. - Inside a box that scrolls on its own (`[data-lf-scrolls]`) or inside another sticking block. The block's height is the window's, so inside a shorter scroller its foot, and the submit button, would be cut off until the stage ended. A workspace playground's rail flows for this reason too, since its workspace already bounds it. Two changes to the shared rule reach the existing sticking blocks as well: - Its height now subtracts the top it sticks at, so under a page tab strip its foot no longer runs behind Leaf's floating row by the strip's height. - It declares `--lf-holds-height: 1`, since it holds the window's height on purpose; the widget quality check named the rail otherwise. `module-scroll-and-motion.md` states the contract for package authors. Measured with `leaf-dev probe` on `alert-thresholds`, scrolled to the middle of the stage: - 1440x900: base controls top -988, submit -562; now 24 and 450. - 1024x768: base controls top -1537, submit -1038; now 24 and 523. - 1024x500: the rail is bounded to 380px, scrolls its 581px, and focusing the submit button scrolls the rail to show it. - 1024x500 under a 48px strip: the rail runs 72 to 404, above the floating row at 428. - The Ask made a 420px scroller: the rail flows, as on base. - 390x844: unchanged, with the rail after the stage. The workspace playgrounds (`data-explorer`, `notification-playground`, `code-comparison`) keep identical region geometry at 1440x900, 1024x768 and 800x520. A sidebar page's track block and a column page's margin sidebar still stick at 24px, in Chrome and Firefox. `leaf package check --render` on the playground package reports no findings. A new `leaf-dev stills` state, `playground-tall-stage`, shows the rail beside the last alert where base shows empty space. Behavior changes in tests: a new test holds the rail and submit button in the window while the user works the last alert, with the rail flowing at phone width. It fails without the track rule. The notification playground's flowing workspace, at 1100x300, now scrolls the controls and instruction in the rail beside the stage rather than in the page. > _This was written by Claude Code on behalf of max-sixty_ 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.
page-authoring.mdtold authors to hand-writealign-self: stretchandposition: stickyon a sidebar page'saside, and to leave a track taller than the window in flow. Authors never see a short window, so in the plain HTML comparison every Leaf document stuck a track taller than a 900×600 window and cut its contents off.The Layout now owns this. When a
layout-sidebarpage'sasideholds one block and stands beside the body, that block sticks just below the banner, is held to the window's height and scrolls its own contents; the track stretches to its row so the block sticks inside it and never runs over a footer or a later row. Stacked, on a phone or where the body's content needs the page's width, it flows as before. A track of several blocks keeps flowing, so pages that list several panels in the track don't gain sticking.Whether the track stands beside the body is a startup layout reading in
prepaint.js(residency, which already places the column page's margin sidebar): it marks the trackdata-lf-besidewhen it shares a flex row with the body. No CSS can tell which flex row an item landed on, and a sticky flex or grid item is contained by the whole container; a container-query version misjudged real arrangements. It returns at once on pages without a track; onpr-walkthroughat 900×600 the requests before presentation are unchanged and the bytes grow by about 3.5 KB. A revision reads the posture before restoring the reader's place, andstuckBoxstops at the scroller it is asked about, so the reading-place code doesn't treat lines inside the stuck block as stuck. The block, and the column page's margin sidebar, are reading regions in both postures.page-authoring.mdnow says the Layout keeps the track in view and that authors hold its content in one block and write no position, offset, height or overflow for it;pr-walkthroughdrops its hand-written sticking, and three eval rubrics and the arrangement-eval fixture follow the new contract.Reviewed by eight independent passes, each fix re-reviewed; browser tests cover the track beside, stacked and wide-content stacked, and a revision keeping the reader's place.