Skip to content

Stand every reply box a message's gap under the thread, and end a message at its last block - #6272

Merged
max-sixty merged 4 commits into
mainfrom
panel-thread-spacing
Nov 17, 2026
Merged

max-sixty merged 4 commits into
mainfrom
panel-thread-spacing

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Gives a thread one gap after a message's end, whatever follows it. The reply box stood 10px under the last message in a page's seat, 16px in a margin card and 24px to the row in the panel; each now takes --lf-msg-gap (24px), so the box stands where the next message would. --lf-comment-foot-gap goes, since the card's reply row and the comment box that becomes the card reserve that gap together; the comment box keeps 8px more invisible room under its field, which moves nothing visible at rest.

A message that ended in a nested block, as an ask's options or a list's last item, passed that block's bottom margin out past the message, so an ask stood 14px further from the next message than a paragraph did. A message now trims its last block's last part too.

The quote over a thread in the panel stays 4px closer to the first message than messages stand to each other, as a title stands closer to what it heads.

Follows #6254, which Max asked for; he asked for this review of the spacing after it. Two tests' setups move off thresholds the taller reply row crossed: the comment-box foot test's page widens its landing room so its field still stands inside the panel's band (a control with the padding drop disabled still fails it), and the card-growth test seats its screenshot at the window's head, since a card grown to the window's foot moves into the window's plane, reply box included, a jump the shift watch reports and a longer answer shows on main too (#6278 tracks it). Ran 68 card-reply tests, the seat and thread layout tests, the send-placement and panel foot tests, and before/after stills of the panel, cards, a seat and the comment box.

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

…sage at its last block

After the last message, the reply box stood 10px below it in a page's seat (the
page's spacing step under density-working), 16px in a margin card (the comment box's
own foot gap) and 24px to the row in the panel. Each now takes `--lf-msg-gap`, the
room a message keeps before whatever follows it, so the box stands where the next
message would on every surface. `--lf-comment-foot-gap` goes: the card's reply row
and the comment box that becomes the card reserve the same gap, so a box that fills
the window still becomes a card of its height, now 8px taller under its field.

A message that ended in a nested block, as an ask's options or a list's last item,
passed that block's own bottom margin out past the message: 14px more room after an
ask than after a paragraph. A message now trims its last block's last part too.

The comment box's field at the window's foot now stands just above the panel's band,
so the test that it can type there without moving the page widens its page's landing
room to put the field back inside the band; a control with the padding drop disabled
still fails it.

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

This change turns tests/browser/test_render_send_placement.py::test_a_card_grows_past_a_region_that_does_not_scroll_its_subject[shot-fit] and [shot-actual] red. Both fail at teardown in the page-holds-still watch. When the agent's answer arrives, the margin card beside the release-notes screenshot jumps 226px with no input: it moves from the page plane, held by its top edge, to the window plane, held by its bottom edge, and its reply box, field and placeholder move with it. The test passes on current main and fails both on the PR head and on the merge ref.

The jump itself is already on main. The card's reply row is now 14px taller, and that is enough for the grown card to cross the placement threshold at 1440×900. On main, lengthening the test's agent answer from 8 sentences to 9 gives the same failure, a 234px jump. So the test sat just under the threshold, and this PR pushes it over.

That leaves two options. One is to fix the plane switch so a card that grows when an answer arrives doesn't jump. That is the underlying problem, and a longer answer already hits it on main. The other is to land the spacing with an issue filed for the jump and the fixture adjusted to stay under the threshold, which only hides the jump again. As the PR stands, its test job will go red on these two cases.

The test's grown card stood a few pixels from the window's foot at 1440x900. The
reply box's taller gap took it past, where the card rises into the window's plane
(thread-preview.js, `rises`), which the shift watch reports as a jump. A
longer answer did the same on main. With the shot at the window's head the card
grows clear of the foot, up to twice the answer, and still outgrows the room the
shot would leave it at Fit.

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

The card-growth test passes again: I ran its three cases on the merge ref and all pass. But moving the shot to the top of the window takes the test away from the window's foot, which is the only place the jump showed up. The jump itself stays on main, it isn't tracked anywhere, and the new comment says it's a gap in the shift watch rather than a defect.

The watch already handles both moves the comment mentions. In tests/shift_watch.js, floating_plane covers a card switching planes, and data-lf-rises / appendGrowth let a rising card lift its head. The move this test caught also carried the card's reply box at its foot, by 226px. A rising card is supposed to keep its foot still (thread-preview.js: "its top stays where it stood… the window's foot lifts it"), so the watch was right to report it. The comment should describe the jump as a known defect, not as something the watch fails to credit.

The setup change itself is fine as a deferral, since fixing the plane switch later is no harder for it. Under running-tend's Reading a red suite, though, a repair that hides a behavior needs an issue. Could you open one for the jump: a margin card beside its subject jumps into the window's plane, reply box included, when an answer grows it past the window's foot. Then cite it in this comment so whoever fixes the jump can move the shot back to its old position. I'm happy to file it if you'd like.

leaf-agent
leaf-agent previously approved these changes Nov 17, 2026

@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 filed the jump as #6278. The test comment could cite it ("Move the shot back once #6278 is fixed") so whoever fixes the jump can find the test.

