Repository navigation
Make a message's rewrite the reply box's own field - #2813
Merged
Merged
Conversation
Editing one of your own messages opened a box thinner and narrower than the Reply box under it. The editor was a frame painted around the words where they stood, with no padding of its own, so opening it moved nothing; in a margin card holding a comment just sent it also kept the sent draft's narrow measure. The editor is now a comment box like the reply box: the same frame, padding, focus paint and width, reaching back over the transcript's inset so its words keep the message's. Its ring is drawn inside its frame, since the scrolling transcript clips one drawn outside. This reverses the recorded decision that opening a rewrite moves nothing (message-edit.js header): opening now grows the message by the box's padding, and closing returns it. A composer field now keeps end room for its action only where it holds its submit control, so the rewrite's words, whose Save stands at the message's head, take the whole line (on touch the inherited room cost 44px per line). Putting an unchanged rewrite aside, as the up-arrow walk does, now draws its closing in the same paint as the next one's opening, since the thread's held extent otherwise shrank and grew back in one script. Behavior the tests now hold instead: the rewrite matches the reply box's x, width and padding in every reader and in a just-sent comment's card; after a save the reply box moves by exactly what the closed box gave back. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 14, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 14, 2026
The rewrite field from #2813 drew its focus ring inside its border, while the Reply box draws its ring outside. A ring drawn outside lost its left and bottom sides. The margin card's transcript scrolls, and it kept no room past its edges beyond a 6px band at its end for an open progress group's border. The rewrite reaches back over the transcript's text inset to the Reply box's edges, so its ring ran past the transcript's edge and was clipped. Now the transcript keeps room past its inline sides and its foot for whatever is drawn beyond a box: the larger of a focus ring and a progress group's border (`--lf-transcript-room`). That room comes out of the card's inset, so the words keep their place and width. The rewrite's inset-ring rule is deleted, and its ring matches the Reply box's. The card's actions (✓ ×) also painted their opaque ground over the right side of a focused Edit or Save ring at the message's head. That ground now sits beneath the head's own controls, which stop short of the actions. A new pixel test checks every side of the Edit, rewrite-field and Save rings in a just-sent comment's card. Without the transcript room the field ring's left and bottom sides fail; without the stacking change the Edit ring's right side fails. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 18, 2026
…ving room (#3064) A one-line comment's sent margin card is now as tall as the comment box it came from (148 px, against 158 on main), and nothing in it moves when "Sent" arrives or when its rewrite opens. ## Why the card was taller Every user message in a margin card kept room from its first paint for the reply box's taller rewrite field (#2959, moved to first paint in #2985), whether or not the user ever opened the rewrite. Delivery itself needs no room, since "Sent" and the Edit control already stand in the message's head. ## What changes - **The card's rewrite is the comment box the card grew from.** Its frame and padding fit the 5.5 px each card line already keeps, and its words end at the card's text column, so opening it on plain words moves none of them and changes no height. On main, a two-line comment rewrapped to one line in the wider editor and the card shrank 11 px. Markdown still opens as its source, which can be longer than the drawn message, as on main. Outside the margin card the rewrite still matches the reply box, as #2813 decided. - **The card's rewrite field is 10 px shorter than the reply field below it.** The user chose this over matching the reply box, which would make the card grow 10 px when a rewrite opens. - **`skills/leaf/assets/AGENTS.md` states the principle.** Hold room before first paint only for what will be drawn. Hold no empty room for a state that may never come, however likely; show it in a slot already on screen and let the user's gesture make the room it needs. ## Tests The card cases of `test_a_rewrite_is_the_reply_box_where_the_words_stood` and `test_a_rewrite_of_a_comment_just_sent_is_the_reply_box` now assert that the message keeps its height and its words their line, in place of the field matching the reply box's height and padding. Ran, after updating from main (which moved these tests to `tests/browser/threads/test_rewrites.py`): that file, `tests/browser/margin/test_card_reply.py`, `tests/browser/margin/test_card_placement.py`, `tests/browser/test_render_send_placement.py`, `tests/browser/test_render_aim.py`, `tests/browser/threads/test_composing.py`, and `pnpm run check:browser`. All pass. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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.
Editing one of your own messages in a thread opened a field thinner and narrower than the Reply box under it. The editor was a frame painted around the words where they stood, with no padding of its own, so that opening it moved nothing. In a margin card holding a comment just sent, it also kept the sent draft's narrow measure.
The editor is now a comment box like the reply box (
lf-comment-box), with the same frame, padding, focus paint and width. It reaches back over the transcript's inset, so its words keep the message's x. Its focus ring is drawn inside its frame, since the scrolling transcript clipped a ring drawn outside it. This reverses the recorded decision that opening a rewrite moves nothing (message-edit.jsheader): opening now grows the message by the box's padding, and closing returns it.Two follow-on fixes:
afterScript). Otherwise the thread's held extent shrank and grew back within one script, which the write watch fails.The tests now check that the rewrite matches the reply box's x, width and padding in every reader and in a just-sent comment's card. They also check that after a save, the reply box moves by exactly what the closed box gave back.