Repository navigation
Size a message's fenced code to its lines, and let the draft's fences stand for its padding - #4273
Merged
Merged
Conversation
… stand for its padding A one-line fenced code block in a thread message stood 70px tall, in Chromium and Firefox alike: a code line of padding above and below its one line (20 + 20 + 20), the 8px scrollbar clearance and its borders. #3486 gave fenced code that padding so a sent message matched its draft, where each fence keeps a full line. Agents' replies, which never had a draft, paid for it too. The message's fenced code now takes the padding every message pre has (`--pre-pad-block`, 8px), so the same block is 46px. The draft lines up with it the way in-place editing already did: a fence's line, while the caret is away from it, is as tall as that padding, and grows to a full line, showing its backticks, while the caret is on it. The in-place field still reads its display's padding over this rule. `test_a_draft_draws_a_list_as_the_message_will` holds draft and message to one height with a fenced block in the draft; without the draft rule it fails by the two fences' 12px each. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # dist/kernel/kernel.json
# Conflicts: # dist/kernel/kernel.json
leaf-agent
approved these changes
Oct 26, 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 fenced code block in a thread message was 70px tall in both Chromium and Firefox, with 20px of that taken by its one line of text. The rest was a full code line (20px) of padding above and below the text, the 8px kept free for the sideways scrollbar, and the borders. #3486 added that padding so a sent message would be exactly as tall as its draft, where each
```line takes a full line. Agent replies never had a draft, but they got the padding too.A fenced block in a message now gets the 8px padding (
--pre-pad-block) that every message code block already gets, so the same block is 46px. The draft still matches the sent message, now by the method in-place editing already used: a```line is as tall as that padding (8px) while the caret is elsewhere, and opens to a full line showing its backticks when the caret moves onto it. The in-place field still reads its display's own padding over this rule (readFaces).Behavior change: typing a fence in a draft now moves the text below it by 12px when the caret leaves the
```line.Measured with
leaf-dev probe, in both engines:test_a_draft_draws_a_list_as_the_message_willalready holds draft and message to one height with a fenced block in the draft. Without the draft rule it fails by 24px, 12px for each of the two fences.