← All repositories

listless

A simple list app for Apple platforms

git clone https://code.inqk.net/listless.git


commit 67c86dc50aafbf568dc77bdc20b4c4b27811d63f
parent 555e16a8931fdd0f1db5ff436154685c55bd176d
Author: Michael Camilleri <[email protected]>
Date:   Tue, 24 Mar 2026 14:06:47 +0900

Fix drag reordering issues

This commit fixes the visual ordering as rows are dragged 'over' other
rows. It also fixes a bug where the lift animation would not display.

Co-Authored-By: Claude 4.6 Opus <[email protected]>

Diffstat

MListless/Extensions/TaskListView+Logic.swift | 4+++-
MListlessiOS/Views/TaskListView.swift | 2+-

2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Listless/Extensions/TaskListView+Logic.swift b/Listless/Extensions/TaskListView+Logic.swift

@@ -552,7 +552,9 @@ extension TaskListViewProtocol {
 
     func startDrag(taskID: UUID) {
         guard case .idle = dragState else { return }
-        dragState = .dragging(id: taskID, order: activeTasks.map(\.id))
+        withAnimation(.easeOut(duration: 0.15)) {
+            dragState = .dragging(id: taskID, order: activeTasks.map(\.id))
+        }
         didStartDrag()
     }
 

diff --git a/ListlessiOS/Views/TaskListView.swift b/ListlessiOS/Views/TaskListView.swift

@@ -353,7 +353,6 @@ struct TaskListView: View, TaskListViewProtocol {
                 color: draggedTaskID == taskID ? .black.opacity(0.3) : .clear,
                 radius: 12, y: 4
             )
-            .zIndex(draggedTaskID == taskID ? 2 : 1)
             .taskDragGesture(
                 isActive: !task.isCompleted && focusedFieldBinding != .task(taskID),
                 taskID: taskID,
@@ -367,6 +366,7 @@ struct TaskListView: View, TaskListViewProtocol {
                 layoutStorage.rowFrames[taskID] = frame
             }
             .padding(.bottom, rowGap)
+            .zIndex(draggedTaskID == taskID ? 2 : 1)
             .id(taskID)
         }