Skip to content

fix(chat-ui): support pasting image attachments#2862

Merged
arnestrickmann merged 9 commits into
mainfrom
emdash/eng-1852-chat-image-paste
Jul 14, 2026
Merged

fix(chat-ui): support pasting image attachments#2862
arnestrickmann merged 9 commits into
mainfrom
emdash/eng-1852-chat-image-paste

Conversation

@janburzinski

@janburzinski janburzinski commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • handle pasted clipboard images in the shared chat composer
  • route pasted images through the existing ACP attachment upload flow for every supported agent
  • prefer one supported clipboard representation to avoid duplicate TIFF/PNG uploads on macOS

Root cause

The shared chat composer only handled drag-and-drop events, so Cmd+V image data never entered the existing attachment pipeline.

Screen recording

https://cap.link/1k3av3k59dbpst0

@janburzinski
janburzinski marked this pull request as ready for review July 14, 2026 11:18
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds pasted image support to the shared chat composer. The main changes are:

  • Image files from clipboard paste events are collected and routed through the attachment flow.
  • Mixed text-and-image pastes keep normal text insertion while adding image attachments.
  • ACP image uploads now filter unsupported formats and show a toast for rejected files.
  • Supported ACP image MIME types can be inferred from common file extensions.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
packages/ui/src/react/components/chat-composer/index.tsx Adds paste-time image detection and routes pasted image files through the existing attachment callbacks.
apps/emdash-desktop/src/renderer/features/conversations/acp/acp-chat-panel.tsx Adds ACP image format filtering, extension-based MIME inference, and user-facing feedback for unsupported pasted images.

Reviews (9): Last reviewed commit: "fix(chat): handle generic clipboard imag..." | Re-trigger Greptile

Comment thread packages/ui/src/react/components/chat-composer/index.tsx Outdated
Comment thread packages/ui/src/react/components/chat-composer/attachment-files.ts Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread packages/ui/src/react/components/chat-composer/attachment-files.ts Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread packages/ui/src/react/components/chat-composer/attachment-files.ts Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread apps/emdash-desktop/src/renderer/features/conversations/acp/acp-chat-panel.tsx Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

Comment thread packages/ui/src/react/components/chat-composer/attachment-files.ts Outdated
Comment thread packages/ui/src/react/components/chat-composer/attachment-files.ts Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

@janburzinski
janburzinski marked this pull request as draft July 14, 2026 13:11
@janburzinski
janburzinski marked this pull request as ready for review July 14, 2026 13:29
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

@janburzinski

Copy link
Copy Markdown
Collaborator Author

Cleaned this up to keep the PR focused on ENG-1852. Pasted images now just use the existing attachment flow, so we don’t need the extra helpers or API changes.

Comment thread packages/ui/src/react/components/chat-composer/index.tsx Outdated
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

@arnestrickmann arnestrickmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - manually tested it - works!

@arnestrickmann
arnestrickmann merged commit 86e8f34 into main Jul 14, 2026
1 check passed
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.

2 participants