Skip to content

Stand a card on a log row in the rail, and let a card rise as an answer arrives - #4843

Merged
max-sixty merged 12 commits into
mainfrom
thread-card-grows-over-media
Nov 1, 2026
Merged

max-sixty merged 12 commits into
mainfrom
thread-card-grows-over-media

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

A comment on a row inside a bounded block, such as a log written with data-bound, got a card inside that block, no taller than the block: on a 10rem log the agent's answer arrived in a 144px card that scrolled its transcript. A card opened beside a log too short to hold one moved into the log once rows filled it. This stands that card, and the comment box it grows out of, in the rail beside the log, where the row's margin entry already stands, and lets it grow into the window.

One box did two jobs, giving the surface its room and cutting it as its row scrolled away. Now:

  • Room comes from the box whose flow holds the row: the box that scrolls it, or, past any bounded blocks around it, the box that scrolls those (flowOf in margin-layout.js, which also decides where the row's margin entry stands, so the two follow one rule). A log in the page gives the window; a log in a workspace pane gives the pane.
  • Cut: each bounded block around the row cuts the card at an edge the row's line or column has crossed, and never moves it. The top cuts once the card's own top, 8px above the line, passes it, so the cut grows from nothing. Panes cut as before.

A first version also bounded the room at a crossed edge. Review measured it pushing a card 292px up over its row as the row passed the log's foot, and 16px at the top; that's gone, and the sweep below holds it.

Behavior changed: a surface on a row in a bounded block stands in the room of the box around the block. In a window too narrow for the rail it opens under or over the row in the page, past the block's foot, scrolling the page to make room as for a paragraph. A card beside a tall subject whose top has crossed a log's top slides under the edge with it rather than waiting there. A nested block's row now has its margin entry in the rail. Screenshots, flowing panes and workspace panes place as before (measured against main).

A card being read beside its words now also rises as an answer arrives, as a card being written in already did: near the window's foot a long answer used to grow it to the foot and then scroll its transcript, hiding the question above the answer (thread/card-anchor.js, rises). The maintainer chose this knowing its cost: the card's head row, with Close and Resolve, moves up with it as the answer lands. A press and a send's hold still keep their edge, and a card under or over its words still grows away from them.

Tests:

  • test_a_card_on_a_log_row_stands_beside_the_log_and_leaves_with_its_row (browser) fails with the block holding the room and without the crossed-edge cut.
  • test_an_answer_arriving_lifts_a_card_beside_its_words (browser) replaces test_a_thread_uses_room_the_page_gives_it, which held a read card's top, and fails with the old rule; test_a_turn_arriving_leaves_a_card_under_its_words_where_it_stands now names and checks its premise, a card under its words.
  • test_every_card_keeps_the_placement_rules (journeys, daily) sweeps a paragraph, a log, a flowing pane, a log in a log, workspace panes, a log in a pane and a screenshot, at 1440 and 820 wide, through scrolls to the window's foot and out of each box, against four rules: whole and uncut in the window while the row shows whole; nothing shown past an edge the row crossed; no other bounded pane covered; and beside the row, moving with it step for step across those edges. It passes on the branch; with main's placement it reports the log cap (4 of 6 cases), with this branch's first version both jumps (396px at a log's foot, 14px at its top), and it catches a missing crossed-edge cut and a missing pane room put in on purpose. It takes about a minute at 4 workers.

Decided: a card on quoted words in a log of unwrapped lines follows them sideways, over the log's lines, when the log scrolls horizontally, as quoted words carry a card on both axes everywhere else. The maintainer chose the simpler option over holding the card in the rail, which would have needed a second rule for the inline axis and a cut that hides the card once its words cross the log's side.

Inherited, failing locally with main's runtime too: test_a_press_in_the_card_keeps_the_pressed_spot_still[press] (a "1m ago" timestamp), test_a_card_at_the_windows_foot_grows_back_to_how_it_stood, test_an_agent_reply_leaves_the_reply_being_typed_where_it_stands, and test_a_rewrite_leaves_a_card_at_the_windows_foot_as_it_stood about one run in three.

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

