Repository navigation
Fold the phone chat composer into one pill - #472
Conversation
|
Review: Changes needed Reviewed head The design works well and is close to prototype Checked with the keyboard open (323px exposed):
Must fix
Should fix
Nice to have
M-36 investigationThe conclusion is sound. With the Planner off, The |
On a coarse-pointer phone the composer rested at about 125px plus a status tab, leaving roughly 80px of transcript above the keyboard. It now rests as one 44px pill: reference button, auto-growing draft and a 36px send circle, with the mode switch icon-only and connection state as a slim row inside it. "Chopin unavailable" is a quiet line above the pill. Mention, reference and command pickers become a full-width list resting on the composer with 44px rows. Chat prose uses the document's body size on phones and code wraps. Desktop layout is unchanged. Why: apps/web/src/chat/composer.css | the phone connection status stays mounted out of flow so its live region still hears its first word Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Space the send circle so the mode switch keeps its own 44px target, draw disabled send without an outline on an inset tone, hug the pill with its focus edge, and apply the phone composer to coarse landscape phones too. Add an e2e check that a transcript at the bottom stays pinned when a message arrives with the keyboard open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The focus test reserves outline geometry for theme.css, so the pill keeps the shared ring. The disabled send hides its edge by colour instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a1fb6fd to
d3b71ff
Compare
Why
On a phone, Chat's composer was about 125px tall plus a "Chopin unavailable" tab above it. With the keyboard open, that left roughly 80px of transcript (M-35). The
@and#pickers were narrow desktop dropdowns (M-36).What changed
Phone only:
@media (pointer: coarse) and (max-width: 600px), (pointer: coarse) and (max-height: 500px), so landscape phones are included. It lives in one block at the end ofcomposer.cssandmarkdown.cssand can switch to:root[data-phone]once #475 lands.+(Mention docs), a 16px draft that grows up to 5 lines, the mode switch (icon only, keeps itsTalk to Chopinname), Stop/Resume when active, and a 36px filled send circle, with 0.5rem before send so the mode switch keeps its own 44px target. Buttons keep 44px hit areas. The pill is 44px at rest and 54px with padding. Bottom padding usesenv(safe-area-inset-bottom)but drops it while--keyboard-insetcovers the home indicator. The mode switch is hidden only when the Planner is off on the server, because then it can never be used. The disabled send is solid--color-insetwith no outline ring, instead of faded teal.viewport.tsalready sizes#rootto the visual viewport, so the composer sits on the keyboard and the transcript stays pinned through its existing ResizeObserver. The draft is now capped at 30% of the exposed height so a long draft can't push the transcript out of view.maxHeightmoved to CSS. Desktop values are unchanged.--text-base, the same size as the document's prose. Code blocks wrap instead of scrolling sideways. Links already wrapped. There are no hover-only message actions to fix.--composer-pill-control,--composer-pill-icon,--radius-composer-pill.M-36 ("@Cho" + Enter sent "Cho") is display behaviour, not a lost mention. The wire frame was
{"text":"@cho","to":"room"}anddata-chat-rawis@cho.referenceRenderModeldeliberately draws@loginas a capitalised name (hi @octocatshows as "hi Octocat"). With the Planner off there is no candidate for@cho, so no picker opens and Enter sends. I left this unchanged. Whether unknown handles should keep their@is a product call.M-37 context chip: skipped. On a phone the header already names the document directly above Chat. A chip would mean passing the title into
Chatand would repeat the header.Screenshots (iPhone 15 Pro; BEFORE = main on the reference server, AFTER = this branch)
The keyboard is emulated as a 313px visual viewport.
Chat at rest

Keyboard open with a draft

Mention picker

Reference picker

Desktop 1440×900 composer, before (top) and after (bottom): identical. The bounding boxes of the composer, draft, footer, mode switch, send and pickers match exactly.

Testing
bun run ci: passes (tokens, design contract, design record, impeccable).bun run types: passes.bun testinapps/web: 631 pass.e2e/chat-phone.e2e.ts:e2e/visual-viewport.tsat 508px: the composer stays in view on the keyboard and the transcript keeps ≥ 200px (measured 250px at 390×844, 150px at 375×667).e2e/chat-composer.e2e.ts: the touch case now expects a one-line rest instead of two.Needs a real device
env(safe-area-inset-bottom) - var(--keyboard-inset)behaves as intended.lhsupport (Safari 16.4+).🤖 Generated with Claude Code