Repository navigation
Keep Send's room on every line of a text field - #3813
Merged
Merged
Conversation
Typing a space after the last word of a draft could pull that word back up a line. The field kept Send's room after its last words only, as an inline spacer after the last line; #3678 glued the spacer to the last word with a no-break space, so a word that fit only without the room wrapped together with it, and a typed space opened a break between them that let the word rise again. Before #3678 the spacer could instead wrap alone and leave the word under Send. Each mode beside it (every line under a finger, every line while the field scrolls) was another branch where wrapping depended on state other than the words. The field now keeps the room as end padding on every line, the one mode the coarse-pointer and scrolling cases already used, and the anchored comment box already used for every pointer. Where a draft wraps turns on the words and the box's width alone. This removes the last-line decoration, the glued variant, the `endRoom` reading and the panel's `data-lf-end-room-glued`. It reverses the 15 October choice to let the panel's lines above the last run under Send's column; at the user's direction, every line now gives up that room (26px in the panel, more in a card's reply box) for wrapping no keystroke at the end can change. CodeMirror's `break-spaces` also moved a word: a space typed after a word ending at the row's edge took room on that row and carried the word down with it. The field and the sent message's paragraphs now use `pre-wrap`, where a line-end space hangs, as in a textarea. Messages whose words end within a space of the edge wrap a word later than before. A user's sent message keeps the column of the reply box it was written in, so it now ends Send's room short of its edge too: by default `--lf-compose-send-end` (Send's hit box and its insets), which the reply box's room is now stated from, as lf-diff and visual-review threads use. The panel's sent reply kept the field's width by a sum that held only under a mouse; it now counts the room, both of the row's seats and its padding, so a reply rewraps neither under a mouse nor a finger. A margin card's messages keep the anchored comment box's end, so a reply typed in the card still rewraps when sent, as it did before. Tests: `test_a_space_after_the_last_word_moves_no_word` types the reported comment a word at a time and presses Space after each, in Chromium and Firefox; on main it fails at "...strong view". It replaces the test of the scrolling mode, and the touch test of the glued spacer goes with it. The panel row test now holds every line short of Send, and the journey test of Shift+Enter under a full last line, whose room no longer takes a line of its own, now checks that typing on an opened line leaves the words above at rest where they were. > _This was written by Claude Code on behalf of max-sixty_ Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # dist/kernel/kernel.json
leaf-agent
approved these changes
Oct 24, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 24, 2026
The browser write watcher now recognizes CodeMirror's unchanged line-decoration class writes inside `leaf-text`. After #3813 removed the last-line decoration, CodeMirror still reapplies the live preview's `lf-face-p` class while reconciling an editor update. The watcher reported that upstream restatement as a teardown error in nine comment and thread tests on [main CI run 40108257103](https://github.com/max-sixty/leaf/actions/runs/40108257103). The exception covers CodeMirror line classes in `leaf-text`; other class writes remain watched. The representative draft test reproduced the teardown error before this change and passed afterward. All 13 focused cases reported by that run pass locally on this branch. The run's three ring assertions were corrected separately by merged #3815. --------- Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 25, 2026
A message the user sent ended its lines up to 86px short of the agent's reply under it: 86px in the floating panel and 41px in a thread on the page, the room Send takes in the field it was typed in. #3679, a CI fix, narrowed the panel's user messages to the field's width so a draft's list would wrap as the sent message does; #3737 and #3813 widened that room to Send's on every surface. No review weighed the cost to every message the user reads back. A user's message now ends the thread's text inset short of the column (8px in the panel, 13px on the page), as far in as it starts, which is the room its rewrite's frame stands in, so a rewrite still keeps every line where it stood and its frame inside the reply box's width. That makes the rewrite's reach past the column (`--lf-msg-edit-past-end`) always zero, so it goes, with the panel's own sum and the root copy of `--lf-compose-send-end`. A margin card keeps its messages on the comment box's column, as before. Behavior change: a reply typed in the panel or a page thread can rewrap when sent, as one typed in a margin card already did. `test_the_user_s_words_end_where_the_agent_s_do` fails on main by 86px (panel) and 41px (page) and passes here. `test_a_draft_draws_a_list_as_the_message_will` now gives its long list item two lines' worth of words, which wrap to two lines in the field and in the wider sent column alike; its three-line item wrapped a line shorter once sent. > _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.
Typing a space after the last word of a draft could pull that word back up a line. The field kept Send's room after its last words only, as an inline spacer after the last line; #3678 glued the spacer to the last word with a no-break space, so a word that fit only without the room wrapped together with it, and a typed space opened a break between them that let the word rise again. Before #3678 the spacer could instead wrap alone and leave the word under Send. Each mode beside it (every line under a finger, every line while the field scrolls) was another branch where wrapping depended on state other than the words.
The field now keeps the room as end padding on every line, the one mode the coarse-pointer and scrolling cases already used, and the anchored comment box already used for every pointer. Where a draft wraps turns on the words and the box's width alone. This removes the last-line decoration, the glued variant, the
endRoomreading and the panel'sdata-lf-end-room-glued. It reverses the 15 October choice to let the panel's lines above the last run under Send's column; at the user's direction, every line now gives up that room (26px in the panel, more in a card's reply box) for wrapping no keystroke at the end can change.CodeMirror's
break-spacesalso moved a word: a space typed after a word ending at the row's edge took room on that row and carried the word down with it. The field and the sent message's paragraphs now usepre-wrap, where a line-end space hangs, as in a textarea. Messages whose words end within a space of the edge wrap a word later than before.A user's sent message keeps the column of the reply box it was written in, so it now ends Send's room short of its edge too: by default
--lf-compose-send-end(Send's hit box and its insets), which the reply box's room is now stated from, as lf-diff and visual-review threads use. The panel's sent reply kept the field's width by a sum that held only under a mouse; it now counts the room, both of the row's seats and its padding, so a reply rewraps neither under a mouse nor a finger. A margin card's messages keep the anchored comment box's end, so a reply typed in the card still rewraps when sent, as it did before.Tests:
test_a_space_after_the_last_word_moves_no_wordtypes the reported comment a word at a time and presses Space after each, in Chromium and Firefox; on main it fails at "...strong view". It replaces the test of the scrolling mode, and the touch test of the glued spacer goes with it. The panel row test now holds every line short of Send, and the journey test of Shift+Enter under a full last line, whose room no longer takes a line of its own, now checks that typing on an opened line leaves the words above at rest where they were.Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]