[PR #1945] [MERGED] feat(tasks): move tasks between projects with drag and drop #5350

Closed
opened 2026-04-16 13:35:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/1945
Author: @kolaente
Created: 12/8/2025
Status: Merged
Merged: 12/10/2025
Merged by: @kolaente

Base: mainHead: claude/drag-tasks-sidebar-01S4XNgJCDohf214LWt7sYcP


📝 Commits (10+)

  • e38b8d1 feat: enable dragging tasks from list/kanban to sidebar projects
  • 8985c49 Merge branch 'main' into claude/drag-tasks-sidebar-01S4XNgJCDohf214LWt7sYcP
  • 019c12c fix dragging and dropping
  • cfce19c feat: drag highligh
  • e3985a2 fix highlighting
  • fbb0964 add transition
  • c565ce5 drag everywhere on a task
  • 83ef34a add success notification after move
  • 8285298 add test
  • 923b573 Update frontend/src/components/home/ProjectsNavigationItem.vue

📊 Changes

11 files changed (+620 additions, -32 deletions)

View changed files

📝 frontend/src/components/home/ProjectsNavigation.vue (+0 -1)
📝 frontend/src/components/home/ProjectsNavigationItem.vue (+72 -2)
📝 frontend/src/components/project/views/ProjectKanban.vue (+33 -2)
📝 frontend/src/components/project/views/ProjectList.vue (+36 -26)
📝 frontend/src/components/tasks/partials/KanbanCard.vue (+2 -0)
📝 frontend/src/components/tasks/partials/SingleTaskInProject.vue (+4 -1)
frontend/src/composables/useTaskDragToProject.ts (+112 -0)
📝 frontend/src/i18n/lang/en.json (+1 -0)
📝 frontend/src/stores/tasks.ts (+7 -0)
frontend/tests/e2e/task/drag-to-project.spec.ts (+333 -0)
frontend/tests/factories/saved_filter.ts (+20 -0)

📄 Description

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

resolves https://github.com/go-vikunja/vikunja/issues/115

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.

Summary by CodeRabbit

  • New Features

    • Drag and drop tasks between projects from list and kanban views, with cross-project move handling and success notification.
    • Added visual drop-target highlighting when hovering a project during a drag.
  • UI

    • DOM attributes added to improve drag-hit detection and cursor/drag visuals.
  • Tests

    • End-to-end tests covering drag-to-project scenarios, invalid drops, permission cases, and error handling.
  • Localization

    • New localized message for "task moved to project."

✏️ Tip: You can customize this high-level summary in your review settings.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/1945 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 12/8/2025 **Status:** ✅ Merged **Merged:** 12/10/2025 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `claude/drag-tasks-sidebar-01S4XNgJCDohf214LWt7sYcP` --- ### 📝 Commits (10+) - [`e38b8d1`](https://github.com/go-vikunja/vikunja/commit/e38b8d15a60b5d3f6b54ebcf88bc5c81f586a152) feat: enable dragging tasks from list/kanban to sidebar projects - [`8985c49`](https://github.com/go-vikunja/vikunja/commit/8985c490704b2991f6b32cb73fa46a306c32fc7d) Merge branch 'main' into claude/drag-tasks-sidebar-01S4XNgJCDohf214LWt7sYcP - [`019c12c`](https://github.com/go-vikunja/vikunja/commit/019c12c1b90ccd484f67c34f12bc2d4bcc8b1ddf) fix dragging and dropping - [`cfce19c`](https://github.com/go-vikunja/vikunja/commit/cfce19c8d4dae45461790c869beaa8e999bf6f3c) feat: drag highligh - [`e3985a2`](https://github.com/go-vikunja/vikunja/commit/e3985a2c8ad11b8eb460554138d69996d4a65ca7) fix highlighting - [`fbb0964`](https://github.com/go-vikunja/vikunja/commit/fbb0964b04a8d3daf74a1ebbcd9c307a1b7c0870) add transition - [`c565ce5`](https://github.com/go-vikunja/vikunja/commit/c565ce5587ca419d778fa8dd7800b0cfa49e291f) drag everywhere on a task - [`83ef34a`](https://github.com/go-vikunja/vikunja/commit/83ef34a1c96eba4607d7c0e7e03f548af14f79ca) add success notification after move - [`8285298`](https://github.com/go-vikunja/vikunja/commit/8285298e0cd811aa5a6caf6060365d1735761027) add test - [`923b573`](https://github.com/go-vikunja/vikunja/commit/923b573ec4474fc11014d8ab3eec88f6cd2618e0) Update frontend/src/components/home/ProjectsNavigationItem.vue ### 📊 Changes **11 files changed** (+620 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/home/ProjectsNavigation.vue` (+0 -1) 📝 `frontend/src/components/home/ProjectsNavigationItem.vue` (+72 -2) 📝 `frontend/src/components/project/views/ProjectKanban.vue` (+33 -2) 📝 `frontend/src/components/project/views/ProjectList.vue` (+36 -26) 📝 `frontend/src/components/tasks/partials/KanbanCard.vue` (+2 -0) 📝 `frontend/src/components/tasks/partials/SingleTaskInProject.vue` (+4 -1) ➕ `frontend/src/composables/useTaskDragToProject.ts` (+112 -0) 📝 `frontend/src/i18n/lang/en.json` (+1 -0) 📝 `frontend/src/stores/tasks.ts` (+7 -0) ➕ `frontend/tests/e2e/task/drag-to-project.spec.ts` (+333 -0) ➕ `frontend/tests/factories/saved_filter.ts` (+20 -0) </details> ### 📄 Description Implement comprehensive drag-and-drop functionality to move tasks between projects by dragging from list or kanban views to sidebar project items. resolves https://github.com/go-vikunja/vikunja/issues/115 **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. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Drag and drop tasks between projects from list and kanban views, with cross-project move handling and success notification. * Added visual drop-target highlighting when hovering a project during a drag. * **UI** * DOM attributes added to improve drag-hit detection and cursor/drag visuals. * **Tests** * End-to-end tests covering drag-to-project scenarios, invalid drops, permission cases, and error handling. * **Localization** * New localized message for "task moved to project." <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 13:35:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5350