// // SubTaskView.swift // Todos // // Created by Sam Jaffe on 2/28/26. // import SwiftUI struct SubTaskView: View { @Binding var task: SubTask @State private var hideNotes: Bool = false @FocusState private var isFocused: Bool var body: some View { VStack { HStack { Label("", systemImage: "chevron.right") .padding(.trailing, -10) StatusPicker(status: $task.status) TextField("Task Name", text: $task.name) .focused($isFocused) } if isFocused || !(hideNotes || task.notes.isEmpty) { HStack { TextField("Notes", text: $task.notes) .font(.footnote) .padding(.leading, 30) VisibilityTapper(hideToggle: $hideNotes) }.focused($isFocused) } } } } #Preview { @Previewable @State var task = SubTask(name: "New Task") SubTaskView(task: $task) .frame(minHeight: 100) // Preview does not resize window properly }