feat: paste an image into the chat input to attach it - #85
Merged
Merged
Conversation
The Composer slot only received onOpenFilePicker, which is an action rather than the ability to take files in, so no path that produces a File without the OS picker could be wired up from a slot. Add `onAddFiles` next to the existing flat props, so the change is additive and a type published in 1.18.0 keeps working. The built-in composer now attaches files pasted into it. The decision to claim the paste is made synchronously from the clipboard types, so text is never lost, and files are handed over unfiltered so a rejection surfaces its reason. Files arriving with an empty name (screenshots in some browsers) get one filled in from their MIME type; a name the browser did provide is left alone. `fileUploadEnabled` keeps meaning "file upload is configured" rather than folding in "no run in flight", which would make the attach button disappear for the length of every run instead of greying out. The composer slot already receives `loading`, so a composer that wants both facts can combine them. AILAB-370 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
masudahiroto
marked this pull request as ready for review
September 11, 2026 09:39
mm-zacharydavison
approved these changes
Sep 11, 2026
mm-zacharydavison
left a comment
Contributor
There was a problem hiding this comment.
LGTM! nice feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI Disclosure: This PR description is written by AI.
You can now paste an image from the clipboard into the chat input and have it attached. The intended use is attaching a screenshot you just took.
The Composer slot now receives onAddFiles, which runs files through the chat's own file handling (validation, preview, transformers). DefaultComposer uses it to support paste, and the example's custom composer does the same.
When the clipboard also carries text, the text insertion is left alone and the file is attached alongside it.
🤖 Generated with Claude Code