Skip to content

Show attachment counts in the compact composer - #3180

Merged
ymichael merged 3 commits into
mainfrom
slopcop/issue-3177
Sep 10, 2026
Merged

ymichael merged 3 commits into
mainfrom
slopcop/issue-3177

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

After selecting files on mobile, focus loss collapses the follow-up composer. Compact layout previously omitted all attachment UI, so successful uploads appeared to have failed until the editor was focused again (#3177).

What changed

Compact composers now show a paperclip and the total attachment count beside the draft text in the existing single row. The indicator has an accessible singular/plural label and no removal button. Focusing the composer exposes the existing image previews and file removal controls. Removing a focused attachment explicitly blurs its button before unmount so the composer can settle back to compact layout.

This replaces the original PR's forced-expansion approach: attachments remain visible as a count without keeping the editor expanded. No SDK, CLI, stored-data, or wire contract changes; no host-daemon protocol bump is required.

How you verified

  • Reproduced the original missing-preview behavior on pristine main using sawyerhood/dev-browser at a 390×844 touch viewport and a real Chromium file chooser.
  • Regression coverage checks mixed image/file counts, singular count, no compact removal controls, expanded removal controls, and an empty attachment list.
  • Ran the focused and adjacent promptbox suite through Turbo: 388 passed, 3 skipped.
  • Turbo app typecheck, build, and lint passed; lint has existing warnings and no errors. Formatting and git diff --check passed.
  • Live count-only QA on the optimized app launched through pnpm start:worktree: 50px compact row with draft text, accessible “2 attachments” indicator, zero compact removal controls, expansion for removal, count update to one, and clearing the count after final removal.
  • Earlier iterations exercised actual iOS Simulator Safari picker return and removal. The final count-only design was verified in Chromium touch emulation, not rerun in Safari or TestFlight.

Fixes #3177

AGENT GENERATED

@dillonzq

dillonzq commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

I independently verified this fix on the latest main (682f0d2c5dc5bbe920d4a253f66a6c5cedcb955b) and would appreciate merging it soon.

  • Before the fix, the regression test consistently failed when an attachment arrived after the mobile composer lost focus: the composer remained compact instead of expanding.
  • After applying this PR, the regression passes; removing the final attachment also restores the normal compact state.
  • The attachment removal component tests pass, confirming that the removal callback and local preview cleanup still work.
  • The complete @bb/app suite passes: 496 test files, 4,095 tests passed, 4 skipped.
  • Typecheck, formatting, and git diff --check pass; lint reports 0 errors.

This addresses both symptoms: the composer collapsing after an image upload and the attachment controls being unmounted before the image can be removed.

@ymichael ymichael changed the title Keep mobile attachment previews visible after file selection Show attachment counts in the compact composer Sep 10, 2026
@ymichael
ymichael merged commit 959d771 into main Sep 10, 2026
16 checks passed
@ymichael
ymichael deleted the slopcop/issue-3177 branch September 10, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants