Happy review

This commit is contained in:
Ian Gulliver
2026-10-15 20:07:36 -07:00
parent ccd55afe13
commit 35368242e3
14 changed files with 312 additions and 191 deletions
+2
View File
@@ -31,6 +31,8 @@ function stateText(r) {
return reviewCounts(r);
case "failed":
return "failed";
case "skipped":
return "skipped: no changes";
}
}
export function reviewCard(r, taskId) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+22 -5
View File
@@ -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":
+1 -1
View File
File diff suppressed because one or more lines are too long