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
+22 -5
View File
@@ -439,11 +439,11 @@ export function mountChat(root: HTMLElement, src: ChatSource, makeHead: (rerende
put(snapRow(p as unknown as Snapshot, ctx));
continue;
}
if (ev.kind === "review.finished") {
if (ev.kind === "review.started" || ev.kind === "review.finished") {
const r = p as unknown as Review;
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)) {
@@ -846,9 +846,26 @@ function claudeTaskStatus(p: Record<string, unknown>, ctx: Ctx): void {
}
}
function markFindings(button: HTMLElement, n: number): void {
replace(button, "review", n > 0 && h("span", { class: "badge", title: `${n} findings` }, n));
function markReview(button: HTMLElement, r: Review): void {
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: Snapshot, ctx: Ctx): HTMLElement {
@@ -1015,7 +1032,7 @@ function renderEvent(ev: ByreEvent, ctx: Ctx): HTMLElement | null {
case "review.finished": {
const r = p as unknown as Review;
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);
}