Skip to content

F8: Drag file references from file tree into thread composer #11

Closed

Description

@rororowyourboat

Summary

Allow users to drag a file from the file tree panel and drop it onto the chat composer to insert an @-mention reference, integrating with the existing file-mention system.

Scope

  • Make file tree items draggable via dnd-kit (useDraggable with data: { type: "file", path, kind })
  • Add a drop zone on the chat composer area (useDroppable)
  • On drop: insert @<relative-path> at cursor position in the composer
  • Leverage existing file-mention resolution logic (already handles @-mention file refs)
  • Drag overlay shows filename during drag

Interactions

  • Drop onto composer: inserts @-mention at cursor
  • Drop onto a collapsed Thread in sidebar: activate that Thread, open composer, insert mention
  • Drag a directory: inserts directory path as mention
  • Drop outside valid zones: cancel, no action
  • Multiple file drag (if dnd-kit supports): insert each path on separate lines

Constraints

  • Only files within the active Project's workspaceRoot can be dragged
  • Inserted reference uses relative path from workspaceRoot, not absolute path
  • Cross-project file mentions not supported

Key files to modify

  • apps/web/src/components/FileTreePanel.tsx — add useDraggable to file items
  • apps/web/src/components/Sidebar.tsx — extend DndContext to support file drag type
  • apps/web/src/components/ — composer component: add useDroppable zone
  • apps/web/src/composerDraftStore.ts — insert @-mention at cursor position

Dependencies

  • F7 (File tree panel must exist first)

Acceptance criteria

  • Can drag a file from file tree to composer
  • @-mention reference inserted at cursor position
  • Existing file-mention resolution picks up the reference
  • Drag overlay shows filename
  • Directory drag inserts directory path
  • Drop outside valid zone cancels cleanly

Activity

  1. rororowyourboat commented on Apr 10, 2026

    @rororowyourboat
    OwnerAuthor

    Implemented in feat/sidebar-project-groups branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2 - File awarenessclient-hierarchyClient hierarchy & workspace organizationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions