Let the human ignore an open question in a transcript
This commit is contained in:
@@ -159,6 +159,23 @@ private final class CardModel {
|
||||
}
|
||||
}
|
||||
|
||||
func dismiss() {
|
||||
if busy {
|
||||
return
|
||||
}
|
||||
busy = true
|
||||
Task {
|
||||
do {
|
||||
_ = try await store.api.client.dismissInbox(path: .init(itemId: item.id)).ok
|
||||
store.drafts?.clearAnswer(item.id)
|
||||
store.paneFocus.setDraft(key, false)
|
||||
} catch {
|
||||
overlays.showAlert(errorText(error))
|
||||
busy = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func submitQuestion() {
|
||||
let opts = multiple ? checked : []
|
||||
if !opts.isEmpty {
|
||||
@@ -430,6 +447,11 @@ private struct CardActions: View {
|
||||
model.submit(InboxResponseCreate(itemId: model.item.id, _type: .other, text: delegateText))
|
||||
}
|
||||
.buttonStyle(WebButtonStyle())
|
||||
Button("Ignore") {
|
||||
model.dismiss()
|
||||
}
|
||||
.buttonStyle(WebButtonStyle())
|
||||
.help("Dismiss this question without answering it; the agent is not told")
|
||||
Spacer()
|
||||
Button("Submit") {
|
||||
model.submitQuestion()
|
||||
|
||||
Reference in New Issue
Block a user