Skip to content

Add image attachments to the chat demo - #49

Merged
SamSamskies merged 4 commits into
mainfrom
chat-demo-image-attach
Sep 13, 2026
Merged

SamSamskies merged 4 commits into
mainfrom
chat-demo-image-attach

Conversation

@SamSamskies

Copy link
Copy Markdown
Owner

Summary

  • Add attach / paste / drop image support to the chat demo when getFeatures().imageInput is available (jpeg, png, webp, gif).
  • Send multimodal user content with image parts, show attachment previews in the composer and in sent messages.
  • Harden paste and drag/drop so unsupported clipboard images keep text paste, streaming drops do not navigate away, and failed sends keep pending attachments with the draft.

Test plan

  • With Bridge + vision-capable injector: attach images via button, paste, and drag/drop; send and confirm they appear in the user bubble and reach the model
  • Paste plain text alone still works; paste with unsupported image type (e.g. SVG) still pastes text
  • Drop a file while a reply is streaming — page should not navigate away
  • Fail availability / image input unavailable with pending attachments — draft text and thumbnails should remain
  • Without image input: Attach control stays disabled; text-only chat still works

Made with Cursor

SamSamskies and others added 4 commits September 11, 2026 08:51
Gate attach/paste/drop on getFeatures().imageInput and send vision turns as content parts.

Co-authored-by: Cursor <cursoragent@cursor.com>
… types during paste events. Added support for inserting plain text from clipboard into the input field, improving user experience.
…alidation of file types during drag events. This update enhances user experience by preventing unnecessary actions when image input is unavailable or an active controller is present.
…put is unavailable. This simplifies the attachment handling process and improves overall functionality.
@SamSamskies
SamSamskies merged commit 5f4331c into main Sep 13, 2026
@SamSamskies
SamSamskies deleted the chat-demo-image-attach branch September 13, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant