Repository navigation
Description
Summary
On mobile web (Chrome/Android), tapping "attach image" in the prompt composer, picking an image from the OS picker, and returning to bb gives no visible sign that anything was attached — the composer collapses back to its compact state and looks exactly as it did before. The image was in fact attached; you only discover this by tapping back into the composer to re-expand it. This looks like the attach action silently failed.
Versions and environment
- BB server version: 0.42.1 (commit
dba32a469fd820ff6106715db0aaf6ed297d79a5) - Client: bb web app in Chrome for Android (mobile viewport)
- Connection type: not captured (local vs remote server)
Steps to reproduce
- On a mobile-width viewport (or Chrome for Android), open a bb thread.
- Tap the composer to expand it.
- Tap "attach image" (the "+" menu's attach action) and pick an image in the OS file picker.
- Return to bb.
Expected vs actual
Expected: the composer stays expanded (or otherwise clearly shows) and displays a thumbnail of the newly attached image.
Actual: the composer collapses to its compact layout with no attachment indicator visible. The attachment is present in state but its thumbnail is not rendered until the composer is manually re-expanded by tapping into it again.
Evidence
Not independently reproduced by the agent (no touch/mobile device in this session); based on the reporter's description and two screenshots showing the collapsed composer immediately after attaching, and the same composer re-expanded afterward showing the attachment thumbnail present.
Code inspection (read-only, no changes made) at commit dba32a469fd820ff6106715db0aaf6ed297d79a5:
- Attach button opens a hidden
<input type="file">viaattachmentInputRef.current?.click():apps/app/src/components/promptbox/PromptBoxInternal.tsx#L3161-L3168, input defined atPromptBoxInternal.tsx#L2993-L2999. - The attachment thumbnail row (
AttachmentPreview) is only mounted when the composer is expanded:PromptBoxInternal.tsx#L3096gates it behind{!showCompactLayout ? ... : null}, so if the composer collapses, the thumbnail disappears regardless of whether an attachment exists. - Composer expand/collapse state lives in
FollowUpPromptBox.tsx:isInteractionExpanded(FollowUpPromptBox.tsx#L302) drivesisPromptBoxCompact(FollowUpPromptBox.tsx#L308). scheduleCollapseAfterFocusLoss(FollowUpPromptBox.tsx#L459, wired toonBlurCaptureat#L699) collapses the composer once focus leaves it, unless an element matching[aria-haspopup][aria-expanded="true"]is still open inside the composer, orpressedOverlayTriggerRefis true. That ref is cleared shortly after the initiating tap'spointerup/pointercancel— well before the OS file picker closes and returns focus.
Suggested fix
Likely root cause (not yet implemented or verified as a fix): the "+" menu closes as soon as "attach image" is tapped, so by the time the native file picker returns focus to the page, neither the open-overlay check nor pressedOverlayTriggerRef is still true, and scheduleCollapseAfterFocusLoss collapses the composer. Because AttachmentPreview only renders while expanded, the freshly attached image's thumbnail disappears along with the rest of the expanded chrome.
A fix would need to mark the in-flight file-picker interaction (e.g. keep a ref/flag set from when attachmentInputRef.current?.click() fires until the input's change event resolves) and have scheduleCollapseAfterFocusLoss skip or defer the collapse while that flag is set — similar to how keyboard dismissal is already special-cased via dismissedKeyboard.
What was ruled out
- Not a duplicate of iOS: submit button collapses composer before sending #3124 ("iOS: submit button collapses composer before sending") — that issue is about the composer collapsing on submit requiring a second tap, a different trigger path, though it shares the same underlying blur/collapse mechanism in
FollowUpPromptBox.tsx. - Not a duplicate of Canonicalize attached and referenced file preview and download behavior #2697 ("Canonicalize attached and referenced file preview and download behavior") — that issue concerns preview/download rendering, not the composer collapsing on attach.
- Searched open and closed issues for "attach image mobile" and "attachment thumbnail"; found no existing report of this specific collapse-on-attach symptom.
Suggested priority and effort
Not data-loss (the attachment is retained internally), but it's confusing enough that a user attaching an image on mobile will likely believe the action failed and may attach the same image again or give up. Likely a small, localized fix once the timing of the file-picker's change/focus-return relative to the blur handler is confirmed.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 6, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotui,mobile,confirmed-repro.confirmed-repro.Show attachment counts in the compact composer (#3180)