Repository navigation
Let a key leave a thread card's end while the card is being placed - #5384
Merged
Merged
Conversation
Pressing `u` or `k` with a card's transcript at its end starts a glide whose first frame can write where the box already stands. A card placement in that frame read the transcript as still at its end, called `scrollToEnd`, and stopped the glide, so the key did nothing. `followsEnd` answers whether a box stands at its end with no glide taking it away, and the card's placement, its reading of an arriving turn and the thread card's news check all ask it. test_a_call_ends_before_codex_gives_up_on_it now checks the exit status rather than the pid the stand-in launcher writes, since the 0.5 s deadline can end the launcher under load before it writes one.
leaf-agent
approved these changes
Nov 4, 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.
uv run pytest testspasses on CI at every recent merge, but two of its tests failed onmainin a local run on a busy Mac.leaf-dev flake(18 concurrent copies) reproduced both and shows both gone with this change.test_reading_keys_follow_a_submitted_comment_s_viewport, 9 of 18 copies failed, now 0 of 18. A user can hit this one. Pressinguorkwith a thread card's transcript at its end starts a glide whose first frame can write where the box already stands, because that frame's timestamp can precede the press. A card placement in the same frame read the transcript as still at its end, calledscrollToEnd, and stopped the glide, so the key did nothing. An instrumented run showed the sequence: keydown, a glide tick writing the same offset,measureThreadCard'sscrollToEnd, then no further tick.followsEnd(scrolling.js) now answers whether a box stands at its end with no glide taking it away. The card's placement, its reading of an arriving turn and the thread card's news check all ask it. A glide heading down to the end still reads as not following until it arrives, as before.test_a_call_ends_before_codex_gives_up_on_it, 3 of 18 copies failed, now 0 of 18. The test read the pid the stand-in launcher writes, and under load the server's 0.5 s deadline can end the launcher before it writes one. The test now checks the exit status,-15, which shows the deadline's SIGTERM ended the command. What it protects is unchanged: a call ends at the deadline and says so.The other routes off a card's end (
k, PageUp, ArrowUp, the wheel) each passed 18 of 18 copies on this tree. The broad selection passes locally with 8 workers, and the 31 browser tests that read a margin card's transcript pass by node id.