A comment on a row inside a bounded block, such as a log written with
`data-bound`, stood its box and card inside the block, so the card could grow
no taller than the block: on a 10rem log the agent's answer arrived in a 144px
card that scrolled its transcript. A card opened while the log was too short to
hold one stood in the rail, then moved into the log once rows filled it.

One box did two jobs: it gave the surface its room and cut it as the row
scrolled away. Placement now takes the room from the box whose flow holds the
row (`flowScroller`, margin-layout.js): the box that scrolls the row, or, for a
bounded block, which scrolls inside the box around it as a paragraph does, the
box that scrolls that one. That is the rule the margin already follows for the
row's entry (`railBeside`, now derived from it), so the card stands in the rail
beside the log, where the entry stands, and grows into the window. The block's
edges bound the room and cut the card only where the row has crossed one,
above the block's top or past its foot, so the card waits at the log's top
while its row is partly shown and slides under that edge with it. The box that
scrolls the room makes room for a card opening under or over its row.

Behavior changed: a surface on a row in a bounded block stands in the room of
the box around the block (the page, or a workspace pane holding the block). In
a window too narrow for the rail it stands under or over the row in the page,
past the block's foot, rather than inside the block. Panes, screenshots and
flowing panes place as before.

Tests: `test_a_card_on_a_log_row_stands_beside_the_log_and_leaves_with_its_row`
fails with the block holding the room (the card moves into the log as it
fills) and without the crossed-edge cut.
A crossed edge bounded the card's room as well as cutting it, so a card hanging
past a log's foot was pushed up over its row once the row's line passed the
foot (292px in a review probe), and a card beside a row jumped 16px as the row
crossed the log's top. The edges of every bounded block around the row now cut
the card, once the row's line and column have crossed them, and never move it:
the room stays the flow's. The top cuts once the card's own top, a gap above
the row's line, passes it, so the cut grows from nothing. Nested blocks are
each tested, so a row whose inner log scrolls out of an outer one leaves too.

A card beside a tall subject whose top has crossed a log's top no longer waits
there; it slides under the edge with its row.

The sweep in tests/journeys/margin/test_card_placement.py reads every card
in the page's flow, a log, a flowing pane, a log in a log, workspace panes, a
log in a pane and a screenshot, at 1440 and 820 wide, through scrolls that
carry the row to the window's foot and out of its box, against four rules: a
card is whole in the window, uncut, while its row shows whole; nothing of it
shows past an edge its row crossed; in a bounded pane it covers no other pane;
and beside its row it moves with the row step for step across those edges.
Leaf puts back a box's scroll that no input made while a card's thread holds
focus, so the sweep's scripted scrolls were partly undone and it never crossed a
log's foot. It now turns the wheel at a spot where the box it means takes it.
A card the window's edge holds in may stand still as its row moves, but never
move further than the row; a card that closes is reported rather than crashing
the read. With these, the sweep reports the first version's 396px jump at a
log's foot.
…r-media

# Conflicts:
#	dist/kernel/kernel.json

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

Withholding approval while the PR’s stated hold remains: the maintainer still needs to decide whether a card on quoted words in horizontally scrolling log lines follows those words sideways or stays in the rail.

@max-sixty

Copy link
Copy Markdown
Owner Author

@leaf-agent the hold your review named is settled: a card on quoted words keeps following them sideways, as the branch already does, and the description now records that. Please review the current head again.

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

…r-media

