From f3dabbd3aab15abe683aef84973927721af2cb36 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Mon, 15 Sep 2025 23:34:33 -0600 Subject: [PATCH] Fixed swipe actions and more widgets --- .../ClimbingActivityWidget.swift | 6 ++--- .../UserInterfaceState.xcuserstate | Bin 65136 -> 65136 bytes .../Views/Detail/SessionDetailView.swift | 24 ++++++++++-------- ios/SessionStatusLive/SessionStatusLive.swift | 8 +++--- .../SessionStatusLiveLiveActivity.swift | 8 +++--- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ios/ClimbingActivityWidget/ClimbingActivityWidget.swift b/ios/ClimbingActivityWidget/ClimbingActivityWidget.swift index 29d8b12..32ccc37 100644 --- a/ios/ClimbingActivityWidget/ClimbingActivityWidget.swift +++ b/ios/ClimbingActivityWidget/ClimbingActivityWidget.swift @@ -30,7 +30,7 @@ struct ClimbingActivityWidget: Widget { } DynamicIslandExpandedRegion(.bottom) { HStack { - Label("\(context.state.totalAttempts)", systemImage: "flame") + Label("\(context.state.totalAttempts)", systemImage: "hand.raised.fill") Spacer() Label("\(context.state.completedProblems)", systemImage: "checkmark.circle") Spacer() @@ -71,8 +71,8 @@ struct LiveActivityView: View { .font(.caption) .foregroundColor(.secondary) HStack { - Image(systemName: "flame.fill") - .foregroundColor(.orange) + Image(systemName: "hand.raised.fill") + .foregroundColor(.green) Text("\(context.state.totalAttempts)") .font(.title3) .fontWeight(.semibold) diff --git a/ios/OpenClimb.xcodeproj/project.xcworkspace/xcuserdata/atridad.xcuserdatad/UserInterfaceState.xcuserstate b/ios/OpenClimb.xcodeproj/project.xcworkspace/xcuserdata/atridad.xcuserdatad/UserInterfaceState.xcuserstate index b948fda7b13ab38b98db7c34d4f8a8fe02397aba..b9b7498f5fcea824863d761eb291b591097608b2 100644 GIT binary patch delta 264 zcmezHhxx-F<_($b>_)t1yjHwUn+w>L1X-s`emi?$@^lG#rm~L7J0!M&1zv3~mVCeo z6xkfAe4US}dckBpBP*u9C!4d393mK7Co9%_>hWsw>N1Ee=FH>F=ge(n+SZ>STX5eMu1M;kS?HI%s z@!A0OGq*KdUBtAVv#sG;Bh#MA8;c}1uj)SQ#X4Q+LBhAmHP_^sjTwwL&%2f=WqzUS zZP%}E#%`8w_HM3j!ETXm@ovd(>28&7!)}*uw{HLLnC|@U!tT26=I*xcj_%&>{_aWL LQ#PA@wBiK-+N@$J delta 244 zcmezHhxx-F<_($b>;}Asyw<$-n+w>L1X-u~-c}BuJY7PbscymK9TMBX0-c+SB_D7C zMK*^jU*}`0G?=VsWX04YusO@fA%d}G^1+Foe7u^xIt*fqc(s_eHZnI)ZtGUnHR3g6 z5L?Wd$C=NW+Xxh9+SbUlWihWguLaZ5M&{N==C+1=4VssDZ5a4@Z6_P*tFrMr0GW=H z3-whtFYdnL#X9xOB=?1rYp%&N8!;Gdo_8%#%KTK<+pb?-|GSyGS-Ls9xx4wg1-j+C rb-Ina&AKhSZMvPi-MT%yy}Nz8!@85Z%epJN8@v0u7j8EDXvGTvgH2e< diff --git a/ios/OpenClimb/Views/Detail/SessionDetailView.swift b/ios/OpenClimb/Views/Detail/SessionDetailView.swift index 8caee31..192be69 100644 --- a/ios/OpenClimb/Views/Detail/SessionDetailView.swift +++ b/ios/OpenClimb/Views/Detail/SessionDetailView.swift @@ -1,4 +1,3 @@ - import Combine import SwiftUI @@ -49,7 +48,8 @@ struct SessionDetailView: View { AttemptsSection( attemptsWithProblems: attemptsWithProblems, - attemptToDelete: $attemptToDelete) + attemptToDelete: $attemptToDelete, + editingAttempt: $editingAttempt) } else { Text("Session not found") .foregroundColor(.secondary) @@ -345,8 +345,8 @@ struct StatItem: View { struct AttemptsSection: View { let attemptsWithProblems: [(Attempt, Problem)] @Binding var attemptToDelete: Attempt? + @Binding var editingAttempt: Attempt? @EnvironmentObject var dataManager: ClimbingDataManager - @State private var editingAttempt: Attempt? var body: some View { VStack(alignment: .leading, spacing: 16) { @@ -376,13 +376,13 @@ struct AttemptsSection: View { .fill(.regularMaterial) ) } else { - LazyVStack(spacing: 12) { + List { ForEach(attemptsWithProblems.indices, id: \.self) { index in let (attempt, problem) = attemptsWithProblems[index] AttemptCard(attempt: attempt, problem: problem) - .background(.regularMaterial) - .cornerRadius(12) - .shadow(radius: 2) + .listRowBackground(Color.clear) + .listRowSeparator(.hidden) + .listRowInsets(EdgeInsets(top: 6, leading: 0, bottom: 6, trailing: 0)) .swipeActions(edge: .trailing, allowsFullSwipe: true) { Button(role: .destructive) { // Add haptic feedback for delete action @@ -409,11 +409,12 @@ struct AttemptsSection: View { } } } + .listStyle(.plain) + .scrollDisabled(true) + .frame(height: CGFloat(attemptsWithProblems.count) * 120) } } - .sheet(item: $editingAttempt) { attempt in - EditAttemptView(attempt: attempt) - } + } } @@ -460,6 +461,9 @@ struct AttemptCard: View { } } .padding() + .background(.regularMaterial) + .cornerRadius(12) + .shadow(radius: 2) } } diff --git a/ios/SessionStatusLive/SessionStatusLive.swift b/ios/SessionStatusLive/SessionStatusLive.swift index 54cba42..28fc8b4 100644 --- a/ios/SessionStatusLive/SessionStatusLive.swift +++ b/ios/SessionStatusLive/SessionStatusLive.swift @@ -200,8 +200,8 @@ struct SmallWidgetView: View { // Main stats - weekly attempts and sessions VStack(spacing: 16) { HStack(spacing: 8) { - Image(systemName: "flame.fill") - .foregroundColor(.orange) + Image(systemName: "hand.raised.fill") + .foregroundColor(.green) .font(.title2) Text("\(entry.weeklyAttempts)") .font(.title) @@ -255,8 +255,8 @@ struct MediumWidgetView: View { HStack(spacing: 40) { VStack(spacing: 8) { HStack(spacing: 8) { - Image(systemName: "flame.fill") - .foregroundColor(.orange) + Image(systemName: "hand.raised.fill") + .foregroundColor(.green) .font(.title2) Text("\(entry.weeklyAttempts)") .font(.title) diff --git a/ios/SessionStatusLive/SessionStatusLiveLiveActivity.swift b/ios/SessionStatusLive/SessionStatusLiveLiveActivity.swift index 56c68b3..7daadc0 100644 --- a/ios/SessionStatusLive/SessionStatusLiveLiveActivity.swift +++ b/ios/SessionStatusLive/SessionStatusLiveLiveActivity.swift @@ -54,8 +54,8 @@ struct SessionStatusLiveLiveActivity: Widget { .fontWeight(.bold) .monospacedDigit() HStack(spacing: 4) { - Image(systemName: "flame.fill") - .foregroundColor(.orange) + Image(systemName: "hand.raised.fill") + .foregroundColor(.green) .font(.caption) Text("\(context.state.totalAttempts)") .font(.caption) @@ -129,8 +129,8 @@ struct LiveActivityView: View { HStack(spacing: 20) { VStack(alignment: .leading, spacing: 4) { HStack(spacing: 6) { - Image(systemName: "flame.fill") - .foregroundColor(.orange) + Image(systemName: "hand.raised.fill") + .foregroundColor(.green) .font(.title3) Text("\(context.state.totalAttempts)") .font(.title2)