Fold task state into one server field; add ready cancel and dismiss

This commit is contained in:
Ian Gulliver
2026-10-20 08:51:32 -07:00
parent 224a0d5a4b
commit e7724977c8
12 changed files with 506 additions and 388 deletions
+17 -1
View File
@@ -138,7 +138,7 @@ final class ChatModel {
var reviewing: Bool {
let state = taskId.flatMap { store.findTask($0) }?.state
return state == .reviewing || state == .reviewPending
return state == .reviewing || state == .reviewPending || state == .mergeAfterReview
}
var subagents: Bool {
@@ -1416,6 +1416,8 @@ private struct ReadyBubble: View {
let latest: Bool
let unmerged: Bool
@Environment(Store.self) private var store
@Environment(Overlays.self) private var overlays
@ViewState private var dismissing = false
var body: some View {
let task = taskId.flatMap { store.findTask($0) }
@@ -1434,6 +1436,20 @@ private struct ReadyBubble: View {
let busy = store.taskBusy(task.id)
HStack(spacing: 8) {
Spacer(minLength: 0)
Button("Dismiss") {
dismissing = true
Task {
do {
_ = try await store.api.client.dismissReady(path: .init(taskId: task.id)).ok
} catch {
overlays.showAlert(errorText(error))
}
dismissing = false
}
}
.buttonStyle(SmallLinkButtonStyle())
.disabled(dismissing)
.help(discard ? "Drop this suggestion; the task stays open" : "Drop this ready call; the task stays open")
if !discard {
MergeButton(task: task, busy: busy, unmerged: unmerged, small: true)
}