Show the selected routine as a symbol-and-color preview in the form

The Routine row now renders the selection like the picker list's rows
(tinted symbol + name); with nothing selected it reads "Please select"
in secondary style.
This commit is contained in:
2026-07-11 12:50:21 -04:00
parent 1a1147b612
commit 76150070f8
+13 -4
View File
@@ -180,10 +180,19 @@ struct ScheduleAddEditView: View {
RoutinePickerList(routines: routines, currentID: selectedRoutine?.id,
selectedID: $routineID)
} label: {
HStack {
Text("Routine")
Spacer()
Text(selectedRoutine?.name ?? "Choose…")
// The row is the selection's preview the routine's own symbol and
// color, matching the picker list's rows.
if let routine = selectedRoutine {
HStack(spacing: 12) {
Image(systemName: routine.systemImage)
.font(.title3)
.foregroundStyle(Color.color(from: routine.color))
.frame(width: 32)
Text(routine.name)
.foregroundStyle(.primary)
}
} else {
Text("Please select")
.foregroundStyle(.secondary)
}
}