diff --git a/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift b/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift index d7a535c..268206a 100644 --- a/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift +++ b/NucleicRemote/NucleicRemote/Views/SessionDetailView.swift @@ -92,27 +92,48 @@ struct SessionDetailView: View { if let approval = store.openApprovals.first { ApprovalCardView(approval: approval) .padding() - } else if let status = summary?.status, status == .awaitingInput || status.isTerminal { - HStack(spacing: 8) { - TextField("Send a follow-up…", text: $draft, axis: .vertical) - .textFieldStyle(.roundedBorder) - .lineLimit(1...4) - Button { - store.sendInput(draft, to: sessionID) - draft = "" - } label: { - Image(systemName: "arrow.up.circle.fill").font(.title2) + } 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) { + 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) + .lineLimit(1...4) + Button { + store.sendInput(draft, to: sessionID) + draft = "" + } label: { + 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() } } }