Skip to content

Let the composer card animate line growth instead of the field's own spring - #151

Merged
Tarquinen merged 1 commit into
devfrom
composer-text-input-native
Nov 18, 2026
Merged

Tarquinen merged 1 commit into
devfrom
composer-text-input-native

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The composer field no longer runs its own spring to grow a line at a time. It takes its new height at once, and the session composer card's existing animateContentSize(alignment = BottomStart) animates the growth. That removes ComposerLineGrowth, the caret-line hold and the two ported tests that covered only them (noted in the docs/parity/composer.md row).

The other two hand-built pieces stay:

  • Line cap and inner scroll. The top inset scrolls away with the text, and the caret follow also works unfocused, for programmatic text. maxHeightInLines would leave a fixed band and only follow a focused caret.
  • Last-line double tap. BasicTextField already handles double taps inside the field. The custom code catches a second tap that lands just below the field (row gap, model chip), which would otherwise hit the chip.

Visible difference from dev (tested): when the caret is on an earlier line and a typed word makes the field grow, the top of line 1 is cut off at the card's edge until the card catches up. Over two runs it lasted 0.08 s and 0.13–0.2 s. At real speed it looks like a brief flicker of the top line. On dev, the caret-line hold kept line 1 whole; it touches the card's edge but isn't cut. The video shows this at real speed and slowed 4× (both sides slowed the same).

No other differences found:

  • Caret on line 1 and deleting until the field shrinks: the same on both builds, with no clipping.
  • Pasting a multi-line text (about 9 lines) into an empty field and into a one-line draft: the card grows the same way on both, with the text held to the bottom. It takes about 0.5 s on the branch and 0.65 s on dev.
  • Reduce Motion (animator scale 0), with the caret on line 1 and at the end: both builds jump to the new height in one frame, with no clipping.
  • Growth while typing at the end: one line takes about 0.26–0.35 s on both builds.
before-after.mp4

Left: dev 3da8e20. Right: this branch. Real speed except the one segment marked as slowed.

Verified: vm.sh check passes. On the emulator I tested typing a long draft, reaching the max height and scrolling it, and deleting back down. I also tested the caret-on-line-1 growth and shrink, paste (Ctrl+V), Reduce Motion, double-tap word selection on the last line, and font scale 1.3.

Not tested: a physical hardware keyboard (keys were sent as adb key events, including Ctrl+V and Shift+Enter), long-press selection.

…spring

The composer field ran its own spring (ComposerLineGrowth) to grow a line at
a time while holding the caret's line in place. The session composer card
already animates its size with animateContentSize(alignment = BottomStart),
which gives the same bottom-held growth, so the field now takes its new
height at once and the card animates it. Removes the spring, the hold and
the two ported tests that covered only them.

The line cap and the last-line double tap stay: the cap's top inset scrolls
away with the text and the caret follow works unfocused, and the double tap
handles a second tap that lands just below the field.

Verified: vm.sh check passes; on the emulator, dev 3da8e20 vs this branch:
typing a long draft (one line's growth settles in about 0.26-0.35 s on both),
reaching the max height and scrolling, deleting back down, double-tap word
selection on the last line, font scale 1.3.
@Tarquinen
Tarquinen merged commit e18e813 into dev Nov 18, 2026
3 checks passed
This was referenced Nov 18, 2026

This branch was previously deployed

1 inactive deployment
release — 39bc3c8b Deployed Nov 18, 2026 by Tarquinen via check #490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant