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