Repository navigation
Restart the sticky-header slot in any box that scrolls, and say a diff file's whole path on focus and hold - #1902
Merged
Merged
Conversation
A box that scrolls is the scroller for whatever sticks inside it, so a sticky header in it must stop at the box's own top. The theme states that restart (`--lf-top: 0px`) beside each box it makes scroll, and a box the page's own CSS made scroll had none: a diff inside it pinned its file header the banner's height (42px) below the box's top. The runtime already rewrites every rule of the page's own sheets through the CSSOM, to keep them off the layer's controls (`page-sheets.js`). The same pass now adds `--lf-top: 0px` to each rule that makes its box scroll on either axis, so the restart holds under exactly the selector and media conditions the scrolling does. A rule that states `--lf-top` itself is left alone, and so is one that also makes its box sticky, since that box's own `top` reads the slot. The pass is renamed `fitPageRules` for its two jobs. A column's sticky sidebar scrolls too and had no restart, so a diff in it pinned 42px down as well. It now restarts the slot and sticks at the value its column met (`--lf-top-outer`), the pattern a header's holder already uses. `test_any_box_that_scrolls_starts_the_sticky_header_slot_again` covers the page's box, the sidebar, and a page's sticky box that scrolls; each assertion fails without its part of the change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A diff's file row is one line whose path gives way from its folders, and the whole path was only the path's `title`, which shows to a pointer resting on it. A keyboard user standing on the row, or anyone on a phone, never saw the folders. The row now says the whole path in a box under it while the keyboard stands on it, and while a press is held on it. The box lies over the rows the row names, so nothing moves and the row keeps its stated height, and under the row it stays clear of the banner when the row is pinned. It wraps after the path's slashes, from a `data-path` copy of the path with a zero-width space after each one. The row and the file's frame let the box out while it shows, so a folded file and a short one show the whole path too. A held press shows it only after 300ms, so a click or a tap that folds the file does not flash it. The held press is the gesture reactions already use to say their word: press and hold to read, release to press, slide off to cancel. It moves out of `reactions.js` into `runtime/held-word.js`, and a control opts in by wearing the `lf-holds-word` class (`HOLDS_WORD`, also exported to widgets), which every reaction choice and each diff file row now wears. Releasing a hold on a file row folds or unfolds the file, as a tap does. `test_a_file_row_says_its_whole_path_to_the_keyboard_and_a_held_finger` covers the keyboard, a folded file, the hold, the release and a tap in Chromium; the iPhone test checks WebKit draws the same box. The reaction tests pass unchanged on the moved gesture. The sticky-header note's remaining bullet is resolved and removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The previous commit added the restart to the page's own stylesheet
rules. Review ran cases that approach got wrong:
- `html { overflow-y: scroll }` restarted the root, so every pinned
header slid behind the banner.
- A box made to scroll by one rule and to stick by another stuck at 0.
- A box made to scroll by an inline style, a `var()` or a script kept
the 42px offset.
Which boxes scroll is a fact about the composed box, not about rule
text, and the runtime already asks it of every box in the page and in
each declared shadow tree: `reachScrollers` (reach.js) sweeps them for
tab stops and containment. It now also marks each scrolling box
`data-lf-scrolls`, and one rule in shadow.css restarts `--lf-top` on the
mark at no specificity, so a box that states its own start (a workspace
pane's body) keeps it. The sweep starts at `body`, so the root keeps the
banner. It leaves out a text box, and a sticky box, whose own `top`
reads the slot. It reads each marked box again when layout moves it, so
a box that stops scrolling at another width drops the mark.
That makes the theme's own `--lf-top: 0px` beside a bounded block, a
table, a board and a text document's bounded listing redundant, and they
go, with the text document's `--lf-top: inherit` that undid one of them.
The workspace body keeps its own: it scrolls only past a width, and the
sweep finds a box scrolling when the box arrives. The page-sheets pass is
back to what it was. `--lf-bottom` still restarts nowhere, and theme.css
now says why: its landing-margin reader is read on a scrolling box
itself, so a restart there would let a landing on that box stop under
the reply row.
A diff's refresh copied a fresh render's attributes onto its kept `pre`
and dropped every other one, the runtime's paint included, so the sweep
put the mark straight back. It now keeps paint (`isPagePaint`, exported
to widgets). `module-authoring.md` no longer asks a package to restart
the slot on a box it makes scroll, only on one that starts scrolling
past some width.
From the same review, for the file row's path box: the file standing on
it rises over the files after it, whose row and press covered a folded
file's box. The test now has a second file and hit-tests the box. The
held-word header no longer claims a modifier pressed mid-hold presses
nothing; the browser's own click answers it.
`test_any_box_that_scrolls_starts_the_sticky_header_slot_again` now
covers a page rule, an inline style, the sidebar, a page rule on `html`
and a sticky box another rule makes scroll. Removing the mark's rule, or
the sticky exclusion, fails it; removing the z-index fails the path
test.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The previous commit deleted the theme's own `--lf-top: 0px` on bounded blocks, tables, boards and a text document's bounded listing, leaving them to the runtime's mark. The mark lands when `reachScrollers` runs, after presentation, and authored markup paints before that: review traced a sticky table header painting 42px down at first paint and jumping up when the mark landed, where main had it right from the first frame. Nothing the runtime writes can be in the first paint, so a box the theme makes scroll states its restart beside its overflow again, and the mark covers every box the page or a package makes scroll. The workspace body's comment about the mark goes with it, and `module-authoring.md` is back to asking a package to state the restart on a box it makes scroll. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The file row's whole-path box shows only in an interaction state, so the catalogue drives the first row in the walkthrough's exact patch whose path is cut short, on a phone, and focuses it from the keyboard. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Oct 6, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The lint job withholds approval: pre-commit rewrites held-word.js and the new scroller test, then exits 1. The focused browser tests passed, and I found no other actionable issue in this diff. Applying the formatter output will clear this review blocker.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 6, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 6, 2026
…r it (#1903) At 390px a side-list queue (`lf-tabs list="side"`) wrapped its list into rows above the open item. On a 20-item queue the list ran 629px and the first item started 770px down, below the fold. The theme already described the narrow list as "a row over" the item, but only the page's own strip was held to one row; every other strip wrapped. ### What changes - **Every tab strip is one row** (`skills/leaf/packages/default/theme.css`). A strip's names scroll sideways when they outrun it, under the edge presses the page strip already had. On the 20-item queue the list is one 70px row and the item starts 71px below the queue's top. A side list's column at desktop width still runs down. - **The edge presses follow the marks.** They show wherever the layer marks more names that way (`data-lf-more-before`, `data-lf-more-after`), not only on the page strip. They stick at the strip's edge rather than inside its inline padding (`--lf-tabstrip-pad`), and their fade uses the strip's own background. - **The open tab stays in the row** (`lf-tabs.js`). A walk, Home/End, or a press brings it in, including onto the tab already open, so Home is a way back after a swipe. So does any change to the strip's size: a narrower window, a panel opening beside the page, or a side list's column turning into a row. - **A narrow queue's first paint keeps its row.** A row's summary is a line of a stated height (`--lf-tab-summary-h`), and the reserved strip includes it where any row has a summary. - **The reserved margins sit under `:where`**, as the upgraded set's do, so a set at its frame's edge loses its margin at first paint too. ### Behavior that changed for the user - A framed tab set with more names than fit scrolls them sideways rather than wrapping them onto more rows. - A tab set first in `main` no longer jumps 24px up when it upgrades. - A side list's desktop rows are 1–2px shorter: the summary is now a 17px line with no 2px foot. - In a right-to-left page, ArrowLeft walks to the next tab and ArrowRight to the previous one, as the ARIA tabs pattern asks. Review found this while walking an RTL strip. ### Is there a more underlying fix? **Yes**, in two rounds. The first version of this branch fixed only the side list's narrow row. The queue was one case of a wider defect. The first paint keeps one row for every strip (`--lf-tabstrip-h`), every strip except the page's wrapped, and #1484 listed "names that wrap the strip onto a second row" as not reserved. A framed set with 20 tabs at 390px wrapped onto five rows and moved its panel 184px at startup. The fix makes one row a property of every strip and deletes the page strip's private copies of the scrolling and press rules, along with the "names that wrap" exception. The new first-paint case `tab-names-outrunning-a-phone` failed on the first version and passes now. Running it also exposed the 24px first-paint margin above. Review then ran the other routes to a strip that runs past its row, and three rules held only for the page strip, which never changes from a column and has no inline padding. The open tab came into view only when a tab opened. The presses sat 8px inside a padded strip. A row made from a column had no presses at all. The first two are fixed here, and each failed when run: taking out the size watch, the press inset, or the press on the open tab fails `test_a_tab_strip_keeps_its_open_tab_in_its_one_row`. The third is general rather than a tab-strip case. `reach.js` reads which boxes declare a scroll only when it sweeps them, so any box that a narrower window or a container turns into a scroller gets no stop or continuation marks. A plain `div` with `@media (width < 600px) { overflow-x: auto }`, loaded wide and narrowed, shows it. Re-running the sweep from lf-tabs would repeat reach's rule in one caller, and #1902 is changing `reach.js`'s `classify`. So this PR records the defect as a strict xfail (`test_a_box_that_starts_scrolling_at_a_narrower_window_takes_a_stop`) and leaves the fix to `reach.js`. Until then, a queue narrowed from a desktop width shows no edge presses until reload. Swiping and the keyboard walk still reach every tab. ### Evidence - `test_a_side_list_is_a_queue_beside_the_item_it_opens` checks that the phone list is one row that runs past. It fails against the old theme. - `test_a_tab_strip_keeps_its_open_tab_in_its_one_row` is new (above). - `test_a_widget_first_paints_the_box_it_presents` gains a framed set and a queue at 390px. Both failed before this change. - `uv run pytest` over the render, gate, widget-quality, pages, threads, anchors and chrome-contract files, selecting tab, strip, queue, side, first-paint, widget, reach and scroll cases, passes. `npm run test:runtime` passes. - `leaf-dev stills` (new state `alert-queue-touch`): the alert queue at 390px goes from a 14-row block before the first alert to one scrolling row over it. The other changed states are on pages without a tab set and differ by caret or timestamp pixels between runs. ### Not in this PR - "Let a queue group its items" stays in TODO.md. No convention in the registry or references settles its markup form, so it went to Max as a question. - Narrowing the window on `alert-review` switches the queue from the open alert back to the first one, on main as well. Version continuity's resize restore reveals a reading recorded before the switch, because lf-tabs brackets a switch with `preserveReadingRegions` only in page flow. #1897 is changing that continuity code, so this went to the coordinator. - `reach.js` re-reading which boxes scroll after a width change (above). > _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 7, 2026
…e moves them (#1953) The runtime's scroller sweep (`reachScrollers`, `runtime/reach.js`) decides which boxes scroll from their computed overflow. Three things depend on that answer: a keyboard tab stop, the edge marks that say more is off to one side, and the restart of the sticky-header slot `--lf-top`. Three defects found while landing #1902 and #1903 came from that answer, and this PR fixes all three. ## A box that starts scrolling after it arrives The sweep read each box's overflow only when the box arrived or was first drawn. A box that a media query, a container query or a script turned into a scroller later got no stop, no edge marks and no restart until reload. A side-list queue narrowed from a desktop window to a phone's width showed no edge arrows on its row of tabs. The sweep now reads a box again when an input to its computed style moves: - the whole page when the window resizes; - a size container's subtree when the size its queries read changes; - a subtree a module announces with `layoutChanged`, which is how a class a page script adds reaches it. Residency (`content-layout.js`) now announces `main` when it seats a resident, because the Layout makes a seated sidebar scroll. A sidebar loaded in the margin had no stop. A re-read waits until what asked for it holds still, per box, then sweeps the outermost due boxes once. A window drag therefore reads the page once when it stops rather than every frame (a sweep is about 28ms on the corpus). No sweep runs inside a size delivery, where it raised ResizeObserver loops. The settled reading counts a box's wait. A container that keeps moving for longer than a second is the exception, whatever moves it. It is playing, as a meter that pulses while work runs is, so it stops holding the page and waits 100ms still on a timer. For this, `sizeObserver` (`rendering.js`) gained `counted: false`. A box that stops scrolling gives back its stop and its restart. A style that moves with none of these inputs, such as a rule on `:checked`, is read only at the next one, because the browser announces nothing when it applies. ## A page tab panel the page makes scroll The tab strip stacked its height onto its panel's `--lf-top` with a selector that outranked the runtime's restart, so a diff in a panel the page made scroll pinned 113px down. The restart (`[data-lf-scrolls]`) moves from `shadow.css`, where it sat in the packages' layer at no specificity, to `state.css`, above packages and Layouts. A box whose slot starts somewhere other than 0 says so in `--lf-top-start`, which the restart reads. The workspace pane body and the thread list do this. `module-authoring.md` now tells package authors about `--lf-top-start` and `overflow: clip`. Two eval cases score that paragraph: - `package-scroller-headers-stand-on-its-edge`: base 0/3, candidate 3/3 (Claude Code). - `package-card-keeps-its-headers-pinned`: 3/3 on both arms, so it guards. ## An `overflow: hidden` box `geometry.js` counted `hidden` as a scroller when reading what sticky headers cover, and the sweep did not. The sweep, `scroll-motion.js`'s `scrollContainer` and `scrollsContent` (#1944), and geometry's header reading now share one predicate, `scrollsBy` with its per-axis `scrollport`. The undecided option card and a hidden page tab panel used `hidden` only to clip. That made the card the scroller a diff's file header in an option stuck in, so the header scrolled off with the page. Both now say `overflow: clip`, and the header pins under the banner. ## Behavior that changed - A box that starts scrolling at a shorter window, a narrower container, or after a module's `layoutChanged` takes a stop, edge marks and the restart once the layout settles. One that stops gives all three back. - A column sidebar loaded seated in the margin takes its tab stop. - A diff in a page tab panel the page makes scroll pins at the panel's content edge. - A diff in an undecided option pins under the banner as the page scrolls past. - A page that moves a size container for longer than a second reads as settled about a second later than on main. ## Is there a more underlying fix? Yes, and this PR makes it. The first version answered the reported cases. Review then ran other routes to the same answer, and each one failed until fixed here: - a sidebar seated by residency, which announced nothing; - a box a script inserts and announces; - a `layoutChanged` sent from inside a ResizeObserver callback; - an endlessly animating container that starved every re-read and kept the page from settling; - a finite transition that read settled before its sweep; - an animating sibling that resized a container. Merging main exposed a third copy of the scroller predicate in #1944's `scrollsContent`, which now reads the shared one. Still open, each run and confirmed: - a style flipped by a pseudo-class, or a class a script adds without `layoutChanged`, waits for the next resize or announcement; - a padded scroller that doesn't state `--lf-top-start` pins its headers below its padding. ## Tests - `test_a_box_that_starts_scrolling_after_it_arrives_takes_a_stop` replaces #1903's strict xfail. It covers each route above, a table drawn when its disclosure opens, a sidebar loaded seated in the margin, and a size container animating from load that a script announces, after which the page still settles. - `test_any_box_that_scrolls_starts_the_sticky_header_slot_again` gains an `overflow: hidden` box. - `test_a_diff_pins_to_its_page_tab_panel_or_past_an_option_card` is new. - Each fails with its part of the change taken out. That holds for all 15 parts tried, from the three re-read routes to the card's `clip`. - A render selection across the scroller, slot, tab, pane, option, margin and aim tests (926 tests): the only failures also fail on main. `npm run test:runtime` passes. > _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 7, 2026
#1902 added a box under a diff file's row that shows the whole path while the keyboard stands on the row or a press is held on it. It showed on every row, so a path the row shows whole read twice. It now shows only on a row that cuts its path short, and follows the row's width as the window resizes. ## How a row knows it cuts its path One `sizeObserver` (`runtime/rendering.js`) in `lf-diff.js` watches the path's two parts, the folders and the file's name, on every file row the diff keeps: from when a row becomes its file's row until a revision replaces it. Whether the row cuts the path changes only with their widths: a new window width, face, or press column. A delivery reads every row it names before writing any; a part counts as cut where a Range over its words is wider than its box, since `scrollWidth` rounds to whole pixels and Chrome draws the ellipsis for an overflow of a tenth of a pixel. While cut, the row wears `data-path-cut`, and every rule in the diff package's `shadow.css` that draws the box or lets it out of the row's clip requires it. A row that leaves the page stays observed and is collected with its observation; measured in Chrome, 2000 observed, detached rows return the node count to its baseline after a forced collection. CSS alone can't read this: `scroll-state` container queries aren't in WebKit, and a container query can't style the box that holds it. A row showing its whole path keeps the hold gesture, so releasing a long press still folds the file. ## The same cut, read by a pointer and by the room beside the path - The path's `title` follows the same reading: it is set only while the row cuts the path, so a mouse resting on a short path no longer gets a tooltip repeating it. Rename rows wrap rather than cut, so they have no title. - A file with a review press held open room for a comment press too, whether or not it had one. An inline patch under review has none, so on a 390px phone its row kept 184px of padding for a 110px bar and cut a path as short as `src/summary.rs`. The column is now the review press alone, or both across the bar's gap where the file has both. - The `walkthrough-path-keyboard` stills driver picks its row by `data-path-cut`. ## Tests - `test_a_file_row_says_its_whole_path_to_the_keyboard_and_a_held_finger` also checks that a short row shows no box and has no title, and that a focused long row loses both when the window widens past its path and gets them back when it narrows. Stopping the observer once a row reads cut fails it. - `test_a_phone_keeps_the_diff_file_name_and_the_sticky_header_height` (WebKit) checks that the row's padding is the press bar's width with its gaps. - `test_a_file_row_a_revision_brings_reads_its_cut_path` checks that a row a revision brings, a rename turned into a changed file with a long path, inline and as a manifest, wears the mark and the title. Dropping the watch where a revision replaces a row fails it. ## Is there a more underlying fix? Yes, and this PR makes it: the path's title and the room beside the path were the same defect by other routes, and both are fixed above. An independent reviewer compared the mark with the ellipsis actually drawn across widths 320–1490px, zoom levels, device pixel ratios, font swaps, hidden-then-shown diffs and WebKit, and found no mismatch. Still open, and older than this change: in print, the presses are hidden but their room is still held open, and a path cut on paper can't be read whole. > _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.
Closes the two sticky-header gaps in
notes/chrome-and-covers.mdand removes that bullet.A box that scrolls starts
--lf-topagain, whoever made it scrollA diff inside a box the page made scroll pinned its file header the banner's height (42px) below the box's top, because only the boxes the theme makes scroll restarted the sticky-header slot. CSS can't select "a box that scrolls", so the restart for every other box comes from the runtime's existing sweep of scrolling boxes (
reachScrollers,runtime/reach.js), which already marks them for tab stops and containment. It now also marks each onedata-lf-scrolls, and one rule inshadow.cssrestarts--lf-top: 0pxon the mark at no specificity:var()or a script that makes a box scroll all restart, in the page and in declared shadow trees;body, so the root keeps the banner; a sticky box is left alone, since its owntopreads the slot;The theme still states the restart beside each box it makes scroll (bounded block, table, board, workspace body and pane body). Nothing the runtime writes can be in the first paint, and with those declarations deleted a sticky table header painted 42px down and jumped when the mark landed. A column's sticky sidebar had no restart and pinned a diff 42px down too; it now restarts the slot for what it holds and sticks at the value its column met (
--lf-top-outer).--lf-bottomrestarts nowhere, andtheme.csssays why: its landing-margin reader in a thread's content is read on a scrolling box itself, so a restart there would let a landing on that box stop under the reply row.A diff's refresh copied a fresh render's attributes onto its kept
preand dropped every other one, the runtime's paint included. It now keeps paint (isPagePaint, exported to widgets).A diff file's row says its whole path to the keyboard and to a held finger
The row's path gives way from its folders, and the whole path was only in
title. The row now draws the whole path in a box under it while the keyboard stands on it or a press is held on it. The box lies over the rows below, so nothing moves and the row keeps its stated height. It wraps after slashes, and a folded or short file shows it too, over the files after it. A held press shows it after 300ms, so a click or tap that folds the file doesn't flash it.The hold is the gesture reactions already use to say their word: press and hold to read, release to press, slide off to cancel. It moves from
reactions.jstoruntime/held-word.js, and a control opts in with thelf-holds-wordclass (HOLDS_WORD, exported to widgets). Releasing a hold on a file row folds or unfolds it, as a tap does.Is there a more underlying fix?
Yes, and this PR makes it. The first version restarted the slot in the runtime's pass over the page's stylesheet rules (
page-sheets.js). An independent review ran cases it got wrong:html { overflow-y: scroll }restarted the root, so every pinned header slid behind the banner;var()scroller kept the 42px offset;Which boxes scroll is a fact about the composed box, which
reachScrollersalready reads for every box, so the restart moved there.test_any_box_that_scrolls_starts_the_sticky_header_slot_againcovers all five cases.Still open, each run and confirmed the same on main:
--lf-topon the panel outranks the mark, so a diff in it pins 113px down;overflow: hiddenis a sticky header's scroller but isn't marked; the default theme's undecidedlf-options[choose]card is one, so a diff inside an option pins to the card rather than the page.Tests
test_any_box_that_scrolls_starts_the_sticky_header_slot_again: a page rule, an inline style and the sidebar each pin the header at the box's top; the root keeps the banner under a page rule onhtml; a page's sticky box another rule makes scroll still sticks at the banner's foot. Removing the mark's rule or the sticky exclusion fails it.test_a_file_row_says_its_whole_path_to_the_keyboard_and_a_held_finger: keyboard, a folded file over the next file's row (hit-tested), the hold, the release and a tap, in Chromium;test_a_phone_keeps_the_diff_file_name_and_the_sticky_header_heightchecks WebKit draws the same box. Removing the z-index fails it.leaf-dev stillsgainswalkthrough-path-keyboard: a cut-short file row in the walkthrough's exact patch, on a phone, focused from the keyboard. It is the one state whose pair shows this change.