Repository navigation
Draw a draft's editor in the faces of the prose it replaces - #3776
Merged
Merged
Conversation
Opening a draft drew its Markdown in a sent message's face, so every word after its first block moved: a heading shrank from 24px to 17px, each gap between paragraphs grew by 14px, a code block's code dropped 21px, a 388px picture became a 158px line of source, and the mark after an external link vanished. Each word, picture and mark now stays where the prose showed it, in Chromium and Firefox. The draft names its prose as the element the field's words are shown as (`facesOf`). As the editor builds, and when its width changes, an empty copy of that element holding one of each block stands hidden beside the field and is read, so the page's own rules and density reach it. The rules it yields go in a sheet of the field's own, and each line names its block's face and the gap before it, so blank source lines stand as the gap the prose leaves between two blocks, inside quotes too. Behavior that changes in every editor, the reply box and message rewrites included: - a picture is drawn as the picture, and stays drawn after its source while the caret is in it; a press on it opens its source; - the mark after a link that leaves the page shows, drawn by the same code as the page's (prepaint.js now shares it); - a code fence's line, and a Setext heading's rule, show their marks only while the caret is on that line, not anywhere in the block. browser/AGENTS.md's "Editing in place" now covers drafts, with test_a_draft_edits_where_it_reads as its check. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # browser/runtime/prepaint.js # dist/kernel/kernel.json
leaf-agent
approved these changes
Oct 23, 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.
Opening a draft drew its Markdown in a sent message's face, so every word after its first block moved: a heading shrank from 24px to 17px, each gap between paragraphs grew by 14px, a code block's code dropped 21px, a 388px picture became a 158px line of source, and the mark after an external link vanished. Each word, picture and mark now stays where the prose showed it, in Chromium and Firefox. The user chose this over drawing drafts in a message's face; it completes the "Editing in place" rule #3737 added to
browser/AGENTS.md.composing/text-field.js): the draft names its prose as the element the field's words are shown as (facesOf). As the editor builds, and when its width changes, an empty copy of that element holding one of each block stands hidden beside the field and is read, so the page's own rules and density reach it. The rules it yields go in a sheet of the field's own; each line names its block's face and the gap before it, so blank source lines stand as the gap the prose leaves between two blocks, inside quotes too.prepaint.jsnow shares it); a code fence's line and a Setext heading's rule show their marks only while the caret is on that line.test_a_draft_edits_where_it_readschecks each word, the picture and the mark across a draft with headings, a link, blank-line runs, a list, a fence, a quoted heading, a Setext heading and a picture, then typing a new paragraph, the caret in code, a press on the picture, and pictures named by reference or split across lines.