From 01fde44f47815d06df579223d13007e99c189bb1 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 5 Aug 2025 15:16:41 +0200 Subject: [PATCH] fix(project): restructure project drag handle Fixes a bug which would make reordering a project not work in Vivaldi. Resolves https://community.vikunja.io/t/drag-and-drop-move-projects-up-or-down-possible-left-side/3389/9 --- .../home/ProjectsNavigationItem.vue | 55 ++++++++++++++----- .../tasks/partials/SingleTaskInProject.vue | 2 +- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/home/ProjectsNavigationItem.vue b/frontend/src/components/home/ProjectsNavigationItem.vue index db77a2014..4bcd5b477 100644 --- a/frontend/src/components/home/ProjectsNavigationItem.vue +++ b/frontend/src/components/home/ProjectsNavigationItem.vue @@ -14,6 +14,15 @@ :class="{ 'project-is-collapsed': !childProjectsOpen }" /> + + + -
+
- - -
{{ getProjectTitle(project) }} @@ -155,7 +154,11 @@ const childProjects = computed(() => { opacity: 1; } -.list-menu:hover > div > a > .color-bubble-handle-wrapper.is-draggable > { +.list-menu:hover > div > .drag-handle-standalone { + opacity: 1; +} + +.list-menu:hover .color-bubble-wrapper > { .saved-filter-icon, .color-bubble { opacity: 0; @@ -166,7 +169,7 @@ const childProjects = computed(() => { opacity: 1 !important; } -.color-bubble-handle-wrapper { +.color-bubble-wrapper { position: relative; width: 1rem; height: 1rem; @@ -185,6 +188,22 @@ const childProjects = computed(() => { } } +.drag-handle-standalone { + width: 1rem; + height: 1rem; + opacity: 0; + cursor: grab; + transition: opacity $transition; + z-index: 2; + + position: absolute; + inset-inline-start: 1.75rem; + + &:active { + cursor: grabbing; + } +} + .project-menu-title { overflow: hidden; text-overflow: ellipsis; @@ -195,8 +214,14 @@ const childProjects = computed(() => { font-size: .75rem; } -.is-touch .handle.has-color-bubble { - display: none !important; +@media (pointer: coarse) { + .drag-handle-standalone { + display: none !important; + } +} + +.navigation-item { + position: relative; } .navigation-item:has(*:focus-visible) { diff --git a/frontend/src/components/tasks/partials/SingleTaskInProject.vue b/frontend/src/components/tasks/partials/SingleTaskInProject.vue index 600c25da0..9eae5b6cf 100644 --- a/frontend/src/components/tasks/partials/SingleTaskInProject.vue +++ b/frontend/src/components/tasks/partials/SingleTaskInProject.vue @@ -106,7 +106,7 @@ v-if="task.attachments.length > 0" class="project-task-icon" > - +