Merge nucleic/nimble-north-gecko into dev
This commit is contained in:
@@ -92,26 +92,47 @@ struct SessionDetailView: View {
|
|||||||
if let approval = store.openApprovals.first {
|
if let approval = store.openApprovals.first {
|
||||||
ApprovalCardView(approval: approval)
|
ApprovalCardView(approval: approval)
|
||||||
.padding()
|
.padding()
|
||||||
} else if let status = summary?.status, status == .awaitingInput || status.isTerminal {
|
} else if let status = summary?.status {
|
||||||
|
let running = status == .running
|
||||||
|
let canCompose = running || status == .awaitingInput || status.isTerminal
|
||||||
|
VStack(spacing: 8) {
|
||||||
|
// A follow-up submitted mid-turn, held by the host to send when the current
|
||||||
|
// turn finishes.
|
||||||
|
if let queued = summary?.queuedMessage, !queued.isEmpty {
|
||||||
|
HStack(spacing: 6) {
|
||||||
|
Image(systemName: "clock").foregroundStyle(.secondary)
|
||||||
|
Text(queued).lineLimit(1).truncationMode(.tail)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
Spacer(minLength: 8)
|
||||||
|
}
|
||||||
|
.font(.footnote)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
}
|
||||||
|
if running {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
TextField("Send a follow-up…", text: $draft, axis: .vertical)
|
ProgressView().controlSize(.small)
|
||||||
|
Text("Agent is working…").font(.footnote).foregroundStyle(.secondary)
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
}
|
||||||
|
if canCompose {
|
||||||
|
HStack(spacing: 8) {
|
||||||
|
TextField(running ? "Queue a follow-up…" : "Send a follow-up…",
|
||||||
|
text: $draft, axis: .vertical)
|
||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.lineLimit(1...4)
|
.lineLimit(1...4)
|
||||||
Button {
|
Button {
|
||||||
store.sendInput(draft, to: sessionID)
|
store.sendInput(draft, to: sessionID)
|
||||||
draft = ""
|
draft = ""
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "arrow.up.circle.fill").font(.title2)
|
Image(systemName: running ? "clock.arrow.circlepath" : "arrow.up.circle.fill")
|
||||||
|
.font(.title2)
|
||||||
}
|
}
|
||||||
.disabled(draft.trimmingCharacters(in: .whitespaces).isEmpty || !store.connectivity.isLive)
|
.disabled(draft.trimmingCharacters(in: .whitespaces).isEmpty || !store.connectivity.isLive)
|
||||||
}
|
}
|
||||||
.padding()
|
|
||||||
} else if summary?.status == .running {
|
|
||||||
HStack(spacing: 8) {
|
|
||||||
ProgressView().controlSize(.small)
|
|
||||||
Text("Agent is working…").font(.footnote).foregroundStyle(.secondary)
|
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
}
|
||||||
.padding()
|
.padding()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user