Skip to content

Commit dba9556

Browse files
wdvrclaude
andcommitted
Remove swipe-to-delete overlay, show tutorial on each new version
- Removed swipe gesture and trash background entirely (was bleeding through semi-transparent tally area) - Delete is now via context menu (long press) only - Tutorial now shows once per app version (not just on first install) - Bumped to v5.0.4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent abc2bd4 commit dba9556

5 files changed

Lines changed: 15 additions & 55 deletions

File tree

trivit Watch App/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>5.0.3</string>
20+
<string>5.0.4</string>
2121
<key>CFBundleVersion</key>
2222
<string>2</string>
2323
<key>WKApplication</key>

trivit.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ DELETED001001 /* DeletedItemsView.swift */ = {isa = PBXFileReference; lastKnownF
10091009
"$(inherited)",
10101010
"@executable_path/Frameworks",
10111011
);
1012-
MARKETING_VERSION = 5.0.3;
1012+
MARKETING_VERSION = 5.0.4;
10131013
PRODUCT_BUNDLE_IDENTIFIER = com.wouterdevriendt.trivit.watchkitapp;
10141014
PRODUCT_NAME = "$(TARGET_NAME)";
10151015

@@ -1041,7 +1041,7 @@ DELETED001001 /* DeletedItemsView.swift */ = {isa = PBXFileReference; lastKnownF
10411041
"$(inherited)",
10421042
"@executable_path/Frameworks",
10431043
);
1044-
MARKETING_VERSION = 5.0.3;
1044+
MARKETING_VERSION = 5.0.4;
10451045
PRODUCT_BUNDLE_IDENTIFIER = com.wouterdevriendt.trivit.watchkitapp;
10461046
PRODUCT_NAME = "$(TARGET_NAME)";
10471047

trivit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.0.3</string>
18+
<string>5.0.4</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleURLTypes</key>

trivit/Views/TrivitListView.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,15 @@ struct TrivitListView: View {
8181
@State private var deletedTrivit: Trivit?
8282
@State private var showUndoToast = false
8383
@State private var editingTrivitId: UUID?
84-
@AppStorage("hasSeenTutorial") private var hasSeenTutorial = false
84+
@AppStorage("tutorialSeenForVersion") private var tutorialSeenForVersion = ""
85+
86+
private var hasSeenTutorial: Bool {
87+
tutorialSeenForVersion == currentAppVersion
88+
}
89+
90+
private var currentAppVersion: String {
91+
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
92+
}
8593

8694
var body: some View {
8795
NavigationStack {
@@ -155,7 +163,7 @@ struct TrivitListView: View {
155163

156164
Button {
157165
withAnimation {
158-
hasSeenTutorial = true
166+
tutorialSeenForVersion = currentAppVersion
159167
}
160168
HapticsService.shared.impact(.light)
161169
} label: {

trivit/Views/TrivitRowView.swift

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ struct TrivitRowView: View {
1313
@Environment(\.modelContext) private var modelContext
1414
@AppStorage("hideCounterWhenExpanded") private var hideCounterWhenExpanded = true
1515
@State private var isEditing = false
16-
@State private var dragOffset: CGFloat = 0
1716
@State private var showingStatistics = false
1817
@State private var showingHistory = false
1918
@State private var hasHandledStartEditing = false
@@ -33,18 +32,8 @@ struct TrivitRowView: View {
3332
backgroundColor.opacity(0.55)
3433
}
3534

36-
private let deleteThreshold: CGFloat = -200
37-
3835
var body: some View {
39-
ZStack {
40-
// Swipe background
41-
swipeBackground
42-
43-
// Main content
44-
mainContent
45-
.offset(x: dragOffset)
46-
.simultaneousGesture(swipeGesture)
47-
}
36+
mainContent
4837
.contentShape(Rectangle())
4938
.contextMenu { contextMenuItems }
5039
.sheet(isPresented: $showingStatistics) {
@@ -78,21 +67,6 @@ struct TrivitRowView: View {
7867
}
7968
}
8069

81-
// MARK: - Swipe Background
82-
83-
private var swipeBackground: some View {
84-
HStack {
85-
Spacer()
86-
Image(systemName: "trash.fill")
87-
.font(.system(size: 24, weight: .bold))
88-
.foregroundColor(.white)
89-
.opacity(dragOffset < deleteThreshold ? 1.0 : 0.4)
90-
.padding(.trailing, 24)
91-
}
92-
.frame(maxWidth: .infinity, maxHeight: .infinity)
93-
.background(Color.red.opacity(dragOffset < deleteThreshold ? 1.0 : 0.7))
94-
}
95-
9670
// MARK: - Main Content
9771

9872
private var mainContent: some View {
@@ -226,28 +200,6 @@ struct TrivitRowView: View {
226200
.background(tallyBackgroundColor)
227201
}
228202

229-
// MARK: - Swipe Gesture
230-
231-
private var swipeGesture: some Gesture {
232-
DragGesture(minimumDistance: 20, coordinateSpace: .local)
233-
.onChanged { value in
234-
let horizontal = abs(value.translation.width)
235-
let vertical = abs(value.translation.height)
236-
if horizontal > vertical && value.translation.width < 0 {
237-
dragOffset = value.translation.width
238-
}
239-
}
240-
.onEnded { _ in
241-
if dragOffset < deleteThreshold {
242-
HapticsService.shared.notification(.warning)
243-
onDelete()
244-
}
245-
withAnimation(.spring(response: 0.3, dampingFraction: 0.7)) {
246-
dragOffset = 0
247-
}
248-
}
249-
}
250-
251203
// MARK: - Context Menu
252204

253205
@ViewBuilder

0 commit comments

Comments
 (0)