Skip to content

Fit a margin card's rewrite into its message's lines instead of reserving room - #3064

Merged
max-sixty merged 3 commits into
mainfrom
edit-room-without-reserve
Oct 18, 2026
Merged

max-sixty merged 3 commits into
mainfrom
edit-room-without-reserve

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

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 Make a message's rewrite the reply box's own field #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

max-sixty and others added 2 commits October 15, 2026 14:58
…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
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]>
@max-sixty
max-sixty merged commit 845c7c4 into main Oct 18, 2026
4 checks passed
@max-sixty
max-sixty deleted the edit-room-without-reserve branch October 18, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants