Repository navigation
Seat thread cards in their widget's box and ground, as the margin card - #6682
Merged
Merged
Conversation
A thread a widget seats in its own flow (a diff line, a diff file, a task row, a
visual review case) had no frame from Leaf: each widget drew one around it, and
Leaf's only frame was its focus treatment, a quiet ground plus an inset ring. In a
diff that meant a 760px thread with no side padding on a paper band, a grey box that
appeared on focus, and an agent's last words running under the ring (the case Max
hit on the developing-leaf-role page).
Core now gives every seated thread the margin card's face: an inset 1px frame,
large corners, paper, the card's 12px inset and 592px measure, and words ending as
far inside as they start. Focus on the thread rings the card's edge; focus within it
paints nothing. The frame is a shadow rather than a border because a resolved card
folds its room away and border widths snap to 1px until the fold ends. The quiet
ground token, the rule lines between seated threads, the diff's measure and padding
overrides and the command hub's own thread override are deleted.
The diff's line outlet stands the card at the code column, as author notes do, or
its own inset from the rows' edge where the diff is too narrow. A new comment's box
takes the card's measure and inset, so Send leaves its words where the card shows
them (in a command hub task row they moved 13px right). The resting Reply
press centres its hint and hides Send, which showed in Firefox.
A seat's Resolved row names the threads it holds ("Resolved · 2 · name, name"), as
code review tools' folded threads do; tests that read "Resolved · 1" now read the
name.
The diff gallery gains a line-conversation section with a long reply, and stills
gains two states for it (at rest, and stepped onto with t), so `leaf-dev stills`
shows a line thread. test_an_edit_above_the_paragraph_read_holds_it... gives the read
paragraph unique words: its repeated filler made the reading line's quote ambiguous
in a card under about 650px wide, and the test failed in Firefox on main too in
windows of 680px and narrower.
leaf-agent
previously approved these changes
Nov 21, 2026
… can close the page The site build closes every example page, and a user comment with no answer refuses the close. The gallery's backoff question now has the agent's reply.
leaf-agent
previously approved these changes
Nov 21, 2026
…ard's reply field A seated thread card now takes its reply field geometry and message text end from the margin card's own rules (response.css names seated outlets beside .lf-margin-preview), fills the box its outlet gives rather than stopping at the card measure, keeps each message to the width it has in a margin card at that measure, and paints the ground its host declares rather than the page's paper. The margin card already works this way: placement gives its box, the page its ground. lf-diff declares its code canvas's ground, field and border colours, so a card on code stands on white with the code's grey border, and insets its line outlets by one gap at both ends. It drops its own rule that rested a conversation's reply as a bare "Reply…" press: the user had chosen the press to save height under a file, and on reviewing the cards asked for the margin card's field instead. The inline comment box fills its seat like the card it becomes. Rejected after a fresh-eyes review of captures: the card in the page's paper on white code, and a card filling the row with its words running to the row's end (about 115 characters a line). Behavior change in tests: test_a_diff_conversation_s_reply_rests_as_a_press_that_c_opens becomes test_a_diff_conversation_s_reply_rests_as_the_margin_card_s_field: the reply rests framed, one response line tall, with the microphone, on the code's ground; `c` and a kept draft still work.
leaf-agent
reviewed
Nov 21, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
I'm not approving yet. The description says two choices are still yours to make: whether a diff card fills its row or stops at 592px, and whether it stands on the code's white or the author notes' grey. An approval would let this merge before you answer them. The head commit already takes one answer to each: the card fills its row and stands on the code's ground. If those answers are your decision, edit the description to say so and approve. I have nothing to change in the code itself.
The user chose a diff's thread card that fills its row (over the margin card's 592px width and a frameless band) and stands on the code's white (over the author notes' grey). Both were already drawn; the seat's comment and the diff's ground comment now say the user chose them, and list the band among the rejected shapes. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
approved these changes
Nov 21, 2026
This was referenced Nov 22, 2026
Keep a seated card's reply box at the margin card's width, and test the seated card #6682 drew
#6713
Merged
leaf-agent
added a commit
that referenced
this pull request
Nov 22, 2026
…he seated card #6682 drew (#6713) #6682 seated every thread as a card that fills its widget's row and keeps the margin card's message width, but its reply box still ran across the whole row. A message's rewrite takes the message's width, so in a seat the rewrite stood 128px narrower than the reply box beside it (566px vs 694px), and a reply typed across the full row rewrapped narrower once sent. The reply box now ends where the card's messages end, which is how the margin card lays it out. Its words wrap where they will once sent, and a rewrite is as wide as the reply box. `test_a_rewrite_is_the_reply_box_where_the_words_stood[seat]` fails on main and passes here. **On screen:** a seated card's reply field, in a diff line or file thread, a command hub task row or a visual review case, now ends at the messages' right edge instead of the card's. The card itself still fills the row, and the comment box a seat opens keeps the seat's full width, as #6682 set it. | Before (main) | After | |---|---| |  |  | Three tests asserted the seated design #6682 replaced. They now assert its replacement: - `test_forced_colors_keep_inline_thread_focus_visible`: in a forced palette the card's frame is a 1px outline on its edge (#6682's rule), and the focused reply field draws its own 2px ring. Before, the test expected a 2px focus ring on the whole thread. - `test_inline_thread_surface_has_room_without_focus_reflow`: seated threads are framed cards a gap apart, with no rule between them. #6682 deleted that rule on purpose. - `test_the_user_s_words_end_where_the_agent_s_do[seat]`: a seated card ends every message's words one inset in (`--lf-msg-text-end`), as the margin card does, so the user's and the agent's words end at the same place. The panel case is unchanged. All four tests from #6709 fail on main and pass on this branch. The seated-thread, resolving, diff-controls and diff widget browser files pass (133 tests). Pictures: `leaf-dev stills --state diff-line-threads`, plus `diff-file-reply`, `hub-seat-comment` and `hub-seat-held-news`, which change the same way. Narrowing the reply field is a visible choice that #6682 didn't settle explicitly. An issue asks the maintainer to confirm it. Closes #6709 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 22, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 22, 2026
…ery's replies ids (#6737) `test_a_shipped_log_replays_its_example_state` in `tests/journeys/test_render_pages.py` fails on main with `KeyError: 'id'`. Two seeded agent replies in `examples/developer/diff-thread-gallery.jsonl`, added in #6682, have no `id`. #6682 never ran this test, because a pull request runs only the journeys tests it edits. The seed was valid. Admission gives an event an id when it has none (`append_admitted`), and `examples/AGENTS.md` says a seed line is an event as its writer would send it. The test's `{event["id"] for event in events}` was what required every shipped event to carry an id. It now checks only that each id a seed names survives replay, so the next seed that leaves an id to admission passes. The two replies also get ids now, `dfg-line-cap-answer` and `dfg-line-backoff-answer`, like every other seeded event in the corpus. Nothing reads a reply's id, so the gallery draws the same threads. The test failed on main at 850e0bf and passed after the seed edit (`uv run pytest tests/journeys/test_render_pages.py::test_a_shipped_log_replays_its_example_state -n0`). This PR edits the test file, so its CI runs the test against the change to the test. --------- Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 22, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 22, 2026
…#6748) This repairs the four journeys tests that have failed since #6682 seated thread cards. Each fails on main and passes here, in Chromium, and in Firefox where the test runs it. The tests have three separate causes. None of the repairs gives up anything #6682 meant to do. - **`test_margin_card_holds_its_top_while_read_and_its_reply_while_written`** (unchanged write on `div.lf-box-moving-ring`). #6682 deleted the quiet focus ground, and with it the rule that kept a page thread from wearing an outline while focus was within it. A send in a margin card moves focus from the reply field to the thread. For the rest of that task the thread matches `:focus-visible` but doesn't yet carry Leaf's `data-lf-focus-visible`, so it wears the browser's own `auto` ring. box-motion reads rings during that gap. It found two (the thread's black UA ring and the field's blue ring) and drew both on its one moving-ring layer, which left the layer's `style` where it started. `.lf-ring-overlay:is([data-lf-focus-visible], :focus-visible)` now drops the overlay's own outline. The thread's ring is still the `::after` that Leaf's focus mark turns on, as #6682's surfaces.css header describes. - **`test_sends_from_a_page_threads_box_hold_its_foot_at_the_bands[diff-4-browser]`** (a scroll during Enter moved the box by (0, −22)px). Each Shift+Enter grows the reply box by a line, and `keepInBand` scrolls so the row's foot stays at the reading band's foot. It asked for `scrollTo(1090.578)`, and the browser snaps scroll offsets to device pixels, so the page landed at 1091. The box's foot ended a pixel higher than before, which counts as carrying the box under the user's aim. #6682 only moved the row to a fractional offset that rounds up (the parent's offset rounded down). `keepInBand` now has `land` in `landing-scroll.js` travel only the whole device pixels of its move, which leaves the row's foot less than a pixel short of the band instead of up to a pixel past it. Every other landing reveals something and keeps the browser's own snapping, so a target a fraction past an inner scrollport's edge still comes fully into view. - **`test_the_page_holds_still_under_the_user[reading-reply-below-chromium|firefox]`** ("the thread doesn't end below the place"). The fixture needs the long thread's last message to start inside the window. The seated card's padding and message width pushed it 93px below the window, so the fixture has one fewer exchange. The behavior under test is unchanged. On screen: the landing change moves a held reply row by under a pixel. The CSS change removes the browser's focus ring from a thread in the moment before Leaf's ring replaces it. Checks run: the four tests by node id; all of `tests/journeys/test_page_holds_still.py` (124 passed, 34 xfailed); `tests/journeys/threads/test_composing.py`; the browser tests for composing, draft reading place, send placement, navigation reading place, anchors, seated threads and scroll writes (360 passed); `pnpm run test:runtime`, including runtime tests for the held reply row and a fractional reveal in an inner scrollport; `pnpm run check`. Left as is: box-motion still has one moving-ring layer, so a reading in which two parts change size while both wear rings would draw only the last one. Nothing hits that once the thread no longer wears the UA ring. Closes #6741 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Nov 22, 2026
…olds_still (#6768) The `reading-*` cases of `test_the_page_holds_still_under_the_user` need the `notes` thread's reply box below the window while the thread's last message starts inside it. The only thing between those two edges was the last reply's height, about two lines. On Linux (Chromium) the reply box stood just 6px below the 900px window, and macOS's taller line metrics brought it fully into view. That failed `put_reading`'s setup in all 12 cases (#6766) once #6748 dropped an exchange so the last message would start inside the window under #6682's seated card. The last reply now runs eight times as long. Only text below the last message's top grew, so the message still starts where it did, 775px down the window. The reply box now stands 300px below the window instead of 6px, far more than the two platforms' line heights differ by. What the cases test is unchanged, and so is what #6748 intended. **Verification** - Linux: the 12 cases pass. Probing `put_reading` in Chromium (`reading-reply-above`) before and after, the last message's top stays at 774.7px in both, and the reply box's top moves from 905.7px to 1199.7px. - macOS: two `test-macos` flake dispatches of the 12 cases are running, one on this branch ([run](https://github.com/max-sixty/leaf/actions/runs/45071051936)) and one on main's `75c3a82cb` ([run](https://github.com/max-sixty/leaf/actions/runs/45071054336)). Their results will be added here. Closes #6766 — automated triage Co-authored-by: leaf-agent <[email protected]>
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 a widget seats in its own flow (a diff line, a diff file, a command hub task row, a visual review case) got no frame from Leaf, so each widget drew its own, and in a diff an agent's longest line ran under the focus ring. Now Leaf draws every seated thread as a card with the margin card's frame, inset, reply field and message width, and takes only two things from the widget: the box its outlet gives, which the card fills, and the ground the widget declares (
--lf-ground), which it stands on. That is how the margin card already works: placement gives its box and the page its ground.lf-diffdeclares its code canvas's ground, field and border colours and places its outlets; its own reply rule, the per-widget thread overrides, core's quiet focus ground and the rules between seated threads are deleted.Also: a seat's Resolved row names its threads ("Resolved · 2 · name, name"); the frame is an inset shadow because a resolved card folds its room away and border widths snap to 1px mid-fold.
Where to look: every widget seat changes. A diff card's reply now rests as a framed field, reversing an earlier choice of a bare "Reply…" press, at the cost of 13px per conversation. Max chose a diff card that fills its row (over 592px or a frameless band) and stands on the code's white (over the author notes' grey); he's landing this as an unfinished step. A reviewer with no context compared the earlier version with GitHub, GitLab and Gerrit and found it no worse except at folding long threads.
Tests: the model stylesheet tests and the focused browser tests for diff, seated, resolving, comment-box and command hub threads pass, in Chromium and Firefox where they run both; the runtime suite and
pnpm run checkpassed on the first commit, and the latest changes no script.