Add scheduled tasks with a Project tab section and lead tools
This commit is contained in:
@@ -295,7 +295,7 @@ private struct StepRow: View {
|
||||
if let agents = node.agents {
|
||||
Text("team of \(agents.count)").foregroundStyle(Palette.muted).fixedSize()
|
||||
} else {
|
||||
StepModelMenu(model: $node.model)
|
||||
ModelPicker(model: $node.model)
|
||||
}
|
||||
case .order:
|
||||
Text("in order").foregroundStyle(Palette.muted)
|
||||
@@ -326,7 +326,7 @@ private struct StepRow: View {
|
||||
TextField("Agent name", text: Binding(get: { node.agents?[i].name ?? "" }, set: { node.agents?[i].name = $0 }))
|
||||
.textFieldStyle(.plain)
|
||||
.font(Fonts.font(13, weight: 700))
|
||||
StepModelMenu(model: Binding(get: { node.agents?[i].model ?? "" }, set: { node.agents?[i].model = $0 }))
|
||||
ModelPicker(model: Binding(get: { node.agents?[i].model ?? "" }, set: { node.agents?[i].model = $0 }))
|
||||
}
|
||||
.padding(.top, 4)
|
||||
PromptEditor(text: Binding(get: { node.agents?[i].prompt ?? "" }, set: { node.agents?[i].prompt = $0 }))
|
||||
@@ -437,22 +437,34 @@ private struct StepRow: View {
|
||||
}
|
||||
}
|
||||
|
||||
private struct StepModelMenu: View {
|
||||
struct ModelPicker: View {
|
||||
@Binding var model: String
|
||||
|
||||
var body: some View {
|
||||
let list = model.isEmpty || models.contains(model) ? models : [model] + models
|
||||
ChoiceMenu(value: $model, options: list.map { ($0, $0) }, placeholder: "model")
|
||||
}
|
||||
}
|
||||
|
||||
struct ChoiceMenu<Value: Hashable>: View {
|
||||
@Binding var value: Value
|
||||
let options: [(Value, String)]
|
||||
var placeholder = ""
|
||||
|
||||
var body: some View {
|
||||
let label = options.first { $0.0 == value }?.1
|
||||
Menu {
|
||||
ForEach(models, id: \.self) { m in
|
||||
Button(m) { model = m }
|
||||
ForEach(options, id: \.0) { option in
|
||||
Button(option.1) { value = option.0 }
|
||||
}
|
||||
} label: {
|
||||
HStack(spacing: 6) {
|
||||
Text(model.isEmpty ? "model" : model)
|
||||
Text(label ?? placeholder)
|
||||
Image(systemName: "chevron.up.chevron.down")
|
||||
.font(Fonts.font(8, weight: 600))
|
||||
}
|
||||
.font(Fonts.font(12))
|
||||
.foregroundStyle(model.isEmpty ? Palette.muted : Palette.text)
|
||||
.foregroundStyle(label == nil ? Palette.muted : Palette.text)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.menuStyle(.button)
|
||||
@@ -462,7 +474,7 @@ private struct StepModelMenu: View {
|
||||
}
|
||||
}
|
||||
|
||||
private struct PromptEditor: View {
|
||||
struct PromptEditor: View {
|
||||
@Binding var text: String
|
||||
@FocusState private var focused: Bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user