Skip to content

Hold a thread the agent starts on a bare diff line behind its margin marker - #1550

Merged
max-sixty merged 5 commits into
mainfrom
agent-a8d262a0546e59c51
Oct 2, 2026
Merged

max-sixty merged 5 commits into
mainfrom
agent-a8d262a0546e59c51

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A thread the agent started on a diff line with no thread grew the page under the reader. lf-diff opened a new outlet under the line, and every line and paragraph after it moved down (153px on the test page). No row the diff already draws could carry a notice, because the seat itself was new.

Such a thread now waits in the margin. Its marker is the notice, and nothing in the diff moves until the user acts:

  • Click, tap, or Enter on the marker shows the thread under its line and lands on it (the folded summary, for a thread the agent already settled).
  • A gesture of the user's shows it too: a reply or a resolve in it from the margin card, or a thread they start on the same line, which shows after it.
  • Scrolling the line out of the window shows it there, where its growth moves nothing they see. A thread the user is writing in, in the margin card, stays with them through every release that is not their own gesture, so the card and its draft are not taken away.

How

thread/held-news.js stays the one owner of held in-flow news. Beside HeldNews (a seat that already exists), HeldArrivals covers the seats a widget has not opened. surfaces.js keeps one per widget registration and asks it, before calling the widget's render callback, which of the widget's targeted threads to hold. target(key) answers null for those, so the widget opens no outlet and the margin draws the marker it draws for any thread no widget places.

A thread is held when it is new to the page since the last reading, its datum has no thread the widget drew, and the datum's foot is on screen (growthAfterIsSeen, shared with HeldNews). A datum that already draws a thread has a seat, and that seat's HeldNews holds the arrival in its row as before. The two classes share the user-gesture test (ownTurn, extracted from HeldNews) and the off-screen watch.

The margin's marker press (openThreadChoice) calls showHeld, which releases the threads and, once the pass has drawn them, lands on the first. It lands only while the press is still the user's latest intent (retainUserIntent). The margin keeps the marker of a settled thread a widget holds (heldOut), since that marker is its notice.

Contracts updated: the held-news.js header, the Stability paragraph in skills/leaf/assets/AGENTS.md, and target(key) in references/packages.md.

Tests

test_a_thread_the_agent_starts_on_a_bare_diff_line_waits_at_its_margin_marker in test_render_read_state.py (not nightly, so the shift watch runs) covers nine ends: clicked, tapped (phone), keyboard (Tab to the rail stop, :focus-visible, Enter), settled by the agent then clicked, replied in the card, resolved in the card, started a thread on the line, scrolled away, and writing in the card while the line scrolls away and a second agent thread lands. The news lands more than 500ms after the last input, so Chrome's recent-input window cannot mask a shift. With the hold removed, all cases fail on the shift watch ("p#tail-2 moved without input by (0, 153)px"). Removing the settled-marker rule or the writing-in-card rule fails its case.

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

🤖 Generated with Claude Code

max-sixty and others added 5 commits October 1, 2026 18:41
…marker

A thread the agent started on a diff line with no thread grew the page under the
reader: lf-diff opened a new outlet after the line, and every line and paragraph after
it moved down (153px on the test page). No row the diff already draws could carry a
notice, since the seat itself was new.

held-news.js now owns this case too. `HeldArrivals`, one per widget registration in
surfaces.js, holds a thread the agent starts at a datum where the widget draws no
thread while that datum's foot is on screen: `target` answers null for it, so the
widget opens no outlet and the margin draws its marker, as for any thread no widget
places. Pressing the marker (click, tap, or Enter) shows the thread under its line and
lands on it (`showHeld`). It also shows when the user replies in it or resolves it from
the margin card, starts a thread on the same line (which shows after it), or scrolls
the line out of the window. `HeldNews` and `HeldArrivals` share the user-gesture test,
the on-screen growth test, and the off-screen watch.

Tests: `test_a_thread_the_agent_starts_on_a_bare_diff_line_waits_at_its_margin_marker`
covers the seven ends, with the news landing more than 500ms after the last input so
the shift watch judges the hold; with the hold removed every case fails on the shift
watch.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ser writes in

The agent settling a held thread released it into the diff and moved the lines after
it. Only the user's own settlement or reopening releases it now, and the margin keeps
the marker of a settled thread a widget holds, since that marker is its notice. A user
writing in a held thread's margin card keeps the card as they scroll its line away.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… not theirs

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… latest intent

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 1e84551 into main Oct 2, 2026
5 of 6 checks passed
@max-sixty
max-sixty deleted the agent-a8d262a0546e59c51 branch October 2, 2026 04:37
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