feat(attachments): support image paste, drop, and picker in the composer - #259
Closed
kunchenguid wants to merge 9 commits into
Closed
feat(attachments): support image paste, drop, and picker in the composer#259kunchenguid wants to merge 9 commits into
kunchenguid wants to merge 9 commits into
Conversation
…p guards A deep review pass over the composer attachment feature surfaced a set of confirmed defects; this commit fixes the correctness tier: - The composer chip gate no longer blocks the entire send pipeline. A pending or failed chip now holds back only the composer's own message and an explicit end, while queued annotation prompts still deliver - previously Send and Send & End silently delivered nothing with the only signal in an 11px notice. - The per-batch cap count no longer charges size-refused chips (which retain no file and cannot upload), so an oversized companion in a mixed paste can no longer silently swallow a valid image while syncNotice clears the cap notice on the same render tick. - Paste no longer raises unsupported-type chips: Office and macOS pastes expose stray non-image file flavors beside their text, and a permanent red chip for a perceived text paste blocked sending until manually removed. The picker and drop still refuse visibly, and a Files drag with nothing enumerable now gets an explicit refused chip instead of being swallowed after preventDefault. - A document-level Files-drag guard stops a drop that misses the composer from navigating the chrome away (losing chips, uploads, and the SSE connection). Text drags are left to the browser so dropping text into the textarea works. - planClipboardPaste (and its chrome mirror keepsClipboardText) now treats a pasted file's own name or path in text/plain as placeholder rather than a caption, restoring the pre-branch behavior for Finder/Explorer file copies. - The chip list gets the card's W3 max-height/scroll backstop so unbounded chips cannot push Send or their own Remove buttons off-frame. - CHAT_ATTACHMENT_MIME falls back to PNG/JPEG/WebP when the session JSON list is unwired, matching acceptedImageTypes instead of refusing every image. AGENTS.md records the new easy-to-reintroduce composer rules; README notes the filename-placeholder paste refinement. Claude-Session: https://claude.ai/code/session_01CTomK8PgtEyDEpSbg6CmvW
Merge the accepted #248 Conversation composer attachment path onto current main as always-on default behavior. Keep #256 table-cell semantic names and createSdkJs attachment-cap options. The only textual conflict was README's Precise targets vs Image attachments bullets. Co-authored-by: Adelin <adelin-b@users.noreply.github.com>
Owner
Author
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.
Intent
Last-resort port of the accepted #248 Conversation composer image attachments onto current main. Original work by @adelin-b (
feat/clipboard-image-paste). Composer image paste/drop/picker stays the always-on default; that product call is closed. #248 is left open.What Changed
createSdkJsattachment-cap options. Accepted image types remain single-sourced asACCEPTED_IMAGE_MIMEand are threaded through chrome session JSON andcreateSdkJs.Conflict summary
Git reported a conflict only in
README.md(Precise targets vs Image attachments). Auto-merge kept both code contracts: #256'sserializeModuleHelpers/ table-cell helpers / attachment-cap options increateSdkJs, and #248'sacceptedImageMime/planClipboardPasteserialization plus the chrome composer controller. README keeps #256's table-cell Precise targets language and #248's composer attachment copy.Risk Assessment
Low: this is a port of already-reviewed #248 behavior onto current main, with #256 table-cell contracts left intact and existing tests covering both composer paste/drop/picker and annotation-card attachments.
Testing
pnpm run check— 969 pass, 5 skippedtest/chrome-client-queue.test.js,test/artifact-sdk-attachments.test.js,test/attachment-upload.browser.test.jstest/table-cell.test.js,test/artifact-sdk-bundle.test.js(served SDK still queues semantic table-cell targets), chrome pill rendering intest/chrome-client-queue.test.jsCo-authored-by: Adelin adelin-b@users.noreply.github.com