[PR #1704] [MERGED] feat: improve file attachment pasting #10030

Closed
opened 2026-02-16 18:14:35 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1704
Author: @neominik
Created: 8/8/2025
Status: Merged
Merged: 8/8/2025
Merged by: @adamdotdevin

Base: devHead: feat/attchement-pasting


📝 Commits (2)

  • 86cf791 feat: improve file attachment pasting
  • c3b8b1f fix: always attach image and PDF pastes

📊 Changes

3 files changed (+435 additions, -49 deletions)

View changed files

📝 packages/tui/internal/components/chat/editor.go (+155 -49)
packages/tui/internal/components/chat/editor_test.go (+277 -0)
📝 packages/tui/internal/tui/tui.go (+3 -0)

📄 Description

When there are (one or multiple) @existing/paths in a pasted message (e.g., someone copied a previous message from opencode), attachments will properly be created for those.
When typing @ followed by pasting a path, an attachment will be created as well.
Pasting a path without typing @ or including an @ in the pasted message itself just pastes the text without creating an attachment, so we can mention large files or folders without including them in the context.

Fixes #1477


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1704 **Author:** [@neominik](https://github.com/neominik) **Created:** 8/8/2025 **Status:** ✅ Merged **Merged:** 8/8/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `feat/attchement-pasting` --- ### 📝 Commits (2) - [`86cf791`](https://github.com/anomalyco/opencode/commit/86cf791ab5d721b9b1794eae0197c3fd23ff3be6) feat: improve file attachment pasting - [`c3b8b1f`](https://github.com/anomalyco/opencode/commit/c3b8b1fc83b7db2c8742a47cf433f4e8f3403ebd) fix: always attach image and PDF pastes ### 📊 Changes **3 files changed** (+435 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `packages/tui/internal/components/chat/editor.go` (+155 -49) ➕ `packages/tui/internal/components/chat/editor_test.go` (+277 -0) 📝 `packages/tui/internal/tui/tui.go` (+3 -0) </details> ### 📄 Description When there are (one or multiple) @existing/paths in a pasted message (e.g., someone copied a previous message from opencode), attachments will properly be created for those. When typing @ followed by pasting a path, an attachment will be created as well. Pasting a path without typing @ or including an @ in the pasted message itself just pastes the text without creating an attachment, so we can mention large files or folders without including them in the context. Fixes #1477 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:35 -05:00
yindo closed this issue 2026-02-16 18:14:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10030