Happy review
This commit is contained in:
Vendored
+2
@@ -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) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
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":
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+8
-3
@@ -942,12 +942,17 @@ export interface components {
|
||||
id: string;
|
||||
task_id: string;
|
||||
snapshot_n: number;
|
||||
/** @description The reviewer's session. */
|
||||
/** @description The reviewer's session; empty when skipped. */
|
||||
agent_session_id: string;
|
||||
/** @description Empty when skipped. */
|
||||
vendor: string;
|
||||
/** @description Empty when skipped. */
|
||||
model: string;
|
||||
/** @enum {string} */
|
||||
state: "running" | "done" | "failed";
|
||||
/**
|
||||
* @description skipped: the snapshot's step changed no files, so no reviewer ran.
|
||||
* @enum {string}
|
||||
*/
|
||||
state: "running" | "done" | "failed" | "skipped";
|
||||
/** @description done: the reviewer's submit_review arguments: summary (Markdown) and findings, each with severity, category, title, detail, path and line. */
|
||||
result?: Record<string, never>;
|
||||
/** @description failed: why. */
|
||||
|
||||
@@ -40,6 +40,8 @@ function stateText(r: Review): string {
|
||||
return reviewCounts(r);
|
||||
case "failed":
|
||||
return "failed";
|
||||
case "skipped":
|
||||
return "skipped: no changes";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-5
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -957,6 +957,32 @@ button.compact.danger {
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.snap-row button .review-mark {
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
right: -7px;
|
||||
}
|
||||
|
||||
.snap-row button .review-mark.spinner {
|
||||
margin: 0;
|
||||
background: var(--muted);
|
||||
}
|
||||
|
||||
.snap-row button .review-mark.clean,
|
||||
.snap-row button .review-mark.skipped {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.snap-row button .review-mark.clean {
|
||||
color: var(--ok);
|
||||
}
|
||||
|
||||
.snap-row button .review-mark.skipped {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.note.ask {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user