Skip to content

F5: Drag Project between Clients #8

@rororowyourboat

Description

@rororowyourboat

Summary

Allow users to reassign a Project from one Client to another by dragging it in the sidebar.

Scope

  • Extend dnd-kit setup to support cross-container drops (Project dragged onto a different Client section)
  • Add useDroppable zones on Client section headers/bodies
  • On cross-container drop: dispatch project.client.reassign command
  • On drop onto "Unassigned": dispatch project.client.unassign command
  • On drag from "Unassigned" onto a Client: dispatch project.client.assign command
  • Drop onto same Client: no-op
  • Drop onto archived Client: rejected with visual feedback

Technical notes — dnd-kit refactor required

The current drag setup needs significant changes for cross-container support:

  1. Multiple SortableContext containers — one per Client section (currently one flat list)
  2. DragOverlay component — needed for visual feedback during cross-container drags (currently absent)
  3. Custom collision detection — must distinguish "reorder within container" from "move to different container"
  4. Conditional modifiers — vertical-only for reorder within a Client, free movement when crossing Clients
  5. Data payload on drag items — tag each draggable with { type: "client" | "project", id } to route onDragEnd logic
  • Optimistic UI with rollback on command failure

Key files to modify

  • apps/web/src/components/Sidebar.tsx — major DndContext refactor: multiple containers, DragOverlay, collision detection
  • apps/web/src/store.ts — optimistic project reassignment

Dependencies

  • F2 (Client-Project binding commands), F3 (sidebar hierarchy)

Acceptance criteria

  • Can drag a Project from one Client section to another
  • Drop zone highlights on valid targets
  • Drop onto "Unassigned" unassigns the project
  • Drag from "Unassigned" onto a Client assigns it
  • Drop onto same Client is a no-op
  • Drop onto archived Client shows rejection feedback
  • Thread items cannot be dropped onto Clients
  • Optimistic UI with rollback

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 - Foundationclient-hierarchyClient hierarchy & workspace organizationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions