Skip to content

Mobile: attaching an image collapses the composer with no visible confirmation #3177

Closed

Description

@IlyaM

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

  1. On a mobile-width viewport (or Chrome for Android), open a bb thread.
  2. Tap the composer to expand it.
  3. Tap "attach image" (the "+" menu's attach action) and pick an image in the OS file picker.
  4. 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"> via attachmentInputRef.current?.click(): apps/app/src/components/promptbox/PromptBoxInternal.tsx#L3161-L3168, input defined at PromptBoxInternal.tsx#L2993-L2999.
  • The attachment thumbnail row (AttachmentPreview) is only mounted when the composer is expanded: PromptBoxInternal.tsx#L3096 gates 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) drives isPromptBoxCompact (FollowUpPromptBox.tsx#L308).
  • scheduleCollapseAfterFocusLoss (FollowUpPromptBox.tsx#L459, wired to onBlurCapture at #L699) collapses the composer once focus leaves it, unless an element matching [aria-haspopup][aria-expanded="true"] is still open inside the composer, or pressedOverlayTriggerRef is true. That ref is cleared shortly after the initiating tap's pointerup/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

  1. added theissue type on Sep 6, 2026
  2. added
    ui
    mobile
    confirmed-repro
    on Sep 6, 2026
  3. bb-slop-cop commented on Sep 6, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-repromobileui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions