stop button too bright
This commit is contained in:
@@ -1553,9 +1553,6 @@ private struct SnapshotRow: View {
|
||||
.help("Start a new task from this snapshot, its agent continuing the conversation as it stood here")
|
||||
if snap.trigger != .answer {
|
||||
reviewButton
|
||||
if let review, review.state == .running {
|
||||
StopReviewButton(reviewId: review.id)
|
||||
}
|
||||
}
|
||||
Rectangle().fill(Palette.border).frame(height: 1)
|
||||
}
|
||||
|
||||
@@ -86,30 +86,6 @@ func findingWhere(_ f: JSONDict) -> String {
|
||||
return path.isEmpty ? "" : "\(path)\(line > 0 ? ":\(line)\(end > line ? "–\(end)" : "")" : "")"
|
||||
}
|
||||
|
||||
struct StopReviewButton: View {
|
||||
let reviewId: String
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@ViewState private var busy = false
|
||||
|
||||
var body: some View {
|
||||
Button("stop") {
|
||||
busy = true
|
||||
Task {
|
||||
do {
|
||||
_ = try await store.api.client.stopReview(path: .init(reviewId: reviewId)).ok
|
||||
} catch {
|
||||
busy = false
|
||||
overlays.showAlert(errorText(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
.buttonStyle(SmallLinkButtonStyle(color: Palette.danger))
|
||||
.disabled(busy)
|
||||
.help("End the reviewer and record this review as failed")
|
||||
}
|
||||
}
|
||||
|
||||
struct FindingRow: View {
|
||||
let review: Review
|
||||
let index: Int
|
||||
|
||||
Reference in New Issue
Block a user