Fixed Widget stats
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct AddAttemptView: View {
|
||||
@@ -610,36 +609,25 @@ struct EditAttemptView: View {
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
Form {
|
||||
Section("Problem") {
|
||||
Section("Select Problem") {
|
||||
if availableProblems.isEmpty {
|
||||
Text("No problems available")
|
||||
.foregroundColor(.secondary)
|
||||
} else {
|
||||
ForEach(availableProblems, id: \.id) { problem in
|
||||
HStack {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(problem.name ?? "Unnamed Problem")
|
||||
.font(.headline)
|
||||
|
||||
Text(
|
||||
"\(problem.difficulty.system.displayName): \(problem.difficulty.grade)"
|
||||
)
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.blue)
|
||||
LazyVGrid(
|
||||
columns: Array(repeating: GridItem(.flexible(), spacing: 8), count: 2),
|
||||
spacing: 8
|
||||
) {
|
||||
ForEach(availableProblems, id: \.id) { problem in
|
||||
ProblemSelectionCard(
|
||||
problem: problem,
|
||||
isSelected: selectedProblem?.id == problem.id
|
||||
) {
|
||||
selectedProblem = problem
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
if selectedProblem?.id == problem.id {
|
||||
Image(systemName: "checkmark.circle.fill")
|
||||
.foregroundColor(.blue)
|
||||
}
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
selectedProblem = problem
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 8)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,6 +712,7 @@ struct EditAttemptView: View {
|
||||
guard selectedProblem != nil else { return }
|
||||
|
||||
let updatedAttempt = attempt.updated(
|
||||
problemId: selectedProblem?.id,
|
||||
result: selectedResult,
|
||||
highestHold: highestHold.isEmpty ? nil : highestHold,
|
||||
notes: notes.isEmpty ? nil : notes,
|
||||
|
||||
@@ -128,7 +128,7 @@ struct LiveActivityDebugView: View {
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(8)
|
||||
.id("bottom")
|
||||
.onChange(of: debugOutput) { _ in
|
||||
.onChange(of: debugOutput) {
|
||||
withAnimation {
|
||||
proxy.scrollTo("bottom", anchor: .bottom)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user