Repository navigation
Conversation
…m to the prose A document's contents map rests again as its spine and shows its labels over the page when the reader points at it, focuses into it or arms go-to. The sidebar now reserves only a 56px rail for it, so the prose starts beside the spine instead of a column's width away (#5619), without the blank strip the old hidden spine left and without #5637's always-shown labels. - A widget declares `x-rail` (a new `$marks` entry, painted `data-lf-rail`), and `lf-toc` does. On a screen under a fine pointer, a sidebar whose aside comes before a `layout-column` body and whose track holds only such an element becomes a rail: the aside takes `--sidebar-rail`, its track doesn't clip and carries `--lf-track-rail: 1`, the aside paints over the body and the body is isolated. Every other sidebar keeps a column's room: a track holding anything else, an aside after the body, any track under touch, and paper. Making every document sidebar a rail broke a paragraph in one into a few letters a line and passed the render check. - `--lf-sidebar-slot` is gone. `toc.css` takes the spine map only in a track the Layout marked as a rail and too narrow for words; the open outline in a track beside the body with room for words; the disclosure otherwise. The map follows the Layout's decision rather than its own width alone, so a narrow track a page asks for, which clips, folds the map into the disclosure instead of hiding labels the track would cut off. - At rest the nav's clip-path limits paint and pointer to the map's box in the rail, so the labels' 320px measure lays nothing over the prose; the reveal removes the clip and fades the labels in. The map stays in flow in the sticky track, so no clearance rule or fixed positioning returns. - `toc.css` places the map and the outline by logical sides, so both mirror on a right-to-left page. The resting clip flips there, since a clip path's insets are physical. - A row's thread and On Me marks moved beside its link, so they show at rest next to the spine. Behavior changes the tests now hold: the rail map's labels are hidden until the reader points, focuses or arms go-to; the revealed map covers every box the body paints; in either direction the resting rail lays nothing over the prose and the revealed labels stay inside the window; a document sidebar holding more than the map, an aside after the body and paper keep a column, and a narrow sidebar a page sets folds its map into the disclosure; under touch a document's sidebar stands its outline open instead of folding it. The status-line-after-the-map test is gone, since a rail holds the map alone. Refs #5619
leaf-agent
left a comment
There was a problem hiding this comment.
"Rail" now names two different things in the shipped interface. data-rail="right"|"none" on body already names the comment rail (the region where threads stand, which the same page-layout.md section, "The rail and the margin", describes). This PR uses the same word for a sidebar that narrows to the map's spine: the registry key x-rail, its paint data-lf-rail, --sidebar-rail, --lf-track-rail, and the reference prose. In that section the two meanings now sit in back-to-back paragraphs: "under a mouse it is a narrow rail" and then "data-rail="right" on body gives a sidebar page a rail". An author reading it could fairly conclude that data-rail="none" turns off the map's resting form, or that x-rail is how a widget joins the comment rail.
x-rail is a new public registry key that package authors will declare, so its name is cheapest to settle now. A name for what the element does, such as resting at its spine width and revealing the rest over the page, would keep it separate from the comment rail. The alternative is to keep the key and have the reference define the word once, distinguishing it from data-rail.
…he comment strip's The glossary keeps "rail" for the strip right of `main` where margin rows sit (`data-rail`, `--rail`), and rejects Material's "navigation rail" for it, yet this branch called the sidebar narrowed to the map a rail too: `x-rail`, `data-lf-rail`, `--sidebar-rail` and `--lf-track-rail`, beside `data-rail` in the same reference section. They are now `x-spine`, `data-lf-spine`, `--sidebar-spine` and `--lf-track-spine`, after the glossary's "contents spine", and the prose says the sidebar narrows to the map's spine. The spine journey's spacing check goes back to main's pair: the long stretch before the last section against the two close rows. On CI's fonts the stretch before the next section fitted to exactly one label apart, as the close rows did.
|
why do we need a new public registry key?? |
|
It isn't strictly needed. The narrowing rule sits in the Layout's A cheaper option that keeps the same behavior: move the rule into the map's own stylesheet. What that gives up:
With one consumer and no compatibility constraint, I think the move is the better trade. It removes a public key no other widget has asked for, and the paint-order test ( |
|
yes please move, thx |
|
I didn't push the move. Making it showed a cost my earlier comment missed: it breaks a stated boundary between the Layouts and packages, so I'm holding off until you've weighed that. What blocks it. Package sheets compose into What that rule protects. What lifting it costs. The default package would be the first to depend on the Layout's markup and to set the Layout's own properties: So the choice is:
Given the boundary, I now lean toward keeping the key. Reply with whichever you want and I'll do it. The move is a ready ~50-line diff (12 insertions, 52 deletions). |
`x-spine` brings four public names (`x-spine`, `data-lf-spine`, `--sidebar-spine`, `--lf-track-spine`) for one widget's look. A spike showed the page could narrow its sidebar with the existing `--aside` instead, with the Layout laying any too-narrow track's overflow over the body and the map choosing its spine form from its own width, matching this branch's geometry in Chromium and Firefox. That makes the spine opt-in per page, so the branch keeps the declaration for now and the TODO beside the Layout rule records the alternative.
) A sidebar page's prose now stands where a column page's would: centred in the window, moving right only as far as the sidebar needs. Since #4724 the body started its prose at its own start edge beside the sidebar. Once #5772 narrowed a contents-only sidebar to its 56px spine, that put the prose at x=104 on a 1728px window, with 880px empty past it and the panel centred 400px off it. In Firefox the prose now stands at 504px beside the spine or an outline column at 1728, 360px at 1440 and 280px at 1280, and below about 930px where it did. Pointing at the spine on a wide window shows its titles in the empty margin rather than over the words. The body pads its start by a new `--lf-room-before` and splits its room into `--lf-free-start` and `--lf-free-end`, so `available` blocks still reach the whole room and `wide` grows from the prose. An aside after the body centres the prose short of the aside. Two limits carry over from the room math, which predicts flex geometry from `--aside` and the gap: a percentage `--aside` zeroes the room, as before this change, and nested flows written in alternating directions don't grow their box toward a wide block's start side, as on column pages. Max picked this layout from three drawn candidates. Tests: the spine, outline and other-direction-flow tests assert the centred prose; the sidebar browser tests and the contents journey pass. > _This was written by Claude Code on behalf of max-sixty_
The contents map rests as its spine again, and shows its labels over the page when the reader points at it, Tabs into it or presses
g. A sidebar holding only the map now narrows to 56px, the spine's width, rather than taking a 240px column, so the prose starts beside the spine. That fixes the blank strip in #5619 without #5637's always-shown labels.At rest (runbook fixture, 1440×900): before, the labels filled a column and the prose started at 288px. Now the spine, its dots and the thread and On Me marks stand in the narrowed sidebar, and the prose starts at 104px.
Revealed by keyboard focus on the first section (a resting mouse shows the same): the labels keep their 320px measure over a 92% paper ground, as before #5637.
#5619's page of parts at 1295px: the prose started at 529px with 22px free on the right; it now starts at 345px with 230px free for wide blocks.
How the Layout and the map divide the work
lf-tocdeclaresx-spine, a new registry key that delivery paints asdata-lf-spine, the way a board declaresx-spacefor the room it needs. The word follows the glossary's "contents spine"; "rail" stays the comment strip's (data-rail,--rail).layout-columnbody and whose track holds only such an element narrows to--sidebar-spine(layouts.css). Its track stops clipping and carries--lf-track-spine: 1, the aside paints over the body and the body is isolated, so the labels cover every box the body draws. The Layout names no widget.toc.css); a track beside the body with room for words gets the open outline, and any other the disclosure. The map follows the Layout's decision rather than its own width alone, so a narrow sidebar a page sets, whose track clips, folds the map into the disclosure rather than hiding labels it would cut off.--lf-sidebar-slotis deleted.toc.cssnow places everything by logical sides, so the map and the outline mirror on a right-to-left page, where the resting clip flips.toc-view.js), so they show at rest next to the spine.Calls to check
page check --renderpassed it. A sidebar holding more keeps its column, and the map stands open there.main; narrowed, it would need the labels to spread the other way, toward the body on the inline-start side.x-spinestays for now, with a TODO beside the Layout rule. It and the names it brings (data-lf-spine,--sidebar-spine,--lf-track-spine) widen the public interface for one widget's look. Narrowing automatically needs some declaration, since the aside is a size container and takes no width from its content. The alternative, tried on this branch, lets the page narrow its sidebar with the existing--aside: the Layout lays any track narrower than words over the body, and the map takes its spine form from its own width. That matched this branch's geometry in Chromium and Firefox, but makes the spine a look each page opts into.Verification
Ran locally, all passing: every test that composes a document sidebar or a contents map (found by scanning the suite), the journey
test_a_contents_spine_maps_the_document_until_the_user_enters_it, the registry, schema and delivery tests inmodel/process,pnpm run check:framework,pnpm run test:runtime(907), and pre-commit. Probeddocs/index.htmlat rest and revealed, and a right-to-left page at rest and focused, in Chromium and Firefox.Test changes
test_the_revealed_contents_spine_covers_every_box_the_body_paints, which holds the Layout's paint order.test_a_contents_spine_rests_beside_the_prose_and_reveals_its_labels_over_it, left to right and right to left: at rest nothing of the map lies over the prose, pointing at the spine shows labels over the body inside the window, and on paper the sidebar is a column.test_a_sidebar_the_layout_does_not_narrow_keeps_the_map_s_words_shown, for a status beside the map, an aside after the body (both a column with the open outline) and a narrow sidebar a page sets (the disclosure). The last two failed on an earlier version of this branch, which narrowed a trailing aside and picked the map's form by the track's width.test_a_route_taller_than_the_map_returns_to_an_open_outlinenow checks that the resting outline lays nothing over the title, instead of fitting a column's gutter.test_a_status_line_in_the_map_s_track_follows_the_map: a status beside the map now keeps the sidebar a column, which the new test covers.Refs #5619