max-sixty pushed a commit that referenced this pull request Nov 17, 2026
…ises in one frame (#6281)

A margin card beside its subject holds its top and grows down, and once
it meets the window's foot the foot lifts it (`thread-preview.js`
header, `rises`). An answer long enough to do both in one frame grows
the card's foot down to the window's foot and lifts its head by the
rest. On the release-notes shot at 1440×900 that is 256px of growth: the
foot moves 234px down and the head 22px up. The shift watch credited a
standing port's growth in two cases only: foot growth with the head
still, or a head rise with the foot still. So it reported the reply
row's move with the foot as `moved without input`. The card does what
its contract says. The watch was missing this one combination.

`appendGrowth` in `tests/shift_watch.js` now lets a port declaring
`data-lf-rises` rise at its head and grow at its foot in the same frame.
The rise plus the foot's growth must come to no more than the append
growth. The stand above the port has to match both the rise and the
foot's growth. Holdings are still read net of the rise, so a control
below the growth is credited `growth − rise` and nothing more.

Verification:
- `test_append_growth_may_grow_a_standing_port_down_then_raise_it` (new,
in `test_render_shift_watch.py`) errors on the old watch and passes on
the new one. Its fault cases still report a port that grows past its
growth and a control that moves further than the carry. The existing
`test_append_growth_may_raise_a_port_standing_on_its_foot` cases pass
unchanged.
- `test_a_card_grows_past_a_region_that_does_not_scroll_its_subject` now
gives the agent a 12-sentence answer instead of 8, so a card beside the
shot grows past the window's foot. With the old watch both shot variants
report the 234px move. With the new watch all three variants pass.
- The append, rise and standing tests in `test_render_shift_watch.py`
pass (39). So do the growth, rise, answer and foot tests in
`test_render_send_placement.py` (15).

Once this lands, #6272 can put its screenshot back where it was, so that
test covers the window's foot again.

Closes #6278 — automated triage

Co-authored-by: leaf-agent <[email protected]>
@max-sixty
max-sixty merged commit a1b28d2 into main Nov 17, 2026
5 checks passed
@max-sixty
max-sixty deleted the panel-thread-spacing branch November 17, 2026 17:32
leaf-agent added a commit that referenced this pull request Nov 17, 2026
…w after #6254's wider gaps (#6307)

`reading-reply-below` needs the notes thread's last message to start
below the reading place and inside the 900px window, with the reply box
below the window. #6254 widened the gap after each thread message from
16px to 24px. Eight messages sit between the read paragraph and the end
of the thread, so that change moved the last message's top to 910px,
10px past the foot, and the case failed its own precondition (`{'above':
False, 'shown': True, 'below': False}`). The layout is doing what #6254
meant it to do, and the case doesn't check the gap. Only the setup
crossed a threshold.

The first two follow-up replies in the notes thread are now one line
each. The last message now starts at 868px in both Chromium and Firefox,
and `put_reading`'s check that the reply box is out of the viewport
still passes. That leaves 32px of slack. #6272, still open, changes
message ends again.

`reading-reply-below-{chromium,firefox}` fail on main and pass with this
change. All 20 cases at the `reading` place pass in both engines. The 2
xfails in that selection are the existing `diff-reading-deletions`
markers. No other place uses the notes thread.

Closes #6299 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 17, 2026
…e window's foot (#6311)

Puts the card-growth test's release-notes screenshot back where
`scroll_into_view_if_needed` leaves it, so the grown card again reaches
the window's foot and rises, the case the test's docstring names.

#6272 moved the shot to the window's head to keep the card off the foot
while #6278 was open. #6281 then fixed the shift watch for a card that
grows to the foot and rises in one frame, and lengthened the answer to
reach it, but the moved shot kept the card clear, so the foot case went
untested. With this change the grown card stands in the window's plane,
its foot at the window's foot and its top above where it opened, and all
three cases pass.

Max asked to check the follow-up to #6278 and fix it where it mattered.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty pushed a commit that referenced this pull request Nov 18, 2026
…k slack (#6394)

`test_a_thread_walk_card_leaves_and_returns_with_its_anchor` timed out
on its third `wait_for_function(shown)` because the test stopped
scrolling inside a tolerance the runtime documents. The test scrolls the
margin card in 10 px steps until the Reply box's top passes the window's
top, then presses `c` and expects the card to come back into view.
[`off-flow.js`'s
`unseen`](https://github.com/max-sixty/leaf/blob/96140972ca2e423aa34023d422813050774334e2/browser/runtime/off-flow.js#L52-L63)
reads a box within a pixel of the edge as shown, so that a card held
flush at the edge isn't moved. Where the loop stops depends on the
card's offset modulo 10. #6272 moved the reply box 8 px down to stand a
message's gap under the thread. After that, the loop stopped with the
box at `top: -0.86`, inside the slack, so `c` correctly left the card
where it was.

The loop now runs until the box is more than a pixel past the top. The
step then tests what its comment describes: a card whose reply box is
cut off at the window's top comes back on `c`. #6272's spacing and the
runtime are unchanged.

The test fails on main `90ec76548` with the 120 s timeout and passes
with this change. With the original loop the measured box top was -0.86
px. Separately, a loop that went 6 px past brought the card back to
`top: 8`, which confirms the landing itself works.

Closes #6390 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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