This commit is contained in:
2025-07-19 16:51:52 -04:00
parent e3c3f2c6f0
commit 2ef340e5c8

View File

@ -27,7 +27,6 @@ struct ExercisePickerView: View {
var body: some View { var body: some View {
NavigationStack { NavigationStack {
Group { Group {
Text("Multi-Select: \(allowMultiSelect)")
if selectedListName == nil { if selectedListName == nil {
// Show list of exercise list files // Show list of exercise list files
List { List {
@ -51,6 +50,13 @@ struct ExercisePickerView: View {
} }
} }
} }
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button("Cancel") {
dismiss()
}
}
}
.navigationTitle("Exercise Lists") .navigationTitle("Exercise Lists")
} else if let fileName = selectedListName, let list = exerciseLists[fileName] { } else if let fileName = selectedListName, let list = exerciseLists[fileName] {
// Show exercises in the selected list grouped by split // Show exercises in the selected list grouped by split
@ -107,17 +113,13 @@ struct ExercisePickerView: View {
} }
} }
} }
.navigationTitle(list.name)
.toolbar { .toolbar {
if let _ = selectedListName {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .navigationBarLeading) {
Button("Back") { Button("Back") {
selectedListName = nil selectedListName = nil
selectedExercises.removeAll() selectedExercises.removeAll()
} }
} }
}
if allowMultiSelect { if allowMultiSelect {
ToolbarItem(placement: .navigationBarTrailing) { ToolbarItem(placement: .navigationBarTrailing) {
Button("Select") { Button("Select") {
@ -130,15 +132,7 @@ struct ExercisePickerView: View {
} }
} }
} }
} .navigationTitle(list.name)
}
.toolbar {
if let _ = selectedListName {
ToolbarItem(placement: .navigationBarLeading) {
Button("Cancel") {
dismiss()
}
}
} }
} }
} }