Add Back to the dashboard to the loop's end screen

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-02 13:23:13 -08:00
1 parent c8d12a3d99
commit 26cb17f04a
10 files changed
+62 -7

No files matched your search

+2 -2
View File
@@ -291,7 +291,7 @@ const goodEnd = (extra = {}) => ({
line: "Stopped at phase 2: a Critical finding was skipped",
phases: [{ n: 1, name: "Setup", commit: "abc1234", unfixed: 0, retries: 0 }],
uncommitted: ["src/x.js"],
can: ["resume", "fix"],
can: ["resume", "fix", "dashboard"],
...extra,
});
const EVIDENCE = { id: "evidence", title: "What happened", blocks: [{ id: "b1", md: "The phase stopped on a skipped Critical." }] };
@@ -313,7 +313,7 @@ test("loopEnd: a valid stopped with an evidence doc in the same patch is stored"
test("loopEnd: an unknown evidence id, a push in can, and the other bad fields are refused, each named", () => {
const cases = [
["an unknown evidence id", goodEnd({ evidence: "nope" }), /loopEnd\.evidence must be the id of a doc on the page/],
["a push in can", goodEnd({ can: ["resume", "push"] }), /loopEnd\.can must be an array with entries from resume, fix, finalize/],
["a push in can", goodEnd({ can: ["resume", "push"] }), /loopEnd\.can must be an array with entries from resume, fix, finalize, dashboard/],
["a bad kind", goodEnd({ kind: "paused" }), /loopEnd\.kind must be "stopped" or "finished"/],
["a two-line line", goodEnd({ line: "one\ntwo" }), /loopEnd\.line must be one line/],
["an absolute uncommitted path", goodEnd({ uncommitted: ["/etc/passwd"] }), /loopEnd\.uncommitted must be an array of relative paths/],
+3 -1
View File
@@ -242,16 +242,18 @@ test("the finish card counts each kind of decision per phase and opens on the fu
line: "All 1 phases built",
phases: [{ n: 2, name: "API", commit: "abc1234", unfixed: 3, retries: 1, fixed: 4, skipped: 2, left: 1, assumed: 5, decisions: 6 }],
uncommitted: [],
can: ["finalize"],
can: ["finalize", "dashboard"],
});
return {
head: [...card.querySelectorAll("th")].map((c) => c.textContent),
row: [...card.querySelectorAll("td")].map((c) => c.textContent),
actions: [...card.querySelectorAll(".loop-end-actions button")].map((b) => b.textContent),
};
});
assert.deepEqual(seen.head, ["Phase", "Commit", "Fixed", "Not fixed", "Left open", "Assumed", "Other decisions", "Retries"]);
assert.deepEqual(seen.row.slice(0, 1), ["Phase 2: API"]);
assert.deepEqual(seen.row.slice(2), ["4", "2", "1", "5", "6", "1"]);
assert.deepEqual(seen.actions, ["Finalize", "Back to the dashboard"], "the way home is offered next to Finalize");
});
// A real loop session: `open --loop` under the app's signal stamps the lock.