Repository navigation
Keep the panel's room below a flowing workspace's panes, not in each pane - #5564
Conversation
… stack On a phone a workspace flows: its grid of panes stacks and the page scrolls. Each pane of the grid still inherited the panel's foot room (`--lf-end-room`), so every pane above the last ended in an empty band the panel never covers: 76px under wt-merge's film, file-tree's file list, rust-sort's stage and review-queue's queue at 390x844. In a window under 720px wide, where page-layout.md has a grid of panes stack, only the grid's last pane now keeps the room (`:nth-last-child(1 of [data-lf-reading-role="pane"])`). From 720px wide every pane keeps it as before, held or flowing in a short window, since the panes may stand side by side there and CSS can't tell the grid's last row from the others. Probed every workspace example and fixture with `leaf-dev probe --base`, scrolled to the document's end: at 390x844 the non-last panes go from 76px to 0 (wt-merge also in Firefox, 72px to 0), the last pane keeps 76px, and the page's last content clears the panel on every page. At 1440x900 and at 844x390 every pane's room is unchanged, and a column page's body keeps its 76px end padding. test_the_page_end_clears_the_bottom_chrome_around_a_workspace now holds a two-pane grid to this at 390x844, 844x390 and 1280x720; against main's layouts.css it fails with `assert 72 == 0`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
Under 720px this rule depends on the page's own grid stacking at the same width. The 720px in page-layout.md is only an example breakpoint in the author's stylesheet. Leaf doesn't own it. Take a grid that keeps two short panes side by side on a phone, or one that stacks at 600px. Every pane but the last now has no room. If such a pane's content runs past the last pane's content plus the room, its end sits under the panel at the page's foot. The PR description mentions this case, but it trades a guarantee the user relies on (the page's end clears the panel) for the author's layout, which Leaf's CSS can't see (SOUL.md, "Primitives, not a template").
There is a cheaper fix that doesn't need to guess the author's layout. Where the workspace flows ((width < 720px) or (height < 480px), Leaf's own breakpoint), no pane body scrolls, so the reader doesn't need the room to bring its last line into view. The grid container can end the page with the room itself. Let the padding-block-end: var(--lf-end-room) rule match a container holding panes in flow mode, and stop passing the room to its panes there. That clears the panel whatever the grid's arrangement or source order, including the order/grid-area case listed under "Not verified". It also removes the band this PR keeps on every pane at 844x390, and the second media block isn't needed. In held mode every pane keeps inheriting the room, since there each pane's own body scrolls up to the foot.
The previous commit gave the room to a grid's last pane below 720px wide, which assumed the page's grid stacks there. A grid that keeps two columns on a phone then lost the room on a pane that ends the page: in a two-card fixture at 390x844 the long first card's last two lines sat under the panel (its last line at y=831, the panel at 782). Now, where the workspace flows (Leaf's own `(width < 720px) or (height < 480px)`), a box of panes pads its own end with the room and passes it to none of its panes, since no pane body scrolls there. While held, each pane keeps inheriting it, as on main. The page's end clears the panel whatever the grid's arrangement or source order, and a short wide window keeps one band below the grid where each pane kept its own. Measured with leaf-dev probe at the document's end (390x844 unless stated), main / previous commit / this: - wt-merge, file-tree, rust-sort, review-queue: room on every pane / on the last pane / on the grid; page end clears the panel in all three. - two columns on a phone, long card first: clears / last lines under the panel / clears. - wt-merge at 844x390: 72px on each pane / the same / 72px once on the grid. - wt-merge and review-queue at 1440x900, alert-review's footer: the same in all three. The test's grid now keeps two columns at every width with its long pane first; against main's layouts.css and against the previous commit's it fails with `assert 72 == 0`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a phone a workspace flows: its grid of panes stacks and the page scrolls. Every pane of the grid still inherited the panel's foot room (
--lf-end-room), so each pane above the last ended in an empty band the panel never covers.Where the workspace flows (Leaf's own
(width < 720px) or (height < 480px)), no pane body scrolls, so the box of panes now pads its own end with the room and passes it to none of its panes. The page's end then clears the panel whatever the grid's arrangement or source order. A short, wide window, where panes stand side by side and the page scrolls, keeps one band below the grid instead of one in each pane. While the workspace is held, each pane keeps inheriting the room as before, since each pane's own body scrolls up to the window's foot.Evidence
leaf-dev probe, scrolled to the document's end, with each version'slayouts.cssin turn. "Clears" means the page's last line of content stands above the panel.mainmain > footerat 390x844mainat 390x844Net lines in
layouts.cssagainstmain: +15 for last pane only, +14 for the box of panes, −1 for alternative A. A is the smallest, but it ends every frame above the panel's band in a flowing window and moves amain > footerbar above the panel. That reverses #4269 ("pane frames reach the bottom while their last controls remain reachable"), whichtest_workspace_end_room_stays_inside_the_last_reading_regionholds at 695x988. The box of panes keeps the grid's frame reaching the window's foot, with its last 76px of the box under the panel. In the stills that leaves a 15px strip between the last pane's edge and the panel's row.Stills of each version at 390x844, at the document's end, are in the authoring worktree's
.tmp/footroom/(still-<version>-<case>-390x844.png, wheremain,C,BandAare the four columns above).Test
test_the_page_end_clears_the_bottom_chrome_around_a_workspacenow also holds a grid that keeps two columns at every width, with its long pane first. At 390x844 and 844x390 neither pane keeps the room and the long pane's end clears the panel; at 1280x720 both panes keep it. Againstmain'slayouts.css, and against this PR's first commit, it fails withassert 72 == 0.Ran:
tests/browser/widgets/test_workspaces_and_bounds.py -k "page_end_clears or end_room_stays or plain_section or reaches_the_window_foot or bounds_independent or flowing_workspace_keeps_its_header or scrollbar_appears"(11 passed), and the ten narrow-window workspace tests intests/browser/navigation/test_panes.py(11 passed).Not changed
Two or more plain regions directly in
main, such as an aside and a section, still each pad their end with the room when they stack. No shipped workspace has more than one body (page-layout.mdgives a workspace a header, one body and a footer), and the band wastes room without hiding anything.Not verified