Skip to content

Drag-and-drop to move connections / folders in the Database Explorer #176

@NicolaasGrobler

Description

@NicolaasGrobler

Request

Support native drag-and-drop in the Database Explorer tree to reorganize the connection hierarchy:

  • Drag a connection onto a folder (or to root) to move it.
  • Drag a folder onto another folder (or to root) to re-parent it.

Current state

Moving is only possible via right-click → "Move to folder…" → the MoveToFolderDialog picker (feature #104). There is no native DnD — confirmed: zero draggable/onDragStart/onDrop handlers in src, and no DnD library (react-dnd/@dnd-kit) in deps.

Notes / implementation pointers

  • The backend already exists and is cycle-safe: moveConnectionToFolder(connId, parentId) and moveFolder(folderId, parentId) in ConnectionContext (the latter rejects cycles). DnD would be a UI layer on top of these.
  • Tree rows are rendered in renderTree in src/components/explorer/DatabaseExplorer.tsx; folder rows carry contextMenuId = folder:<id> and connection rows carry the connection id.
  • Needs: drop-target highlighting, a no-op/invalid-drop affordance when a move would form a cycle (reuse descendantFolderIds), and keyboard-accessible equivalent (the existing "Move to folder…" picker already covers a11y).
  • Decide native HTML5 DnD vs a small library; native is dependency-free but fiddly for tree nesting.

Out of scope for the design-system cleanup; filed as a standalone feature follow-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions