Repository navigation
Fit a margin card's rewrite into its message's lines instead of reserving room - #3064
Merged
Merged
Conversation
…ving room A one-line comment's sent card was 10 px taller than the comment box it came from: every message of the user's in a margin card kept room for the reply box's taller rewrite field from its first paint (#2985), whether or not the rewrite was ever opened. Delivery itself needs no room, since "Sent" and Edit already stand in the message's head. The rewrite in a margin card is now the comment box the card grew from: its frame and padding fit the 5.5 px each line of the card already keeps, and its words end at the card's text column. Opening it moves no word and changes no height, for one line or several (a two-line comment previously shrank 11 px and rewrapped). The card's rewrite field is 32 px for one line, 10 px shorter than the reply field below it; elsewhere the rewrite still matches the reply box's height. skills/leaf/assets/AGENTS.md now says room is held before first paint only for what will be drawn, and what may appear fits into a slot already on screen. Tests: the card cases of the rewrite tests assert the message keeps its height and its words their line, in place of the field matching the reply box's height and padding. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Markdown opens as its source, which can be longer than the drawn message. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 15, 2026
…erve # Conflicts: # skills/leaf/kernel/kernel.json # tests/browser/test_render_threads.py
max-sixty
added a commit
that referenced
this pull request
Oct 17, 2026
…copy #3064 lands first. Its card rewrite (comment-box padding and text column) replaces the equivalent CSS this branch carried, and its tests replace this branch's edits to the same two rewrite tests. What this branch adds on top is the placement fix and its tests. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 17, 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 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
skills/leaf/assets/AGENTS.mdstates 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_stoodandtest_a_rewrite_of_a_comment_just_sent_is_the_reply_boxnow 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, andpnpm run check:browser. All pass.