Repository navigation
Keep a playground's rail in view beside a tall stage - #3274
Merged
Merged
Conversation
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. 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. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
Since #3274 a playground's rail sticks beside its stage, bounded to the window's height and scrolling what it holds. In a short window that bound leaves a few lines of the rail. At 844×390 `data-explorer`'s workspace flows (below 480px tall), so its rail stuck at 252px, scrolled its 467px inside, and at the page's end stopped where the stage ends, cut mid-text, with "Build query" reachable only by scrolling inside the rail. Before #3274 the page scrolled down to it. The shared "Sticking blocks" rule in `layouts.css` now applies only in a window at least 480px tall, the height below which a workspace already flows. Below it every sticking block (a column's margin sidebar, a sidebar page's track block, a widget's track) flows with its holder and the page scrolls to everything it holds. `module-scroll-and-motion.md` states the threshold for package authors, and a new `leaf-dev stills` state, `playground-short-window`, shows `data-explorer` at 844×390 scrolled to the page's end: the rail whole with its actions, where base cuts it. Measured with `leaf-dev probe` (rail box / content height; submit at the page's end): - `data-explorer` 844×390: base sticky, 252 of 467, submit at 395–423, below the 390px window; now static, 467 of 467, submit at 181–209. The same under `--touch` and in Firefox. - `data-explorer` 1024×479: base sticky, 341 of 413; now static, submit at 270–298. - `alert-thresholds` 844×390 and 1024×479: base sticky and scrolling inside; now static, as before #3274. - 1024×500, 1280×600 and 1440×900 on both pages: unchanged. - Resizing `alert-thresholds` from 1024×520 to 1024×460 and back mid-stage keeps the alert being read at the same place. At 460, focusing the submit button scrolls the page to it (at 179–209), not the rail. The gate costs a short block its sticking in a short window. `pr-walkthrough`'s 59px track block and a 40px margin sidebar fit a 470px window, yet they now flow there. Keeping them would need a reading of whether each block fits its bound, which no CSS query gives. The same reading would decide `alert-thresholds` at 1024×500, where the rail still scrolls 581px within 380px, as #3274 accepted. Behavior changes in tests: the notification playground's flowing workspace at 1100×300 scrolls the rail's controls and instruction in the page again, as before #3274. The alert playground's tall-stage test also checks that at 844×390 the page scrolls to the submit button without scrolling inside the rail. Both fail without the change. > _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.
With controls beside each item in the preview (#2711), a playground's stage can run several windows tall, as
alert-thresholdsdoes. 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: flowholds:[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:
--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.mdstates the contract for package authors.Measured with
leaf-dev probeonalert-thresholds, scrolled to the middle of 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 --renderon the playground package reports no findings. A newleaf-dev stillsstate,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.