Add the Review Loop: unattended review-and-fix rounds in the desktop app and in loop phases

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-28 21:09:02 -08:00
1 parent d6a28b5dc8
commit 57567d7a0b
71 files changed
+11331 -443

No files matched your search

+21 -11
View File
@@ -30,6 +30,7 @@ import {
SKILL_CATALOG,
catalogEntry,
LOOP_ENTRY,
APP_ONLY_ENTRIES,
OUTSIDE_APP_LINE,
launchVariant,
SPEC_STATE_LABELS,
@@ -296,16 +297,17 @@ export function renderDashboard(main) {
let shown = 0;
for (const g of CATALOG_GROUPS) {
const entries = SKILL_CATALOG.filter((e) => e.group === g.id && (!hide || available(e)));
// The desktop app's Implementation Loop card closes its group. Outside the
// app it is always drawn, grayed, so the feature can be found.
const loopCard = LOOP_ENTRY && LOOP_ENTRY.group === g.id && (!page.inApp || !hide || available(LOOP_ENTRY));
if (!entries.length && !loopCard) continue;
shown += entries.length + (loopCard ? 1 : 0);
// The desktop app's Implementation Loop and Review Loop cards close their
// group. Outside the app they are always drawn, grayed, so the features can
// be found.
const loopCards = APP_ONLY_ENTRIES.filter((e) => e.group === g.id && (!page.inApp || !hide || available(e)));
if (!entries.length && !loopCards.length) continue;
shown += entries.length + loopCards.length;
const section = el("section", "dash-group");
section.appendChild(el("h3", "dash-group-title", g.title));
const grid = el("div", "dash-grid");
for (const e of entries) grid.appendChild(dashCard(e, menu));
if (loopCard) grid.appendChild(dashCard(LOOP_ENTRY, menu));
for (const e of loopCards) grid.appendChild(dashCard(e, menu));
section.appendChild(grid);
wrap.appendChild(section);
}
@@ -752,6 +754,8 @@ async function readHandoff(h) {
}
}
const REVIEW_LOOP_SKILL = "plan2code-review-loop";
function dashCard(entry, menu) {
const presentation = entry.appOnly ? loopPresentation(entry, menu) : cardPresentation(entry, scan(), selSpec(), menu);
// The agent's `recommend` and detail describe the initially selected spec.
@@ -784,6 +788,8 @@ function dashCard(entry, menu) {
title.appendChild(document.createTextNode(entry.title));
b.appendChild(title);
b.appendChild(el("span", "dash-card-blurb", entry.blurb));
// A line only the desktop app shows (the Review card's pointer to the Review Loop).
if (entry.appNote && page.inApp) b.appendChild(el("span", "dash-card-detail", entry.appNote));
if (presentation.detail) b.appendChild(el("span", "dash-card-detail", presentation.detail));
if (!presentation.on && presentation.reason) b.appendChild(el("span", "dash-card-off", presentation.reason));
@@ -793,8 +799,8 @@ function dashCard(entry, menu) {
b.appendChild(foot);
b.addEventListener("click", () => {
// The loop card opens its own setup screen instead of a confirm pane.
if (entry.appOnly) return hooks.openLoopSetup(selSpec());
// A loop card opens its own setup screen instead of a confirm pane.
if (entry.appOnly) return entry.skill === REVIEW_LOOP_SKILL ? hooks.openReviewLoopSetup(selSpec()) : hooks.openLoopSetup(selSpec());
page.dashPick = entry;
redraw();
});
@@ -803,7 +809,7 @@ function dashCard(entry, menu) {
if (entry.appOnly) {
const wrap = el("div", "dash-card-wrap");
wrap.appendChild(b);
wrap.appendChild(loopHelpLink());
wrap.appendChild(loopHelpLink(entry));
return wrap;
}
return b;
@@ -814,13 +820,17 @@ function dashCard(entry, menu) {
// pre-selected: a person opts into running unattended.
function loopPresentation(entry, menu) {
if (!page.inApp) return { on: false, reason: OUTSIDE_APP_LINE, recommended: false, detail: "" };
if (entry.skill === REVIEW_LOOP_SKILL && loopDriving()) {
return { on: false, reason: "A loop is running. Stop it from the banner at the top of the window first.", recommended: false, detail: "" };
}
return { ...cardPresentation(entry, scan(), selSpec(), menu), recommended: false };
}
// "How the loop works" under the card: a real button styled as a link, a
// sibling of the card button inside its wrapper.
function loopHelpLink() {
const a = el("button", "dash-card-link", "How the loop works");
function loopHelpLink(entry) {
const review = entry && entry.skill === REVIEW_LOOP_SKILL;
const a = el("button", "dash-card-link", review ? "How the Review Loop works" : "How the loop works");
a.type = "button";
a.addEventListener("click", () => hooks.openHelpOn("loop"));
return a;