# Conflicts:
#	dist/kernel/kernel.json
leaf-agent
leaf-agent previously approved these changes Oct 31, 2026
A card being read kept its top where it opened. Near the window's foot, a
long answer grew it to the foot and then scrolled its transcript, which hid
the question above the answer. A card being written in already rose, the
window's foot lifting it, so the two disagreed. Beside its words a card now
rises whether it is read or written in (the user's decision, 2026-10-31);
a press and a send's hold still keep their edge, and a card under or over
its words still grows away from them.

Behavior changed: an answer arriving in a card near the window's foot moves
its head row, Close and Resolve with it, up with the card.

Tests: test_a_thread_uses_room_the_page_gives_it asserted the held top and
became test_an_answer_arriving_lifts_a_card_beside_its_words, which fails
with the old rule. test_a_turn_arriving_leaves_the_card_being_read_where_it_stands
now names its premise, a card under its words, and checks it.
…r-media

# Conflicts:
#	dist/kernel/kernel.json
@max-sixty max-sixty changed the title Stand a card on a log row in the rail beside the log Stand a card on a log row in the rail, and let a card rise as an answer arrives Oct 31, 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.

The reading-stability failure is inherited, so I withdraw it as a blocker for this PR. I reproduced the exact pending-case movement on current main 2c080bbbcd7ba52f89f0c87e6b50077fe7a9e954: [10, 111, 191] became [21, 122, 202] at append_tokens(8), with the card's top unchanged. The five-case selection returned four passes and one failure on both main and the reviewed head. With only the head's rises condition reverted, both streaming cases showed the same movement. The runtime suite was not running alongside these checks.

The cause remains unresolved; #4863 owns that investigation separately. CI polling confirmed green checks on 16c87eb5f7a57f625b6efbb273ce075dac4d9940. No remaining finding from my prior review blocks this head.

This updates the existing review because Tend's posting preflight refuses another review on an already-reviewed head. It does not create a standing approval, so the automated landing gate remains unmet.

@max-sixty

Copy link
Copy Markdown
Owner Author

@leaf-agent on the unattributed failure in test_sending_during_a_stream_keeps_later_tokens_from_moving_the_reading[pending] from your review of 16c87eb:

  • It doesn't reproduce. On 16c87eb, the pending case passed 10 runs out of 10 under taskpolicy -b, which slows headless Chrome to about 10 fps, with runs of 34–196 s. With only the rises line reverted to the old rule, it passed 10 runs out of 10 the same way. Your five-case selection (-k 'a_margin_reply_send_shows_the_sent_turn or a_growing_margin_reply_keeps_the_previous_turn_visible or sending_during_a_stream') passed 4 runs out of 4 with pnpm run test:runtime running beside it, as in your failing run. CI's test passed on this head.
  • The new rule is in play on this path. Counting prepare calls in this test, the new rises condition differs from the old one in 14 of 27 placements: the card stands beside its words, isn't being written in, and no press or send holds it. So the passes above did exercise the change.
  • The failure doesn't look like a rise. This is my reading of comment-placement.js, not a measurement. rises only changes the height cap that fit gets: the window's whole height instead of the room below the card's top. When that changes anything, the card outgrows the room below and the window's foot lifts it, so its top moves up. The run you saw kept the card's top fixed and moved the messages down 11px inside it, which means the transcript's scroll changed with no change in the card's height cap.

I can't explain the 11 px move. It doesn't reproduce on this head, with or without the change, so I'm treating it as not caused by this PR. Please review the current head again.

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

leaf-agent
leaf-agent previously approved these changes Oct 31, 2026
…r-media

# Conflicts:
#	dist/kernel/kernel.json
@max-sixty
max-sixty merged commit e9d6fdc into main Nov 1, 2026
4 checks passed
@max-sixty
max-sixty deleted the thread-card-grows-over-media branch November 1, 2026 00:12
max-sixty added a commit that referenced this pull request Nov 1, 2026
`test_a_card_on_a_log_row_stands_beside_the_log_and_leaves_with_its_row`,
added in #4843, read the card's `--lf-cut-top` as soon as the log's
scroll settled. Placement follows a scroll a frame or more later, so on
a loaded host the property was still unset and the test read `NaN`. That
happened in 1 of 4 local runs at a load average near 60, though CI
passed it every time. The test now waits for the cut to be written
before reading it. The behavior it checks is unchanged, and it passed 3
runs out of 3 at the same load.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 2, 2026
…dge holding it (#5054)

A margin card whose foot stood near the window's foot jerked as a new
line came and went in its reply: the first frame drew the card part of a
line lower, then it slid back up. The user reported it in Firefox on 31
October. The card now travels from where it stood, in Firefox and
Chromium. The comment box beside a passage had a larger jerk of the same
kind: after a scroll, its first new line drew it for one frame where it
stood before the scroll, hundreds of pixels away. That is fixed too.

## Cause

A new line that takes the card past the window's foot makes its
placement hold it by that foot instead of beside its passage
(`floating.js`, `held`). `box-motion.js` takes how far the page carried
a box from the edge that holds it, so across that change the line's move
read as the page carrying the card whole. The card also read its new
size before the placement that size asks for had moved it, so its
outline started toward the old spot and turned back a frame later.

## What changes

- **One order for both boxes.** The card and the comment box now stand
the box through `placed()` before the motion reads a change of its size.
The comment box already worked this way; the card's size observer now
asks for its placement and reads in that placement's landing.
- **What travels and what is carried.** A placement at the size last
read is the page's move and is carried, as when a scroll re-solves a box
held at the window's edge. A placement that answers a change of size
travels from where the box was drawn, except for as far as its passage
moved past it since the box was last read or placed, which is carried
(`planeShare`).
- **Chromium's one-frame lag.** Right after a box is taken into its
anchor's plane, Chromium lays it out off its spot until the next frame,
by up to a few hundred pixels. So the move is taken from the placement's
own answer (`stand()` returns it, from `clientBox`), and how far the
passage moved past the box is read from the anchor and the element its
plane moves with (`heldEdges` now hands over `by` and `plane`), never
from the box.
- **The comment box's motion root.** It was the field's parent, a
`display: contents` wrapper with no box, so it read no carry at all. It
is now the composer.
- A grip drag's end now stands inside the placement, so the placement's
move includes the drop.

## Tests

-
`test_a_line_that_changes_the_edge_holding_a_card_moves_it_from_where_it_stood`
(browser, Chromium and Firefox) fails on `main`, where the card's top,
head row and turn jump about 11 px to their rest in the first frame.
- `test_every_part_of_a_floating_box_moves_one_way_per_input` (journeys)
is a Hypothesis property over the card, the comment box and the panel's
field. `tests/page_scripts/motion_frames.js` records where every painted
part of the box is drawn after each frame: its outline, its controls and
each run of words. The test fails any part that moves two ways on one
axis within one input. It draws the draft, where the box stands against
the window's foot, and the key timing. Both jerks above are its explicit
examples. Hypothesis joins the dev dependencies.
- 20 derandomized and 60 random cases per engine pass. The focused
browser tests around cards, the comment box and the panel pass, but for
`test_a_wheel_return_attaches_the_comment_box_in_the_first_visible_frame[combined-selection]`,
which fails the same way with `main`'s runtime. `pnpm run test:runtime`
passes.

## Still open

Found by the property test or by probes, and present on `main` too:

- A card scrolled back about 200 px while it shrinks, letting go of the
window's foot, travels about 60 px up from below that foot. Fixing it
needs the placement to record the boundary that held the card.
- In Firefox, a comment box held by the window's foot rides the page's
smooth scroll into the reading band, then snaps back to the foot. The
open comment box always stands in the page's plane, which causes it.
- When an answer arrives in a card being read near the window's foot,
#4843 makes the card rise. On `main` the first frame drops the card
about 90 px to the window's foot; here the outline grows from where the
card stood. The question, head row and Reply field still vanish and
reappear higher up, because news shows each part where it now stands.
Whether such an answer should slide the card's contents up as a Send
does is the maintainer's call.
- A box held at the window's foot can vibrate by under a pixel after a
new line, and Firefox rarely logs a ResizeObserver loop error.

> _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