Skip to content

Give a document's end room to rise to the window's top, and drop the deck's held height - #7188

Merged
max-sixty merged 2 commits into
mainfrom
choice-walk-fixes
Nov 26, 2026
Merged

max-sixty merged 2 commits into
mainfrom
choice-walk-fixes

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Gives a served column or sidebar page room below its body for its last line to rise to the window's top, as an editor does, and drops lf-deck's held height (#7150), which handled one widget's case of the same fault. At a page's end the browser can't scroll past the last pixel, so a block there that shrinks makes it pull the page down; since #6688 took away the panel's 72 px, a deck ending the page moved its bar under the pointer and m landed each card at its own height. The hold fixed that by keeping the deck tall, which left empty room inside a short card's frame and ran in the deck's own code.

To weigh: every such page, the website's included, can now scroll until its last line stands at the window's top, blank below it. A workspace, a block sample and a nested Layout keep their ends. The obligation mark's landing margin moves to the theme's tier at no weight, so a deck card's own margin keeps the bar in view when m lands it; with the extra scroll, Chromium otherwise cut the bar off above the window.

Max asked on his review page for a fix with no runtime code and no empty space under the card; this is the option recommended there, and he chose it. He hasn't read the diff. Codex reviewed an earlier version; its findings (room applied to nested Layouts, one-line summaries still moving, the cut-off bar, interactive exports, four tests) are folded in.

Tests: the hold-still journey's deck-back rows pass in both engines and fail without the room; deck, obligation-walk landing, sample and model tests pass; three tests that need a page with no scroll range now strip the room from it.

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

…deck's held height

At a page's end the browser can't scroll past the last pixel, so when a block there
shrinks it pulls the whole page down to keep the window filled. Since #6688 took away
the panel's 72 px, a deck that ends the page hit this: a shorter card moved the bar
under the pointer, and `m` landed each card at its own height. #7150 made the deck hold
the tallest height it had stood at, which left empty room inside a short card's frame,
ran in the deck's own code, and in a window taller than the deck still landed `m` at
123 px rather than the window's top.

A served or interactive page in a column or sidebar Layout now keeps room below its
body for its last line to rise to the landing line under the window's head, as an
editor's does (`layouts.css`). The room is the body's padding, so a Layout nested in the
page keeps its own end; a workspace and a block sample keep none. The deck's hold goes:
`#hold`, its width observer and the open card's flex fill. In Firefox at 1100×900 and
1100×1100, `m` cycling the catch-up deck's last two cards lands the bar at 12 px each
time, and closing the page's last disclosure leaves its summary under the pointer.

The obligation mark's landing margin moves from the chrome's sheet to the theme's tier
at no weight (`element-marks.css`), so a deck's card keeps its own margin for the bar
above it. With room to scroll, the first `m` onto a deck in Chromium otherwise landed
the card at the window's top with the bar cut off above it (-18 px).

What a user sees differently: every such page can scroll until its last line stands at
the window's top, blank below it, the website's pages included. A deck inside a bounded
scroller, or on a page with no Layout, follows each card's height and can pull the page
down at its end, as before #7150.

Tests: the hold-still journey's two deck-back rows pass in Chromium and Firefox and fail
without the room. Three tests that needed a page with no scroll range now strip the room
from their page, or drop an assertion that a short part has nothing to scroll; the
obligation-mark spelling test reads the mark's new sheet.

@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.

I found nothing to change in the diff. I'm holding the approval only because the description says this waits on the maintainer's pick of the recommended option before merging. That pick is the trade the description lays out under "To weigh": every served column and sidebar page, the website's included, gains up to a window's height of blank scroll below its last line, in exchange for removing the deck's held height and its size observer.

The maintainer chose the document's end room over the deck holding its
tallest height, so the header's rejected-hold note now says the user
rejected it, as its sentHere note does.
@max-sixty
max-sixty merged commit 813d326 into main Nov 26, 2026
6 checks passed
@max-sixty
max-sixty deleted the choice-walk-fixes branch November 26, 2026 02:08
max-sixty added a commit that referenced this pull request Nov 26, 2026
…7209)

