Track fixed and ignored review findings
This commit is contained in:
Vendored
+6
-6
@@ -2,7 +2,7 @@ import { get, post } from "./api.js";
|
||||
import { ago, copyable, errorText, h, replace, showAlert, showConfirm } from "./dom.js";
|
||||
import { markdown } from "./markdown.js";
|
||||
import { previewURL } from "./preview.js";
|
||||
import { findingCount, reviewCounts } from "./reviews.js";
|
||||
import { findingCount, reviewCounts, severityCounts, unignoredFindings } from "./reviews.js";
|
||||
import { composerText, endSend, flushDrafts, forgetLostImages, lostImageCount, setComposerImages, setComposerText, startSend } from "./drafts.js";
|
||||
import { currentSession, findTask, focusTab, focusTask, on, onEach, pickReview, pinSnapshot, setFocus, showReview, state } from "./state.js";
|
||||
import { taskStyle } from "./taskcolor.js";
|
||||
@@ -377,7 +377,7 @@ export function mountChat(root, src, makeHead) {
|
||||
put(snapRow(p, ctx));
|
||||
continue;
|
||||
}
|
||||
if (ev.kind === "review.started" || ev.kind === "review.finished") {
|
||||
if (ev.kind === "review.started" || ev.kind === "review.finished" || ev.kind === "review.finding") {
|
||||
const r = p;
|
||||
const button = ctx.reviewButtons.get(r.snapshot_n);
|
||||
if (button) {
|
||||
@@ -797,10 +797,10 @@ function markReview(button, r) {
|
||||
return;
|
||||
}
|
||||
if (n === 0) {
|
||||
replace(button, "review", h("span", { class: "review-mark clean", title: "no findings" }, "✓"));
|
||||
replace(button, "review", h("span", { class: "review-mark clean", title: Object.keys(r.finding_states).length > 0 ? "every finding addressed" : "no findings" }, "✓"));
|
||||
return;
|
||||
}
|
||||
replace(button, "review", h("span", { class: "badge", title: `${n} findings` }, n));
|
||||
replace(button, "review", h("span", { class: "badge", title: `${n} open findings` }, n));
|
||||
}
|
||||
function snapRow(snap, ctx) {
|
||||
const taskId = ctx.taskId;
|
||||
@@ -1142,8 +1142,8 @@ async function reviewWarnings(taskId, leave) {
|
||||
else if (r.state === "failed") {
|
||||
items.push(mergeWarning("Review of the latest snapshot failed", open));
|
||||
}
|
||||
else if (findingCount(r) > 0) {
|
||||
items.push(mergeWarning(`Review of the latest snapshot found ${reviewCounts(r)}`, open));
|
||||
else if (unignoredFindings(r).length > 0) {
|
||||
items.push(mergeWarning(`Review of the latest snapshot found ${severityCounts(unignoredFindings(r))}`, open));
|
||||
}
|
||||
const changes = await get("/api/tasks/{taskId}/changes", { path: { taskId }, query: { since: latest.commit_sha } });
|
||||
if (changes.files.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user