Repository navigation
fix(web): a photo picked on a phone attaches even when the composer collapses - #41021
Conversation
…ollapses Opening the photo picker blurs the editor, so the phone composer collapses and unmounts its footer, taking the attach button's hidden file input with it. The picker's change event then fired on a detached input and the photo was dropped. The file input now lives outside the footer, so it stays mounted while the picker is open. Fixes #40993 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
On a phone-width screen, a photo picked from the iOS photo picker was silently dropped unless the prompt happened to wrap to two lines. Opening the picker blurs the editor, the composer collapses, and the attach button's hidden file input was unmounted with the footer, so the picker's result went to a detached input. The file input now lives outside the collapsible footer, so picked files always attach.
ComposerAttachInput(new, inComposerAttachmentStrip.tsx) owns the hidden file input and its change handler;ChatComposerrenders it directly in the form, outside the collapsible surface.ComposerAttachButtonis now only the paperclip button and opens the picker through a ref.Fixes #40993
Reproduction on main
Commit bc13afa (origin/main). Ran
T3CODE_DEV_SEED=0 vp run devin a fresh worktree, put the web port behind HTTPS on the tailnet name, and opened it in Safari on a pool iOS simulator (iPhone 18 Pro, iOS 27.2). Paired, selected the Replay (dev) provider in a new thread. (1) Empty prompt: tapped the composer, tapped the paperclip, chose Photo Library, picked a photo, tapped the checkmark. The picker closed, no chip or preview appeared, Send stayed disabled, and no error showed. (2) Prompt 'first' (one line): same pick, again no chip. Sending posted 'first' as a text-only message, with no image. (3) Control: typed a prompt long enough to wrap to two lines, which keeps the mobile composer expanded, then made the same pick. The image tile and an 'IMG_0005.jpeg' chip appeared at once. So any pick made while the composer can collapse on blur is silently dropped. I did not recreate the reporter's case where the first image works, and did not see the 'is not connected' or IndexedDB errors.Evidence
Safari on a pooled iPhone 18 Pro, iOS 27.2, 402×874, light theme; separate fresh databases with the same seeded Replay history. Select the same stock photo through Attach files → Photo Library → Done with an empty prompt, then repeat with
firstand send. The base drops both selections and sends text only; the fix retains the photo and saves the image-bearing message. The wrapped-prompt control attaches on both commits. An additional empty-prompt selection after sending also attaches on the fix. Browser chrome is cropped from captures.Reproduction driver and setup notes.
Replay rejects image prompt execution, so the after-send recording shows a provider error after the image-bearing message is saved. Model processing is not verified.
Not shown:
Tests
vp test run src/components/ChatView.browser.test.tsxwith the component changes stashed (main): new test fails (image never attaches), 18 others passvp test runon ChatView, ChatView.modelPick, ChatView.handoffCompaction, Sidebar.drag, Sidebar.shortcuts and DraftHeroHeadline browser tests with the fix: 6 files, 26 tests passedvp run check:changed: format, lint, knip, typecheck (2 packages), tests (1 file), react compiler all passNot in this change
Who did the work
Run by the t3code factory in T3 Code.