github →

New request

#3402: feat(workspace): file-manager drag-and-drop — move within tree + import from OS into workspace

We'll provision a sandbox, run an agent against the issue, and open a draft PR. You can pull the branch and iterate from there.

Issue
enhancementworkspace

Summary

The workspace file tree panel supports drag-and-drop, but only for referencing paths in the chat composer (#1097, closed). It does not behave like a desktop file manager for:

  1. Moving existing files/folders within the workspace tree (drag item → drop on folder).
  2. Importing files/folders dragged from the OS (Finder/Explorer) into the workspace panel (current directory), as opposed to attaching them to the chat.

Users often expect both because the panel looks like a file tree. Today that expectation is unmet by design of #1097, not by an obvious bug — but the gap is undocumented in-product and was deferred from #1104 (“Move/copy — lower priority, complex UX”).

Current behavior (intentional)

ActionWhat happens
Drag file/folder in workspace treedraggable=true, effectAllowed='copy', sets application/ws-path
Drop on composerInserts @<workspace-relative-path> into the message textarea
Drag files from OS onto pageGlobal drop on composerWrap: addFiles() → chat attachments (session inbox), not workspace import
Drag in Settings → Workspaces listReorder registered workspaces (/api/workspaces/reorder) — unrelated to in-tree file ops

Backend: create, delete, rename in place only (/api/file/rename rejects / in new_name — no cross-directory move). No /api/file/move or workspace-panel drop target.

Requested behavior

A. Internal move (tree → tree)

  • Drag file or folder onto another folder (or breadcrumb) to move within the workspace root.
  • Visual drop targets, move effect, confirm on overwrite if needed.
  • API: cross-directory move (POST /api/file/move or extend rename with validated to path).

B. OS import (OS → workspace panel)

  • Drop files/folders onto the workspace file tree to copy/upload into active directory (S.currentDir), not only the composer.
  • Folder drops: directory traversal via DataTransferItem / webkitGetAsEntry (document platform limits).
  • Reuse upload/security patterns (/api/upload, zip extract #525); clarify vs session attachment inbox (#2319).

C. UX clarity (optional)

  • In-product hint: tree drag → chat @path today; file-manager move once implemented.
  • Do not break #1097 composer drops.

Related

  • #1097 — workspace tree → chat @path (done)
  • #1104 — CRUD; move/copy deferred
  • #492 — reorder workspace list in Settings
  • #525 — archive upload/extract

Acceptance criteria (draft)

  • Drag tree item → folder moves file (validated paths, error toasts).
  • OS drop on workspace panel imports into current workspace directory.
  • #1097 composer behavior unchanged.
  • Tests for ws-path vs Files vs internal move routing.
Assessmentadvisory
feature●●● hard90% confidence

File-manager drag-and-drop requires new backend move/upload endpoints and extensive frontend workspace tree event handling.

Likely files
  • static/js/workspaceBrowser.js
  • api/routes.py
  • api/workspace.py
  • static/css/styles.css
  • static/index.html
  • tests/test_workspace.py
Create the request

This opens a fresh agent run and a draft PR for issue #3402.

Cancel