Resizable composer, remembered per device - #11
Conversation
devswha
left a comment
There was a problem hiding this comment.
Thanks for splitting this out. A few things before merge:
- Min height is above the automatic height. The automatic height is 42px on desktop and 48px on touch, below
COMPOSER_HEIGHT_MIN(56). Soaria-valuenowfalls outsidearia-valuemin, and ArrowDown or a downward drag in automatic mode makes the box grow to 56. Please set the minimum to the automatic minimum. - An accidental touch locks in a height. The touch grip reaches about 12px into the box and calls
preventDefaulton pointerdown. A tap near the top of the box doesn't focus the textarea, and 1px of finger movement switches to manual 56px, which is then saved for good. Please add a movement threshold before switching to manual mode, and keep the hit area off the textarea. On touch the only way back is double-tap, and iOS may not deliverdblclickthere. - The keyboard clamp uses
50dvh. On older iOS Safari,dvhdoesn't shrink with the keyboard (seelib/viewport.ts), so a saved 400px composer can fill the visible area.calc(var(--app-height) / 2)follows the visual viewport.
Minor: localStorage is written on every pointermove (write on pointerup instead), and aria-valuemax stays at 480 even when the viewport limit is lower. Please also rebase onto main: #5 and #14 are merged, and #14 touches Composer.css.
A grip on the box's top edge sets its height: drag it, use the arrow keys (Shift for larger steps), or double-click / Home to return to the automatic height. The height is kept per device in localStorage, limited to half the visible viewport and 480px; a raised keyboard or rotation clamps it through CSS and the saved height returns when there is room again. The text also sits centred in the slightly taller box. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 42c442e)
- The floor is the box's automatic height (the textarea's CSS min-height, 42px on desktop, 48px on touch), not a fixed 56px. aria-valuemin, -valuenow and -valuemax now agree, and valuemax follows the viewport limit. ArrowDown or a drag to the floor returns the automatic height instead of growing the box. - A press on the grip becomes a resize only after 3px (mouse) or 10px (touch) of movement, so a tap or a resting finger sets nothing. - The hit area rises from the border into the status line's gap and never reaches into the box. A tap at the box's top reaches the text, and the attachment strip's remove buttons stay reachable. - Two quick taps on the grip reset it, detected from pointer events: iOS may not send dblclick. - The keyboard clamp uses half of --app-height (the visual viewport), not 50dvh, which older iOS Safari does not shrink for the keyboard. - The height is saved when the pointer is released, not on every move. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The composer mounts before the socket connects, so the first auto-size measures the long "Reconnecting… message held here, never queued" placeholder. On a phone that wraps to two lines, and the box kept that height after connecting until the user typed (72px instead of 48px; 58px instead of 34px on main). Re-running the auto-size when the placeholder changes fits the empty box to the placeholder it actually shows. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cb09da2 to
0c05b5e
Compare
|
Thanks. Reworked in 21046e2 and rebased onto main:
Minor. The height is saved on pointerup (and on each key step), no longer on every move. Also in this PR (0c05b5e). I found a problem that already exists on main. The composer mounts before the socket connects, so on a phone it auto-sizes to the two-line "Reconnecting… message held here, never queued" placeholder and keeps that height after connecting (58px instead of 34px on main). The auto-size now reruns when the placeholder changes. Checked in Chromium, desktop and touch emulation:
|
0c05b5e to
71cad58
Compare
Split out of #5, with its review notes addressed.
A grip on the composer's top edge sets the box's height:
--app-height) or 480px.Details:
aria-valuemin,-valuenowand-valuemaxagree, andvaluemaxfollows the viewport limit.scroll-behavior. Without this, growing the composer hid the last message.Headless Chrome checks, desktop and touch emulation:
--app-heightclamping and restoring a saved heightbun testpasses.🤖 Generated with Claude Code