githubnext/ace2Public

Ace: a collaborative coding environment on the team's own machines

Attach images pasted into the composer

IA

Pasting an image (for example, a screenshot copied with Cmd+Ctrl+Shift+4) into a chat composer doesn't attach it. Drag-and-drop and the paperclip file picker do attach images, so pasting should work too.

## Cause

The rich-text editor's `paste` handler (`packages/ui/src/components/rich-text/rich-text.tsx`, `getPaste`) reads only `text/uri-list` and `text/plain` from `clipboardData`. It never checks `clipboardData.files`, so a pasted image never reaches the composer's `onFiles`, the path that drop (`packages/ui/src/components/composer/composer.tsx`) and the file input already use.

## Expected

- Pasting one or more images into a composer that allows attachments adds them, the same way dropping them does. - Pasting text still behaves as it does now, including turning a pasted URL into a link. - Composers with `canAttach={false}` ignore pasted files.

Part of #5.

  1. iamnbutlerparent-issue-addedlast month on GitHub

  2. iamnbutlerreferenced this in [Meta] Dogfood Ace end to end #5last month on GitHub

  3. iamnbutlerreferenced this in Align timeline avatars with the sender's byline #93last month on GitHub

  4. iamnbutlerreferenced this in Keep literal braces in timeline message text #94last month on GitHub

  5. iamnbutlerreferenced this in Exclude trailing punctuation from linkified URLs in the timeline #95last month on GitHub

  6. iamnbutlerreferenced this in Start lanes from origin's default branch and measure their diff against it #96last month on GitHub

  7. iamnbutlerreferenced this in Finish development-run isolation: helper conflict diagnostics, loopback test hosts, and reload #97last month on GitHub

  8. IA
    Author

    Paused, with work in progress in the Ace lane `image-paste-91` (branch `brisk-grove/image-paste-91`, based on `origin/main` `1ab91be`). Nothing is committed or pushed yet, and there is no PR.

    - Change (2 files, +20): `RichText` takes an optional `onFiles`. Its paste handler sends image files from `clipboardData.files` there before the existing URL-link and plain-text handling runs. `ChatComposer` passes `onFiles={attachable ? addFiles : undefined}`, the same gate drop uses, so `canAttach={false}` and edit mode ignore pasted files. - Checks: `bun types` and `bun run ci` pass. - Not yet validated with a real clipboard in the UI. The lane's dev desktop build could only connect to an older installed Ace-dev helper (#97), and the supervisor paused desktop/clipboard testing. Still open: how mixed clipboards behave (text plus image, such as spreadsheet cells, and Finder file copies) in WebKit.

  9. IA
    Author

    Resumed and in progress in the Ace lane `image-paste-91` (branch `brisk-grove/image-paste-91`). Channel `dev-paste-validation` owns the test environment (#97 Ace-dev helper collision). This channel owns the code and the desktop/clipboard checks. Next: real paste checks in WebKit for images, plain text, URLs, multiline text, mixed text-and-image clipboards, `canAttach={false}`, and edit mode, then a PR.

  10. iamnbutlerreferenced this in Avoid macOS Automation prompts when agents drive other apps #103last month on GitHub

  11. iamnbutlerreferenced this in feat(ui): attach images pasted into the composer #104last month on GitHub

  12. IA
    Author

    PR #104 is open for review and not merged. It attaches pasted images through the existing `useAttachments().add` path. It keeps text whenever the clipboard has `text/plain` (spreadsheet and document copies), and it ignores pasted files when attachments are off. That also fixes a 0.0.11 bug where an image pasted into the dashboard composer was inserted into the editor as a raw `<img>`. I validated it in an Ace-dev build of the branch with real pasteboard contents; details are in the PR. The test environment has been cleaned up.

  13. iamnbutlerreferenced this in Attach every image from a multi-file Finder paste #105last month on GitHub

  14. iamnbutlerreferenced this in Focus and paste into WebKit composers with native desktop tools #106last month on GitHub

  15. IA
    Author

    The known limit of #104 is now tracked in #105: a Finder copy of several images attaches only the first, because WebKit exposes only the first copied file. The native desktop-tool failures from validation are in #106.

  16. iamnbutlerreferenced this in [Meta] Complete native computer use in Ace #8last month on GitHub

  17. iamnbutlerclosedlast month on GitHub

  18. iamnbutlerreferenced this in chore(desktop): release canary 0.0.12 #110last month on GitHub