Repository navigation
Retain the comment text viewport separately from attachments - #2136
Merged
Merged
Conversation
Only submitted words inherit the editor viewport and scroll position. Keep drawing references and pasted images in their own message regions, and derive the reserved card frame from the text field so disappearing attachment shelves cannot carry sent words. Let the retained text track shrink with its card after resize. Cover short and scrolled drawings on desktop and touch, pasted-photo visibility and image viewing, and the existing Send journeys. Update the compact handoff focus assertion to the page-thread focus contract.
leaf-agent
reviewed
Oct 9, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new phone/scrolled drawing case fails at browser teardown after the resize in test_render_drawing.py: clean_browser reports Measure loop restarted more than 5 times. Its assertions pass, but I reproduced the teardown error twice on this head and once with this test copied onto the base tree. This exposes an existing measure-loop problem rather than a rendering regression from this diff; as added, the case cannot pass the browser test gate. The resize journey needs to complete without that warning before this test can protect the change.
Compare current wrapped columns against the height oracle, including accumulated sub-character resizes and the existing minimum. CodeMirror previously overwrote its width before testing for a change; a 60-line phone comment with DejaVu fonts then exhausted the measure loop. Adapt the pinned module at the bundling owner and keep one shared module identity. Read the retained text viewport in the keyboard journey, including pending delivery, scrolling and a second comment. Verified the original font reproduction, gradual growth/shrink, tiny and unchanged widths, bundle reproducibility, appearance snapshots and independent browser/code reviews.
leaf-agent
previously approved these changes
Oct 9, 2026
Keep the native input explicit in the placement interface so Send captures its text viewport while main retains window-bounded composer growth. Wait for the card reveal before testing the pasted photo hit target, then click its center without automatic scrolling.
leaf-agent
approved these changes
Oct 9, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 15, 2026
The sent-drawing browser case now reads its retained scroll from the thread transcript. #2985 intentionally moved a long sent comment's scrollport from the first message to that transcript, but this case still required an inner `.lf-msg-text` scrollbar and failed on the new layout. The test continues to check the drawing-reference behavior introduced by #2136: the reference follows the comment text, the message body does not clip it, and it remains inside the visible transcript after a long card is resized. Its short phone and long desktop variants both pass with the transcript as the scrollport. Verification: both focused browser variants pass; Ruff format and `git diff --check` pass. The long variant failed at the old inner-scroll assertion before this change. Co-authored-by: leaf-agent <[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.
Sending a short drawing comment retained the editor's 32px viewport on the entire message body. Adding the drawing reference then created an unnecessary scrollbar, and removing the attachment shelf moved the submitted words. Long comments also lost room for their drawing reference when the card was resized.
Retain the viewport and scroll position on the submitted text alone. Project pasted attachments through the existing media reading into a sibling message region, and derive the reserved card frame from the text field and shared padding. Text can shrink with the transcript while drawing metadata keeps its room and images remain available in the normal transcript flow.
The long-comment journey also exposed a CodeMirror wrapping bug: its width-change comparison used a value it had just overwritten, leaving height estimates based on the old width and exhausting the measurement loop. The existing vendoring adapter now compares the current column count with the oracle's last measured estimate, including accumulated small width changes and its five-column minimum.
Validation includes the original failure with CI's DejaVu fonts, gradual width growth and shrink, tiny and unchanged widths, short and scrolled drawings on desktop and touch, pasted-photo viewing, keyboard reading, all eight Mac appearance journeys and the snapshot helpers, 276 runtime tests, and independent code/browser review. Bundle rebuilding is byte-identical. Reading-key checks follow the text viewport. The integration preserves main's window-bounded composer growth and passes all five drawing cases after that change.