Repository navigation
Snap the composer to its new height when a line is added or removed - #156
Merged
Merged
Conversation
A line added or removed in the session composer now changes the card's height at once, card and text in the same frame, as a standard Android text field does. Before, the field took its new height at once while the card's animateContentSize grew over ~0.3 s, so the top line was cut off by the card's edge for several frames (and the text dropped before the card on a shrink). The card's animateContentSize is replaced by composerCardHeight, a size animation of the same shape (same springs, bottom-anchored, clipped, off under Reduce Motion and during the keyboard morph, SEND_RESET_SLIDE during the send reset). It reads the input region's height from the same measure pass and leaves the input's own growth out of the animation, so attachments, autocomplete and the send reset still animate as before. Stock animateContentSize only sees the card's total height while measuring, so it can't tell a line change from any other size change. Removes the input region's animateContentSize(TopStart) from the earlier slide version. Verified on the emulator against origin/dev (263cb62), frame by frame from real-speed recordings: wraps, Return, caret on line 1, deleting from line 1 and the end, paste into empty and one-line drafts, max height and scrolling, attachments added and removed, send reset, keyboard close/open, Quote, @ chip, restored draft after relaunch, rotation, Reduce Motion, dark mode with font scale 1.3. scripts/check.sh (vm.sh check) passes.
Tarquinen
force-pushed
the
composer-line-growth-smooth
branch
from
November 18, 2026 20:05
c1074ee to
4b8dee7
Compare
This branch was previously deployed
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.
When a line is added to or removed from the session composer, the card now takes its new height at once, with card and text moving in the same frame, as a standard Android text field does. On
devthe field takes its new height at once but the card grows over about 0.3 s, so the card's top edge cuts off the top line for several frames. On a shrink, the text drops before the card does.The card's
animateContentSizeis replaced by a small size animation of the same shape (composerCardHeight) so that line changes can be left out of it. StockanimateContentSizeonly sees the card's total height while measuring, so it can't tell a line change from any other size change. The new modifier reads the input's height in the same measure pass and animates only the rest of the card's height.Different from
dev: line changes no longer animate. Everything else animates as before, with the same springs: adding and removing attachments, the autocomplete list opening and closing, and the send reset (SEND_RESET_SLIDE). Nothing animates under Reduce Motion or during the keyboard morph.before-after.mp4
Frame by frame, from real-speed emulator recordings (720×1600). Columns: card top edge / first line's ink, and the gap between them. A gap of 3 means the top line is cut off.
11.605: 795 / 798 (3)
11.696: 781 / 784 (3)
11.761: 763 / 781 (18)
11.817: 757 / 781 (24)
11.875: 755 / 781 (26), settled after ~0.27 s
8.297: 755 / 781 (26), first changed frame; the typed word is visible
8.339: 755 / 781 (26)
8.356: 755 / 781 (26)
35.608: 714 / 781 (67)
35.711: 729 / 781 (52)
35.764: 743 / 781 (38)
35.817: 750 / 781 (31)
36.014: 755 / 781 (26), settled after ~0.4 s
29.576: 755 / 781 (26), first changed frame
29.615: 755 / 781 (26)
29.660: 755 / 781 (26)
The gap also stayed constant, and the typed text was in place in the first changed frame, for Return, typing with the caret on line 1, deleting on line 1, pasting into an empty field, pasting into a one-line draft, and cutting all. Dark mode at font scale 1.3 gives the same result (gap 28–29 on every change;
devdrops to 4).Checked on the emulator against
dev: everything above, plus fast typing across several lines; max height (the card doesn't move and the text scrolls); scrolling the capped draft; adding an image and removing it (animates as ondev); sending a 3-line draft (the send reset matchesdevframe for frame); closing and opening the keyboard with a 3-line draft; Quote; inserting an@chip (the autocomplete list folds away as ondev); a restored 3-line draft after relaunch (full height in its first frame, no growth from zero); rotating to landscape and back; Reduce Motion (every change lands in one frame).scripts/check.shpasses.Not tested: dictation text arriving, Share into the composer, adding an attachment in the same frame as a line wrap (I couldn't time it with adb), and a real phone.