You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
web: allow multi-select / multi-file drag from the file tree into the prompt #48131
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.
Thanks for the detailed write-up, @Jweokk! You're asking for multi-select in the web file tree (ctrl/shift-click) so you can drag several files into the prompt at once, with each one becoming its own @mention. Maintainers will consider it.
One note for a future PR: the code has moved since the paths you cited.
The tree row's drag payload now comes from startFileDrag in packages/gui-plugins/src/file/drag.ts. It sets one file:<path> in text/plain and one text/uri-list entry.
The drop is handled in packages/app/src/composer/attachments/attachments.ts, which reads a single file: path. Only drops from the operating system go through the dataTransfer.files branch that handles several files.
Since this is a UI change, please wait for a maintainer to agree on the selection model and payload format before you start on a PR.
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the detailed write-up, @Jweokk! You're asking for multi-select in the web file tree (ctrl/shift-click) so you can drag several files into the prompt at once, with each one becoming its own @mention. Maintainers will consider it.
One note for a future PR: the code has moved since the paths you cited.
startFileDraginpackages/gui-plugins/src/file/drag.ts. It sets onefile:<path>intext/plainand onetext/uri-listentry.packages/app/src/composer/attachments/attachments.ts, which reads a singlefile:path. Only drops from the operating system go through thedataTransfer.filesbranch that handles several files.Since this is a UI change, please wait for a maintainer to agree on the selection model and payload format before you start on a PR.
Related issues: