Repository navigation
feat(channels): drag-and-drop file upload into the composer - #215
Merged
Merged
Conversation
Agent Chat already supports drag-drop (the editor's file-upload extension + a full-area useFileDropZone overlay, with onUploadFile wired). The channel composer used the same ContentEditor but never wired an upload handler into it, so it only had the paperclip button — dropping an image did nothing. Wire the existing useFileDropZone onto the composer root and route dropped files through handleAttach (the exact upload path the paperclip uses), with a FileDropOverlay drag cue. Drop is disabled when the composer is. This also gives the Ship Concierge drawer (a channel) drag-drop for free. views typecheck + eslint clean; new channel-composer drag-drop test (2 cases) green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Builds on the composer drop zone: in the tall narrow Concierge drawer you naturally drop onto the transcript, not the small input box. ChannelComposer now exposes an imperative attachFiles() handle, and ShipShell wraps the whole drawer body (conversation + composer) in a drop zone that forwards dropped files into it. The composer keeps its own inner zone; the shared hook's defaultPrevented guard means a drop on the input doesn't double-fire. Test: imperative attachFiles → api.uploadFile. views typecheck + eslint clean; 207 ship + channels tests pass. Co-Authored-By: Claude Opus 4.8 (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.
Answer to "can we add drag-and-drop of images into the chat?": Agent Chat already had it; Channels (and the Concierge drawer) didn't — this adds it.
Composer-level (all channels): the channel composer used the same
ContentEditoras Agent Chat but never wired an upload handler into it, so its editor-level file-drop was a no-op — only the paperclip worked. This wires the existinguseFileDropZoneonto the composer root and routes dropped files throughhandleAttach(the sameapi.uploadFilepath the paperclip uses), with aFileDropOverlaycue. Drop is disabled when the composer is.Whole-drawer (Ship Concierge): in a tall narrow drawer you naturally drop onto the transcript, not the small input box.
ChannelComposernow exposes an imperativeattachFiles()handle, andShipShellwraps the entire drawer body (conversation + composer) in a drop zone that forwards files into it. The composer keeps its own inner zone — the shared hook'sdefaultPreventedguard stops a drop on the input from double-firing.Test plan
channel-composer.test.tsx(drop →api.uploadFile, multi-file, and the imperativeattachFileshandle) + 207 ship/channels tests green.🤖 Generated with Claude Code