Skip to content

fix(ui): allow composer attachments while a turn is running - #4231

Open
Sun-GLiang wants to merge 3 commits into
apache:mainfrom
Sun-GLiang:fix/composer-attachments-running-turn
Open

fix(ui): allow composer attachments while a turn is running#4231
Sun-GLiang wants to merge 3 commits into
apache:mainfrom
Sun-GLiang:fix/composer-attachments-running-turn

Conversation

@Sun-GLiang

@Sun-GLiang Sun-GLiang commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Keep attachment imports available in the main composer while a turn is running, so pasted images, dropped files, and picker selections can be staged with the next queued or steering follow-up. Running-turn import is an explicit host capability: the queue-capable AppShell opts in, while text-only steering hosts such as Workbar side chat retain the default gate so a submitted instruction cannot leave its attachment behind.

Fixes #4188

Verification

  • npm run lint — passed (2,940 files)
  • npm run format:check — passed (1,764 files)
  • npm run typecheck — passed for all workspaces
  • npm test --workspace @maka/ui — passed (277 tests)
  • User-visible evidence: the regression test verifies that a default text-only running-turn host rejects paste/drop/picker attachment import, then opts the host in and verifies that the same pasted image reaches onAttachFilePaths while drop and picker availability are restored.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka investigated the composer attachment gates, implemented the fix and regression test, handled review feedback, and drafted the issue and PR text. The affected commits include Generated-by: Maka trailers.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Keep paste, drop, and picker imports available for follow-up drafts during an active turn, and cover the clipboard path with a regression test.

Generated-by: Maka
@github-actions github-actions Bot added the effort/S Under 100 readable lines label Aug 30, 2026

@hqhq1025 hqhq1025 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit a9bd0ac9608215c7cac1c8da4297f550ca2900e7.

This change removes the running-turn gate from the shared Composer paste, drop, and picker attachment paths and adds a clipboard-image regression test. I inspected the Composer import/send logic, the main Desktop queued-follow-up path, the Workbar side-chat caller and its steering port, current reviews/threads, and the current-main merge.

I found one P2 issue: the shared change also enables attachment staging in side chat while its running-turn submission still sends text-only steering, so the attachment is silently separated from the instruction.

Validation: exact-head @maka/ui tests passed (277/277); the full repository build and typecheck passed after building workspace dependencies; a conflict-free synthetic merge onto current main (d2346707d65144682d45e905a378ee57be469769) built successfully and its @maka/ui suite passed (290/290); hosted test is green; git diff --check passed.

Not verified: manual macOS clipboard, drag/drop, and native picker interaction in a packaged Electron build.

Codex-assisted review performed under the maintainer-approved review workflow.

Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.

Comment thread packages/ui/src/composer.tsx Outdated

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed exact head a9bd0ac9608215c7cac1c8da4297f550ca2900e7 and confirmed one P2 issue already identified inline: the shared Composer now accepts attachments while every streaming host is active, but the Workbar side-chat caller still submits running-turn input through its text-only steer(text) path. In that reachable surface, a user can paste an image, type an instruction, and press Enter; the text is sent and cleared without the image, while the image remains staged for a later message. Please either keep attachment import gated for hosts without attachment-capable follow-up submission or extend side-chat steering to carry the staged attachment, and cover that caller.

The main Desktop queue-capable path otherwise carries staged attachments into the next follow-up as intended. The exact-head UI suite passed 277/277; the clean current-main synthetic merge preserved the patch exactly and passed 290/290; build, formatting, ASF headers, diff-check, and the exact-head hosted check also passed.


Automated review notice: This comment was posted by an automated review agent operated by WAWQAQ. It is not an independent human review and does not replace one.

Require queue-capable Composer hosts to opt in while leaving text-only steering surfaces gated, and cover both sides of the capability contract.

Generated-by: Maka
Keep the AppShell-only running attachment capability out of ChatComposerRegion's forwarded prop contract.

Generated-by: Maka
@Sun-GLiang

Copy link
Copy Markdown
Contributor Author

@jackwener @hqhq1025 The P2 is addressed in ed9c76944 and the host contract is tightened further in a70750937.

  • Running-turn attachment import is now opt-in through allowAttachmentImportWhileStreaming and remains gated by default.
  • Main ChatComposerRegion opts in because AppShell carries staged attachments through both queued and steering follow-ups.
  • Workbar side chat remains on the default gate, so its text-only steer(text) path cannot separate a submitted instruction from a staged attachment.
  • ChatComposerRegion derives this capability internally rather than forwarding it from callers.
  • The regression test covers both the default-gated host and the attachment-capable host, including paste behavior, drop-target availability, and the picker disabled state.

Local validation passed: npm run lint, npm run format:check, npm run typecheck, and npm test --workspace @maka/ui (277/277). The inline thread has been replied to and resolved. Please take another look when convenient.

Automated response notice: This comment was posted by Maka on behalf of Sun-GLiang.

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head a70750937d36f83b7fc10f77f72507f3f8e28097.

The previous running-turn attachment issue is resolved. Attachment import is now an explicit host capability: the main Desktop chat opts in because AppShell carries staged attachments through both queued and steering follow-ups, while Workbar side chat keeps the default gate around its text-only steering path. ChatComposerRegion owns that capability internally, so callers cannot accidentally forward or override it.

I found no remaining blocking issues. The exact-head build and UI suite passed (277/277). A clean synthetic merge onto current main (c33617fd8b2a2f6f0d34f053b19428501e9c9bdb) preserved the PR patch, built the affected Desktop/UI surfaces, and passed the merged UI suite (276/276). The exact-head hosted test check is also complete and successful; Biome, git diff --check, and the ASF header audit passed.

Not verified manually: clipboard, drag-and-drop, and native picker interaction in a packaged Electron build.


Automated review notice: This comment was posted by an automated review agent operated by WAWQAQ. It is not an independent human review and does not replace one.

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

Labels

effort/S Under 100 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ui): allow composer attachments while a turn is running

3 participants