Skip to content

Keep the panel's room below a flowing workspace's panes, not in each pane - #5564

Merged
max-sixty merged 2 commits into
mainfrom
grind/stacked-pane-foot-room
Nov 5, 2026
Merged

max-sixty merged 2 commits into
mainfrom
grind/stacked-pane-foot-room

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

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's layouts.css in turn. "Clears" means the page's last line of content stands above the panel.

Case main Last pane only (this PR's first commit) Box of panes (this PR) Flowing page ends like a document (alternative A)
wt-merge, file-tree, rust-sort, review-queue at 390x844 room in every pane; clears room in the last pane; clears room on the grid, none in panes; clears room on the body, frames end 149px above the window's foot; clears
Two cards side by side on a phone, the long one first clears the last two lines under the panel (y=831, panel 782) clears clears
wt-merge at 844x390 72px in each pane the same 72px once, on the grid 72px on the body
wt-merge, review-queue at 1440x900 (held) each pane 72px the same the same the same
alert-review's main > footer at 390x844 footer pads 76px behind the panel the same the same footer ends above the panel
Two plain regions in main at 390x844 each pads 76px the same the same neither pads; body 76px

Net lines in layouts.css against main: +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 a main > footer bar above the panel. That reverses #4269 ("pane frames reach the bottom while their last controls remain reachable"), which test_workspace_end_room_stays_inside_the_last_reading_region holds 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, where main, C, B and A are the four columns above).

Test

test_the_page_end_clears_the_bottom_chrome_around_a_workspace now 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. Against main's layouts.css, and against this PR's first commit, it fails with assert 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 in tests/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.md gives a workspace a header, one body and a footer), and the band wastes room without hiding anything.

Not verified

  • Firefox, WebKit and iOS Safari for the box-of-panes version. Firefox was measured for this PR's first commit only.

This was written by Claude Code on behalf of max-sixty

… 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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@max-sixty max-sixty changed the title Keep the panel's room only in the last pane where a workspace's panes stack Keep the panel's room below a flowing workspace's panes, not in each pane Nov 5, 2026
@max-sixty
max-sixty merged commit 8570fd9 into main Nov 5, 2026
5 checks passed
@max-sixty
max-sixty deleted the grind/stacked-pane-foot-room branch November 5, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants