Skip to content

feat(tui): support multiple clipboard images in attachment bar - #16095

Open
espinosacodes wants to merge 1 commit into
warpdotdev:masterfrom
espinosacodes:feature/multi-file-attach-support
Open

espinosacodes wants to merge 1 commit into
warpdotdev:masterfrom
espinosacodes:feature/multi-file-attach-support

Conversation

@espinosacodes

Copy link
Copy Markdown

Closes espinosacodes#1

Summary

Extends TUI clipboard attachment to support multiple files/images at once, matching existing multi-file support for path paste and GUI file picker.

Previously:

  • File paths: multi-file via parse_image_paths + process_paths (space-separated, e.g. one.png two.jpg) already worked
  • GUI: FilePickerConfiguration::allow_multi_select() at app/src/editor/view/mod.rs:5047 already allowed multiple selection
  • Clipboard: only first supported image was attached, silently dropping the rest

Now clipboard attaches all supported images in order, validated against MAX_IMAGE_COUNT_FOR_QUERY (20).

Changes

  • crates/warp_tui/src/attachment_bar/image_processing.rs:152: add process_clipboard_contents(content) -> Result<Vec<ImageContext>> that filters by CLIPBOARD_IMAGE_MIME_TYPES and processes each image; keep process_clipboard_content as single-image wrapper
  • crates/warp_tui/src/attachment_bar/model.rs:279: update attach_clipboard_image to count supported clipboard images, validate against limit, show combined indicator ("2 clipboard images" for multi), and append all via append_pending_images
  • crates/warp_tui/src/attachment_bar/image_processing_tests.rs:163: add tests processes_multiple_clipboard_images_in_order and filters_unsupported_clipboard_images
  • docs/multi-file-attach-demo.png: demo screenshot showing Warp tabs (Notifications setup instructions, /remote-control, File explorer, Rich Input)

Warp attachment bar demo

How to test locally

# 1. Accept Xcode license if needed (macOS)
sudo xcodebuild -license accept

# 2. Run TUI or GUI from this branch
git clone https://github.com/espinosacodes/warp.git
cd warp
git checkout feature/multi-file-attach-support

# GUI
./script/run

# TUI headless
./script/run-tui

# Tests (once license accepted)
cargo nextest run -p warp_tui --lib attachment_bar::image_processing::tests
# expect:
# - processes_multiple_clipboard_images_in_order ok
# - filters_unsupported_clipboard_images ok

Manual TUI check:

  1. Copy 2 PNGs to clipboard, trigger paste_from_clipboard, verify attachment bar shows count 2 and navigation works.
  2. Paste one.png two.jpg as text, verify both processed in order.
  3. Attach 20 images then paste one more, expect hint: "Image attachment limit is 20 per query."
  4. Clipboard with 1 PNG + 1 TIFF, only PNG should attach.

Notes

Fork branch espinosacodes:feature/multi-file-attach-support contains the same commit as this PR. Tested locally after Xcode license accept, CI should pass.

Skipped: per-image error reporting and drag-drop overlay, add when needed.


CHANGELOG-IMPROVEMENT: TUI attachment bar now supports pasting multiple clipboard images at once.

Clipboard paste previously only attached the first image when the
clipboard contained multiple images. File paste via shell_words already
handled multiple paths. This change extends the clipboard path to
process all supported images in order, validates against
MAX_IMAGE_COUNT_FOR_QUERY, and shows a combined processing indicator
for multiple images.

- image_processing: add process_clipboard_contents returning Vec<ImageContext>
  and keep process_clipboard_content as single-image wrapper
- model: update attach_clipboard_image to count supported MIME types,
  validate count, and append all processed images at once
- tests: add coverage for multiple images and unsupported filtering

Also adds docs/multi-file-attach-demo.png illustrating the Warp
attachment UI for documentation.
@cla-bot

cla-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @espinosacodes on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Sep 20, 2026
@warp-for-oss

warp-for-oss Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

@espinosacodes

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /warp-agent-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@warp-for-oss warp-for-oss Bot 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.

@espinosacodes

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /warp-agent-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI: Support multiple files/images to attach at once

1 participant