← All repositories

listless

A simple list app for Apple platforms

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


commit 7c20caec64b2dd46da5c82c43e9119cfd7e5308a
parent 26aac929f3138d295e4d057e7e4f7bbc022ff7b2
Author: Michael Camilleri <[email protected]>
Date:   Wed, 11 Mar 2026 21:39:37 +0900

Fix pull-to-create animation if no active rows

The animation did not render properly if there were no active rows. This
commit fixes that (in a bit of a hacky way).

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

Diffstat

MListlessiOS/Views/PullToCreate.swift | 17++++++++++-------
MListlessiOS/Views/TaskListView.swift | 5+++--

2 files changed, 13 insertions(+), 9 deletions(-)

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

@@ -3,6 +3,7 @@ import SwiftUI
 struct PullToCreateIndicator: View {
     let pullOffset: CGFloat
     let threshold: CGFloat
+    var hasRowsBelow: Bool = true
 
     static let indicatorHeight: CGFloat = 50
 
@@ -53,14 +54,16 @@ struct PullToCreateIndicator: View {
                 .frame(height: revealedHeight)
         }
         .background(alignment: .top) {
-            Color.taskCard
-                .frame(
-                    height: min(
-                        TaskRowMetrics.trailingCornerRadius,
-                        Self.indicatorHeight - revealedHeight
+            if hasRowsBelow {
+                Color.taskCard
+                    .frame(
+                        height: min(
+                            TaskRowMetrics.trailingCornerRadius,
+                            Self.indicatorHeight - revealedHeight
+                        )
                     )
-                )
-                .offset(y: revealedHeight)
+                    .offset(y: revealedHeight)
+            }
         }
         .allowsHitTesting(false)
     }

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

@@ -240,7 +240,7 @@ struct TaskListView: View, TaskListViewProtocol {
     }
 
     private var pullToCreateRowOverlap: CGFloat {
-        guard pullToCreate.shouldShowIndicator, !iState.phantomRowVisible, !displayActiveTasks.isEmpty else {
+        guard pullToCreate.shouldShowIndicator, !iState.phantomRowVisible else {
             return 0
         }
         return PullToCreateIndicator.indicatorHeight - pullToCreateRevealHeight
@@ -258,7 +258,8 @@ struct TaskListView: View, TaskListViewProtocol {
                     pullOffset: pullToCreate.indicatorDisplayOffset(
                         threshold: pullCreateThreshold
                     ),
-                    threshold: pullCreateThreshold
+                    threshold: pullCreateThreshold,
+                    hasRowsBelow: !displayActiveTasks.isEmpty
                 )
                 .opacity(showPhantom ? 0 : 1)