Skip to content

fix(web): a photo picked on a phone attaches even when the composer collapses - #41021

Merged
juliusmarminge merged 1 commit into
mainfrom
factory/issue-40993
Nov 22, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
factory/issue-40993

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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, in ComposerAttachmentStrip.tsx) owns the hidden file input and its change handler; ChatComposer renders it directly in the form, outside the collapsible surface.
  • ComposerAttachButton is now only the paperclip button and opens the picker through a ref.
  • The test fake server now advertises file attachment support, as real servers do, so the composer shows the attach button in browser tests.

Fixes #40993

Reproduction on main

Commit bc13afa (origin/main). Ran T3CODE_DEV_SEED=0 vp run dev in 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 first and 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.

Before After
4e1c1fea7a 8b9d78e037
Before: photo silently dropped from empty composer After: photo retained in empty composer
Empty-prompt picker recording Empty-prompt picker recording
One-line selection and text-only send Image-bearing message and subsequent photo selection

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:

  • Successful model processing of an image prompt: Replay does not negotiate image prompt support. The head uploaded the image and saved/rendered the image-bearing message, then provider execution failed.
  • The reporter's exact 'is not connected' and IndexedDB transaction errors were not reproduced; the demonstrated base failure is the silently dropped photo caused by composer collapse.

Tests

  • vp test run src/components/ChatView.browser.test.tsx with the component changes stashed (main): new test fails (image never attaches), 18 others pass
  • vp test run on ChatView, ChatView.modelPick, ChatView.handoffCompaction, Sidebar.drag, Sidebar.shortcuts and DraftHeroHeadline browser tests with the fix: 6 files, 26 tests passed
  • vp run check:changed: format, lint, knip, typecheck (2 packages), tests (1 file), react compiler all pass
  • CI on 8b9d78e: all 7 required checks passed

Not in this change

  • The reporter's 'is not connected' and IndexedDB transaction errors were not reproduced here and may have another cause.
  • Other hidden inputs or popovers inside the collapsible mobile footer could be unmounted by the same blur-driven collapse; I did not audit them.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

…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]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 22, 2026
@coderabbitai

ghost commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The composer now renders its hidden file input separately from the attachment button. A browser test checks file selection after the mobile composer collapses.

Changes: Composer attachment picker

Layer / File(s) Summary
Separate the picker input from the button
apps/web/src/components/chat/ComposerAttachmentStrip.tsx, apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/components/ChatView.browser.test.tsx, apps/web/test/fakeEnvironment.ts
ComposerAttachInput handles selected files and clears the input value. ComposerAttachButton opens the input through a ref owned by ChatComposer. The browser test checks attachment selection after the composer collapses. The fake environment enables file attachments with a 10,000,000-byte limit.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • pingdotgg/t3code#23083: Moves the hidden file input outside the collapsible footer and lets the paperclip button open it through a ref.

Suggested labels: bugfix

Suggested reviewers: macroscopeapp, maria-rcks, yash-singh1

Merge Risk: Minimal · up to 8b9d7

The change keeps the file picker input mounted when the mobile composer collapses, so a photo picked on iOS Safari is no longer dropped. A regression test covers this case. No merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive [#40993] The issue requires that a second photo picked in the same thread, after a send, appears as a composer chip and can be sent. The PR moves the hidden file input (ComposerAttachInput) out of t… Provide evidence that the issue's scenario now attaches: either a browser test that sends a first image, then picks a second image in the same thread and checks that the chip appears and the message can be sent, or a manual iOS Safari resul…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the specific bug fixed: a photo picked on a phone is dropped when the composer collapses. The raw summary and objectives confirm the change moves the hidden file input out of the colla…
Out of Scope Changes check Passed All changed areas serve the attach path. ChatComposer.tsx renders ComposerAttachInput outside the collapsible footer and wires the attach button to it. ComposerAttachmentStrip.tsx moves the hidd…
Description check Passed The description follows the template closely. It has a clear Problem statement (a photo picked from the iOS photo picker was silently dropped when the composer collapsed on blur), a Change section tha…
Full details: Title check

Explanation

The title names the specific bug fixed: a photo picked on a phone is dropped when the composer collapses. The raw summary and objectives confirm the change moves the hidden file input out of the collapsible footer so picked files attach. The title is conventional, plain, and within the repo's example style. It omits the test-server change, which is expected.

Full details: Out of Scope Changes check

Explanation

All changed areas serve the attach path. ChatComposer.tsx renders ComposerAttachInput outside the collapsible footer and wires the attach button to it. ComposerAttachmentStrip.tsx moves the hidden input and change handler into ComposerAttachInput and makes ComposerAttachButton open the picker through a callback. fakeEnvironment.ts advertises file attachment support, which the new browser test needs to show the attach button. ChatView.browser.test.tsx adds the regression test for the attach path. No unrelated behavior change appears in the summary. The PR notes that other hidden inputs in the mobile footer were not audited. That is a stated limit, not an out-of-scope change.

Full details: Description check

Explanation

The description follows the template closely. It has a clear Problem statement (a photo picked from the iOS photo picker was silently dropped when the composer collapsed on blur), a Change section that explains why the file input moved outside the collapsible footer, and a Scope section that links the issue (#40993, fixes #40993). Verification is detailed: reproduction steps on main, before/after screenshots and recordings, specific test commands with results, and CI status. It also states what was not reproduced or verified (the 'is not connected' and IndexedDB errors, and model processing of image prompts). The author's agent attribution is present at the end, matching the template's request. Minor gaps: the Scope section does not explicitly say whether the fix is a bug fix, though the description frames it as one, and the 'Not in this change' section leaves a related audit undone. The objectives note a mismatch between the issue's second-photo-after-send scenario and the PR's reproduction (empty or one-line prompt), which the description does not reconcile, so the linked-issue scope is only partly addressed. Those gaps are non-critical, so the check passes.

Full details: Linked Issues check

Explanation

[#40993] The issue requires that a second photo picked in the same thread, after a send, appears as a composer chip and can be sent. The PR moves the hidden file input (ComposerAttachInput) out of the collapsible mobile footer, so a picker result is no longer routed to a detached input. This is a concrete code change on a plausible cause of the silent drop. The PR does not establish that it fixes the issue's scenario. The author reproduced the drop only on a first pick with an empty prompt and a first pick with a one-line prompt, not on a second pick after a send. The new browser test covers a pick after the composer collapses, but the summary does not show that it covers a send followed by a second pick. The issue also reports 'is not connected' errors and an IndexedDB transaction error. The PR states these were not reproduced and may have another cause. Nothing in the diff addresses them. Whether the connection state alone blocks attachment after a send is not established.

Resolution

Provide evidence that the issue's scenario now attaches: either a browser test that sends a first image, then picks a second image in the same thread and checks that the chip appears and the message can be sent, or a manual iOS Safari result for that sequence. Also state whether the client remains in the 'not connected' state after the first send and whether that state blocks the attach action. If it does, the fix must address that state as well.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3806763 and 8b9d78e.

Files selected for processing: 4

  • apps/web/src/components/ChatView.browser.test.tsx
  • apps/web/src/components/chat/ChatComposer.tsx
  • apps/web/src/components/chat/ComposerAttachmentStrip.tsx
  • apps/web/test/fakeEnvironment.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: iOS Safari web UI: second image in a thread is silently dropped after first send ("is not connected" + IndexedDB transaction error)

1 participant