Fixes a regression from #7188: once a page's end can rise to the
window's top, the reading line (a quarter of the way down the window)
can fall in the blank room below everything the page draws. There
`readingAt` met only `main`, so a walk took the reader to be at the
page's start and a let-go landed on `main`. On a page whose tabs hold
two questions, a wheel past the first and `m` went back to the first
rather than on to the second. The page's fallback for a screen with no
text block (`shownAtLine`, which a walk's origin and a let-go read) now
takes the page's last drawn block when the line meets only `body` or the
Layout's box below that block's foot, so a reader past the end counts as
at the end.

To weigh: the last block is found by descending the page's last children
that draw a box, skipping Leaf's chrome and what the page hides (a tab
not chosen). It runs only on that fallback, not per frame, and
`readingAt` itself is unchanged, so holds and other columns read as
before.

Found while testing a follow-up to #7188 in this session; the maintainer
hasn't read it. Tests:
`test_an_obligation_walk_glides_within_a_view_and_opens_other_tabs_at_the_question`
failed on main for its non-nested case and passes; 23 neighbouring
let-go, hold, walk and page-tab browser tests and the runtime suite
(1133) pass; `check:browser` is clean.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 26, 2026
Drops the window-tall minimum on tabs in the page's flow. It kept the
strip still when a switch from a long tab scrolled deep to a short one
would otherwise let the page's end pull the page down; since #7188 a
column or sidebar page keeps room below its last line for exactly that,
so the rule only left a window of blank under a short tab. On a 1100×900
page whose tabs are followed by more of the page, the heading after a
one-line tab moves from y=1109 (off screen) to 307.

To weigh: a switch from deep in a long tab to a short one still leaves
the strip at the window's top in Firefox and Chromium. A page with no
Layout class gets no end room, so there the strip now drops by what the
page loses (about 100 px on a short test page); that page's layout is
its author's own.

