feat(web): splash composer image attachment (drag, paste, +) - #7
Merged
Conversation
Bring the splash composer to feature parity with the in-thread chat composer's image handling: - Paperclip + button next to the submit button opens a hidden file input (image/* multi-select). - Paste handler on the textarea picks up clipboard images and adds them. - Drag-and-drop anywhere on the form card adds files; the card border tints blue while dragging. - Thumbnail strip above the textarea, each thumbnail with a remove X. - Validation: image MIME types only, per-file PROVIDER_SEND_TURN_MAX_IMAGE_BYTES, total PROVIDER_SEND_TURN_MAX_ATTACHMENTS. Errors render in the existing error message slot. - Object URLs revoked on remove + on unmount so we don't leak. - Submit button enables when prompt OR images are present (was: prompt only). + button disables at the attachment limit. - On submit: attached images flow into the new draft via draftStore.addImages(draftId, ...) before the auto-submit signal — ChatView's onSend then picks them up via composerImagesRef like any other draft attachment. The reusable-hook extract from ChatComposer was deferred — the splash state lives locally (until the draft exists) while the chat composer state is store-backed, so a single shared hook would have to bridge both. Splash-side is self-contained for now. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
The splash composer (NoActiveThreadState) now accepts image attachments via the same patterns as the in-thread chat composer:
Submit flow
After setPrompt and before the auto-submit signal, attached images are pushed into the new draft via `draftStore.addImages(draftId, ...)`. ChatView's onSend then picks them up via `composerImagesRef` like any other draft attachment.
Notes
The reusable-hook extract from ChatComposer was deferred — splash state lives locally (until the draft exists) while ChatComposer state is store-backed, so bridging both behind one hook is more complex than the splash-side duplication is worth right now.
Test plan