Happy review
This commit is contained in:
Vendored
+22
-5
@@ -360,11 +360,11 @@ export function mountChat(root, src, makeHead) {
|
||||
put(snapRow(p, ctx));
|
||||
continue;
|
||||
}
|
||||
if (ev.kind === "review.finished") {
|
||||
if (ev.kind === "review.started" || ev.kind === "review.finished") {
|
||||
const r = p;
|
||||
const button = ctx.reviewButtons.get(r.snapshot_n);
|
||||
if (button) {
|
||||
markFindings(button, findingCount(r));
|
||||
markReview(button, r);
|
||||
}
|
||||
}
|
||||
if (ev.kind === "agent.tool_call" && isSubagentCall(p)) {
|
||||
@@ -717,9 +717,26 @@ function claudeTaskStatus(p, ctx) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
function markFindings(button, n) {
|
||||
replace(button, "review", n > 0 && h("span", { class: "badge", title: `${n} findings` }, n));
|
||||
function markReview(button, r) {
|
||||
const n = findingCount(r);
|
||||
button.classList.toggle("attention", n > 0);
|
||||
if (r.state === "running") {
|
||||
replace(button, "review", h("span", { class: "review-mark spinner", title: "review in progress" }));
|
||||
return;
|
||||
}
|
||||
if (r.state === "failed") {
|
||||
replace(button, "review");
|
||||
return;
|
||||
}
|
||||
if (r.state === "skipped") {
|
||||
replace(button, "review", h("span", { class: "review-mark skipped", title: "skipped: no changes" }, "●"));
|
||||
return;
|
||||
}
|
||||
if (n === 0) {
|
||||
replace(button, "review", h("span", { class: "review-mark clean", title: "no findings" }, "✓"));
|
||||
return;
|
||||
}
|
||||
replace(button, "review", h("span", { class: "badge", title: `${n} findings` }, n));
|
||||
}
|
||||
function snapRow(snap, ctx) {
|
||||
const taskId = ctx.taskId;
|
||||
@@ -855,7 +872,7 @@ function renderEvent(ev, ctx) {
|
||||
return h("div", { class: "note" }, `${ev.actor} set the merge commit title to "${String(p["merge_title"])}" `, when);
|
||||
case "review.finished": {
|
||||
const r = p;
|
||||
const outcome = r.state === "failed" ? `failed: ${r.error}` : reviewCounts(r);
|
||||
const outcome = r.state === "failed" ? `failed: ${r.error}` : r.state === "skipped" ? "skipped: no changes" : reviewCounts(r);
|
||||
return h("div", { class: `note${r.state === "failed" ? " error" : ""}` }, `review of snapshot #${r.snapshot_n}: ${outcome} `, when);
|
||||
}
|
||||
case "task.merge_queued":
|
||||
|
||||
Reference in New Issue
Block a user