Found while following up #7188 in this session; the maintainer hasn't
read it. Tests: the 18 page-flow tab tests, the root-tabs journey that
switches views without moving the strip, and the obligation walk across
tabs pass.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 26, 2026
…olls (#7213)

#7188 gave column and sidebar pages room below their end, so the page
itself now scrolls even when it fits the window. Two tests turned red,
and the room is the intended behavior in both. One exposed a runtime
defect, and the other had stale setup.

- **Reading place in a bounded region.**
[`scrollsAlone`](https://github.com/max-sixty/leaf/blob/b078e6bfbdb91523bd7607e10c4baf77cd59e550/browser/runtime/readings/reading-place.js#L1017)
walks up from a block to the box the place is read for. When the block
*is* that box, as a bounded region's `pre` is, the walk went past it to
`<html>`. `<html>` is `overflow-y: scroll` and now has a scroll range,
so every line in a long text document counted as scrolling on its own,
and `capturePlace` named no line. The walk now starts below the box
only. A user sees this as a lost reading place inside a bounded document
on any column or sidebar page whose end room makes the root scroll.
- **Evidence close in a diff.** The test scrolled to the document's end
to put the evidence at the window's foot. With the room, that scroll
leaves the evidence wholly above the window (its bottom at −7 to −61
px), so the test was measuring an off-screen disclosure. The test now
scrolls its following button to the window's foot. That is the geometry
it had before #7188, with the room below it. The behavior under test is
unchanged.

Before this change,
`test_a_place_in_a_long_document_names_the_line_at_its_top` and both
failing engines of
`test_evidence_close_folds_room_but_retires_controls_immediately[*-file]`
fail on main `dfde749f0` with the messages in #7212. All five cases pass
after it. `pnpm run test:runtime` passes, and so do the bounded-region
and scroll cases of `test_reading_place.py`.

Closes #7212 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 26, 2026
…height, and keep the deck's bar in view there (#7192)

Agents now give a workspace to a page whose whole task happens in one
view that changes height, such as a catch-up deck, and the deck keeps
its bar in view there. As a workspace's body the page never scrolls, so
a shorter card coming up can't pull the page down and move the bar,
which is the fault #7188 fixed for column pages.

- **Guidance:** `page-authoring.md`'s "Composing a page", where authors
choose a Layout, says to use a workspace when the page's whole task
happens in one view whose height changes as the user works, such as a
stack of cards, and to keep that view in a report's flow when it is part
of one. `page-layout.md`'s queue paragraph names a pile of cards beside
the side list. A new case, `deck-page-takes-the-window`, scores it: six
pull requests to take one at a time went to a workspace in 0 of 3 runs
on main and 3 of 3 here, and its control, a deck after an outage report,
stayed a column page in all 6.
- **Deck CSS:** in a 720 px window the workspace's region (499 px) is
shorter than every catch-up card, and the bar scrolled away with a tall
card (−72 px on main, read down to its options). The bar now sticks at
the deck's top and adds its height to `--lf-top`, so it stays at 156 px,
and `m`, Tab and Shift+Tab land below it. Nothing changes at 900 px, on
a phone or on a column page.

To weigh: the bar sticks only where the deck is the workspace's body, or
stands in the question group that is; a deck in a plain wrapper scrolls
as before.

The maintainer asked for this in a thread on the catch-up deck's report
page. Tests: a new browser test (a tall card scrolls under the bar in a
560 px workspace) and the neighbouring deck tests pass; the eval-catalog
tests pass. An independent Codex review's findings are fixed in the
second commit.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 26, 2026
…ff the root headers' observer (#7244)

#7188 gave a column or sidebar page room below its body, so its last
line can rise to the window's top. About 35 browser tests failed after
it. This repairs all of them but one, which needs a decision (below).
Every repaired test failed on `main` and passes on this branch, locally
in Chromium, Firefox and WebKit where the test runs them: 69 passed,
including `test_deck.py`, which exercises the room itself.

**One product fix.** The room subtracted `--lf-top-covered`, which
includes `--lf-root-headers`. `dom/root-headers.js` writes that variable
from a ResizeObserver, so a package header changing height resized the
body inside the observer's pass. The browser then reported
`ResizeObserver loop completed with undelivered notifications`, which
fails a page's render check
(`test_a_package_reads_the_public_api_and_nothing_behind_it`). The room
now subtracts the CSS-only `--lf-head-room`. The error went away in 2 of
2 runs, and putting the variable back brought it back in 2 of 2. What
changes on screen: a page with a marked root header, such as a page tab
strip, can scroll its last line up under that header, by the header's
height. Pages without one draw as before.

**Tests about the page's foot** now take the room away through one
harness helper, `without_end_room`, which replaces the two inline copies
#7188 added. These tests set up a destination that no scroll lifts clear
of an open view, content leaving below that clamps the page, or a card
or comment box that fits only over its words. With the room, the runtime
correctly lands those destinations above the view and leaves the view
open; I checked the `m` travel case directly. So the room removes the
tests' premise rather than breaking their behaviour. Affected tests: the
on-panel travel, On Me, idle `m` clamp and obligation-walk tests, the
panes wheel, thread back/forward (2 files), the drawn and pasted media
cases, the drafting-card helper behind the card-reply tests, render-aim
above, the send-placement reopening and the floating-panel arrival.

The floating-panel arrival test also now waits for the panel to stand
closed before it checks that the foot stop shows. The box starts
shrinking only after the leaving view's fade ends, so waiting on the
motions playing at the time could read the box mid-shrink. That happened
once on CI, and the failure picture shows the stop in sight at rest. It
passed 18 of 18 copies under load locally before the change and 8 of 8
after it, so the race didn't reproduce locally.

**Tests that read a coordinate the room moved** now read the behaviour
they protect:

- the chrome room is measured past the body's end room;
- the body fills at least the window;
- the contents lens is read on its own map;
- the tally's place is read on the page, not in the window;
- the long-draft line is scrolled to the window's middle;
- the draft-cancel test scrolls its following paragraph to the window's
foot;
- the comment-note test scrolls back to the top when it resets its
margin.

**Left red:**
`test_a_stuck_sidebar_track_keeps_its_place_to_the_page_end`. A sticky
track can't stick past its aside's end, so at the end of a page with the
room the track leaves the window. That conflicts with #7188's intent,
and #7245 asks the maintainer to decide.

<details><summary>Effects of the room seen while diagnosing, not changed
here</summary>

- A comment box drawn on a figure that fills the window now opens below
the figure, because the room gives placement scroll travel there. It is
held at the window's foot with its picture shelf hanging below the
field, past the window's foot and under the panel.
`test_a_box_held_at_the_window_s_top_hangs_its_pictures_inside_the_window`
keeps testing the top-held case, with the room taken away.
- Enter on a block's comment note while the block is above the window
opens its card out of view and leaves focus on `body`. Only an
artificial layout change reached this state in the test.

</details>

Closes #7240 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 26, 2026
…ew, and adapt two journeys to the end room (#7288)

All three nightly journeys that #7188's end room turned red now pass.
One of them caught a real defect: a thread card could stay unread after
the user opened it.

**Product fix: a card the placement brings into view is read.**
`records/thread/read.js` ran an exposure pass on scrolls, room changes
(`watchRoom`) and body resizes, but not when a body moved without any of
those. With the end room, pressing `t` on a page scrolled below its top
scrolls the page, which is instant under reduced motion. The card's
floating placement then moves the card from its anchor to the window's
foot. Its message goes from 818–997 px (24 px seen) to 504 px and up,
wholly in view, and no pass runs after that move. So the message, its
thread's "1 unread" and On Me's "1 thread with news" stayed until the
next scroll, and the render gate saw the second open mark it read. Each
observed body now also has an IntersectionObserver at thresholds 0 and
1, so a pass runs when a body enters the window or comes wholly into it.
This is the same primitive `whenChanges` in `dom/geometry.js` uses for
layout moves. `test_a_card_its_placement_brings_into_view_is_read`
(browser tier) fails on `main` (the news dot stays shown) and passes
here. The render gate's `thread-choice-hints` case fails before and
passes after.

**Two journeys read a place the room moved.** #7188 meant the room for
these column pages, so both tests keep what they protect:

- `test_the_page_end_clears_the_bottom_chrome_around_a_workspace`: its
first page is a column document with a pane, not a workspace. Its
assertion that the body keeps no *panel* room read the end room's 584.8
px. It now reads the page through `without_end_room`, the helper #7244
introduced. The workspace pages in the test are unchanged and still
pass.
- `test_hiding_annotations_gives_marked_words_their_own_colours_back`:
`t` walks from the reader's place. Before the room, centring the
document's last line clamped at the page's end. Now it centres exactly,
and `t` reached the document's `"resend now"` thread instead of the
link's. The test now scrolls to the top before `t`. It passes in
Chromium, Firefox and WebKit.

Checked: each of the three tests run alone with `--run-nightly` (failing
on `ab811b350`, passing here), the neighbouring read-state browser
tests, `pnpm run test:runtime`, `pnpm run check` and pre-commit.

#7245, the sidebar track's end-of-scroll decision, is separate and
untouched.

Closes #7282 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 26, 2026
…ta+ArrowRight, not End (#7291)

On macOS, Playwright sends End as the `scrollToEndOfDocument:` editing
command, which scrolls the page and leaves a native editor's caret where
it stood. Two tests in `test_render_aim.py` press End to move a
`contenteditable`'s caret to its end before typing, and both have failed
on `test-macos` since #7188 gave the document its end room. The tests
now press `Meta+ArrowRight` on macOS, which Playwright maps to
`moveToRightEndOfLine:`, and End elsewhere. Linux keeps the same key it
had.

-
`test_design_mode_reads_each_shape_of_control_into_the_anchor_its_routes_carry`
(`out of the mode`): the click left the caret after the first character,
so " edited" landed there and the editor read `B editedackup draft`.
- `test_automatic_design_capture_never_borrows_mutable_editor_context`:
End scrolled the page before the test dragged a selection across the
editor, so the panel field never opened.

#7188's end room stays as it is. Only the key the tests use to reach the
line's end changes.

<details><summary>Evidence from the macOS runner</summary>

Each run dispatched `ci` with `flake`, so `test-macos` ran only these
two tests:

- `main` at `ab811b350`: both failed 6 of 6 copies
([run](https://github.com/max-sixty/leaf/actions/runs/45859961405)).
`118f31f6d`, the last scheduled pass, passed 6 of 6
([run](https://github.com/max-sixty/leaf/actions/runs/45859967122)).
- Bisect: `14ba0041c` passes, and `813d3262b` (#7188), its child, fails
both tests
([run](https://github.com/max-sixty/leaf/actions/runs/45866216046)).
- A probe after leaving Design mode: End took `scrollY` to 2232 with the
caret still at offset 1, and `Meta+ArrowRight` moved it to 12, the
text's end.
- `Mod+End` was tried first. It fixed the selection test but left the
caret test failing 12 of 12.
- This branch: both tests passed 12 of 12 copies, with 2 workers and 4
busy loops
([run](https://github.com/max-sixty/leaf/actions/runs/45874844916), at
`c541339a4`, before a rebase onto `main` that touches no other line of
this file).
- Linux: both tests pass locally.

</details>

Closes #7284 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 26, 2026
…nd the contents map still from the page's top (#7308)

Keeps a sidebar's sticky track, and so the contents map, where it sticks
through the end room #7188 put on `body`, and stands the contents map at
its sticking line from the page's top. The body's room becomes a token,
`--lf-end-room`, and the track's end margin hangs through it as it
already hung through the sidebar's own end padding, where the sidebar is
the page's Layout box. Under the narrowed contents map with no header,
the track's start margin hangs through the sidebar's top padding. On the
maintainer's README page at 1728×999 the map's top went from 64px at the
top and −816px at the end to 24px throughout, in Firefox and Chromium.

To weigh: only a `footer` after the sidebar or its `main` stops the end
hang, since browser extensions append elements to `body` (all four in
the maintainer's Firefox do). Each hang comes off the height the aside
asks of the row, so a sticky track taller than the body no longer
stretches it: on the triage board with its activity open, the lanes end
below their cards.

Max asked on his review page for lf-toc not to scroll; he hasn't read
the diff. Codex reviewed it twice; its findings on nested sidebars, a
layoutless `main`'s child and a site footer are folded in.

Tests: the track test that #7244 left red passes in both engines with
new cases; a new test keeps a sidebar among a column's blocks off what
follows it; the lens test checks the map stands still; the rule-cost
tests pass.

Closes #7245

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 27, 2026
A column or sidebar page now ends where its content does, as a web page
does. This removes the room below the last line that #7188 added, nearly
a window of blank space (864px on a 999px-tall window). It also removes
everything that existed only for the room: the end-room term in the
sidebar track's hang (#7308), and the test helper that took the room
away for 16 tests.

What a reader sees differently happens only near a page's end. Removing
items there drops what stands above them by the removed height, and
closing a disclosure there drops its summary. `m` lands a question at
the end low in the window rather than at the landing line. Back on a
deck that ends the page brings up a shorter card and carries Back 404px
down from under the pointer. Higher up a page, nothing changes.

Max chose "No room" on his review page after trying each case in a
preview, and asked for it to be merged. He raised the deck's case as a
separate question, so this leaves the deck's code alone. The hold-still
journey lists the deck-back cases under `MOVES_BY_CHOICE`, its list of
choices that bound the guarantee, and `layouts.css` records the rejected
room.

The contents map's fixed track (#7345) and its header and footer
conditions stay, as does the stuck track's hang through the sidebar's
own end padding (#6671). On a copy of the README page in Firefox at
1728×999, the map's top stays at 32px from the page's top to its end.

Tests: I ran every test that took the room away or was adapted to it by
node id in Chromium and Firefox (68 passed, and the two deck-back cases
fail as the journey's list expects), plus the layer model tests and
pre-commit.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 27, 2026
…nter (#7462)

A deck now stands as tall as the tallest card it has shown, and the open
card's frame fills that height, as a slider does with its tallest slide.
Since #7438 a page ends at its last line, so at a page's end Back from a
tall card to a short one shrank the deck and the browser pulled the page
down, carrying Back 404px from under the pointer. Now Back stays put,
mid-page and at the end.

This brings back #7150's hold (`#hold`, the width observer, the flex
fill), which #7188 dropped in favour of the end room. Max picked "Size
every card to the tallest" on his review page from five options, after
trying each in a preview.

To weigh: a short card's frame stands tall round its content (in the
journey's page, 660px round about 256px of content). The height held is
the tallest card shown so far, not the tallest in the deck, so the first
visit to a taller card still grows the deck; growth moves nothing above
it.

Tests: the hold-still journey's deck-back rows pass in Chromium and
Firefox and leave the expected-failure list; the deck tests on height,
scrolling and Undo pass.

> _This was written by Claude Code on behalf of max-sixty_
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