Skip to content

Conversation

@kolaente
Copy link
Member

@kolaente kolaente commented Dec 8, 2025

Implement comprehensive drag-and-drop functionality to move tasks between projects by dragging from list or kanban views to sidebar project items.

Phase 1: Drag metadata and state

  • Add data-task-id and data-project-id attributes to SingleTaskInProject and KanbanCard components
  • Add draggedTask state to task store with setDraggedTask function
  • Set drag state on drag start in list and kanban views
  • Clear drag state on drag end with proper cleanup

Phase 2: Sidebar drop handling and permissions

  • Configure ProjectsNavigation draggable to accept tasks from 'tasks' group
  • Implement handleTaskDrop to process task moves to target projects
  • Add comprehensive permission checks:
    • Reject drops on pseudo projects (saved filters, special IDs)
    • Reject drops on read-only projects
    • Prevent moving tasks to their current project
  • Clean up temporary DOM elements after drops

Phase 3: View refresh and cleanup

  • Remove tasks from list view after cross-project moves
  • Remove tasks from kanban buckets after cross-project moves
  • Update bucket counts when tasks are moved out
  • Skip position updates when tasks are dropped outside their source view
  • Use timeout-based checks to detect completed cross-project moves

All changes maintain existing drag behavior within views while adding new cross-view functionality. Includes proper error handling and state cleanup.

claude and others added 2 commits December 7, 2025 22:21
Implement comprehensive drag-and-drop functionality to move tasks between projects by dragging from list or kanban views to sidebar project items.

**Phase 1: Drag metadata and state**
- Add data-task-id and data-project-id attributes to SingleTaskInProject and KanbanCard components
- Add draggedTask state to task store with setDraggedTask function
- Set drag state on drag start in list and kanban views
- Clear drag state on drag end with proper cleanup

**Phase 2: Sidebar drop handling and permissions**
- Configure ProjectsNavigation draggable to accept tasks from 'tasks' group
- Implement handleTaskDrop to process task moves to target projects
- Add comprehensive permission checks:
  - Reject drops on pseudo projects (saved filters, special IDs)
  - Reject drops on read-only projects
  - Prevent moving tasks to their current project
- Clean up temporary DOM elements after drops

**Phase 3: View refresh and cleanup**
- Remove tasks from list view after cross-project moves
- Remove tasks from kanban buckets after cross-project moves
- Update bucket counts when tasks are moved out
- Skip position updates when tasks are dropped outside their source view
- Use timeout-based checks to detect completed cross-project moves

All changes maintain existing drag behavior within views while adding new cross-view functionality. Includes proper error handling and state cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants