Repository navigation
Hold a thread the agent starts on a bare diff line behind its margin marker - #1550
Merged
Merged
Conversation
…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]>
…rrival 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]>
leaf-agent
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A thread the agent started on a diff line with no thread grew the page under the reader.
lf-diffopened 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:
How
thread/held-news.jsstays the one owner of held in-flow news. BesideHeldNews(a seat that already exists),HeldArrivalscovers the seats a widget has not opened.surfaces.jskeeps 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)answersnullfor 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 withHeldNews). A datum that already draws a thread has a seat, and that seat'sHeldNewsholds the arrival in its row as before. The two classes share the user-gesture test (ownTurn, extracted fromHeldNews) and the off-screen watch.The margin's marker press (
openThreadChoice) callsshowHeld, 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.jsheader, the Stability paragraph inskills/leaf/assets/AGENTS.md, andtarget(key)inreferences/packages.md.Tests
test_a_thread_the_agent_starts_on_a_bare_diff_line_waits_at_its_margin_markerintest_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.🤖 Generated with Claude Code