anomalyco / anomalyco/opencode

web: allow multi-select / multi-file drag from the file tree into the prompt

Open
#48,131 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Sep 9, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Verified
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

I self-host opencode and mostly use it from the browser. When I'm composing a task I often need to reference a handful of files from the right-side file tree, but right now that means dragging them into the prompt one at a time.

What I do today: drag file 1 from the tree into the composer, go back to the tree, drag file 2, and so on. With 4-5 files this gets tedious, and it's easy to lose your place in the tree between drags.

What I'd like: select several files in the tree (ctrl/shift-click, or any multi-row drag) and drop them into the prompt once, with each file becoming its own @mention.

I did some digging in the client code to see what this would involve:

  • In packages/app/src/components/file-tree-v2.tsx each row's onDragStart puts a single file:<path> into text/plain, and rows have no notion of being part of a multi-row selection.
  • On the receiving side (packages/session-ui/src/v2/components/prompt-input/attachments.ts), the drop handler reads that one path and inserts one @mention. The dataTransfer.files branch (which does handle N files) is only populated for OS-level drags, not for drags that start inside the page.

So my read is this needs (a) some form of multi-select in the tree and (b) a drag payload that carries several paths (e.g. a custom mime type like application/x-opencode-paths, one path per line in text/plain, anything really) plus a drop handler that inserts one mention per path.

For the record I searched before posting; closest things I found were #39705 (desktop: dropping a second file sequentially fails — related surface, different problem) and #31939 (external files should offer insert-path mode — also related, but about OS files rather than tree rows).

I noticed CONTRIBUTING asks for design review on UI features, so I'm posting here first. I'm happy to attempt a PR if a maintainer tells me the preferred shape for the multi-select + payload.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.