Q156: approval history pages back and opens each decision in full

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 02:01:21 -04:00
1 parent 41359e268a
commit 71ac5085cd
12 files changed
+243 -130

No files matched your search

+7
View File
@@ -132,6 +132,13 @@ test("the pinned CEO conversation is the Messages front door", async () => {
await expect(page.getByText("Renew the domain")).toBeVisible();
await page.getByRole("button", { name: "Approve all low risk" }).click();
await expect(page.getByRole("status").filter({ hasText: "Approved" })).toContainText("Approved 2 of 2.");
// A decided request can be reopened in full: what was asked, the notes, who decided and when.
await page.getByRole("button", { name: "View record of Order stickers" }).click();
const record = page.getByRole("dialog", { name: "Record of Order stickers" });
await expect(record).toContainText("Small spend.");
await expect(record).toContainText("No notes");
await expect(record).toContainText("Yang");
await record.getByRole("button", { name: "Close" }).click();
await page.getByRole("button", { name: "Work" }).click();
await page.getByRole("button", { name: /Operationalize goal: Ship the FlowPilot MVP\./ }).first().click();
// Blocking says why on the task and stops it; work can also move backwards.
+7 -3
View File
@@ -5,11 +5,15 @@ describe("the decided approvals list", () => {
const decided = Array.from({ length: 30 }, (_, index) => ({ id: `apr_${index}` }));
test("shows the newest 24", () => {
expect(decidedWindow(decided, null).map((item) => item.id)).toEqual(decided.slice(0, 24).map((item) => item.id));
expect(decidedWindow(decided, null, 24).map((item) => item.id)).toEqual(decided.slice(0, 24).map((item) => item.id));
});
test("adds an older focused approval so a link to it lands on it", () => {
expect(decidedWindow(decided, "apr_27").map((item) => item.id)).toEqual([...decided.slice(0, 24).map((item) => item.id), "apr_27"]);
expect(decidedWindow(decided, "apr_3")).toHaveLength(24);
expect(decidedWindow(decided, "apr_27", 24).map((item) => item.id)).toEqual([...decided.slice(0, 24).map((item) => item.id), "apr_27"]);
expect(decidedWindow(decided, "apr_3", 24)).toHaveLength(24);
});
test("pages further back on request", () => {
expect(decidedWindow(decided, null, 48).map((item) => item.id)).toEqual(decided.map((item) => item.id));
});
});
+6 -3
View File
@@ -99,14 +99,17 @@ describe("execution modes", () => {
expect(db.prepare("select title, content from documents where org_id = ?").all(h.orgId)).toEqual([{ title: "Launch memo", content: "Ship it." }]);
// Each approval pins what was approved; content changed or removed later, even outside the app, shows against it.
expect(approvalDrifts(db, h.orgId)).toEqual({});
const [fileReview, docReview] = reviews.map((review) => review.id);
const checked = [fileReview, docReview];
expect(approvalDrifts(db, h.orgId, checked)).toEqual({});
writeFileSync(join(root, "plan", "business-plan.md"), "# Edited by hand");
expect(approvalDrifts(db, h.orgId)).toEqual({ [fileReview]: "changed" });
expect(approvalDrifts(db, h.orgId, checked)).toEqual({ [fileReview]: "changed" });
// Only the requests asked about are checked, so any record on screen, however old, gets its own answer.
expect(approvalDrifts(db, h.orgId, [docReview])).toEqual({});
rmSync(join(root, "plan", "business-plan.md"));
const docId = (db.prepare("select id from documents where org_id = ?").get(h.orgId) as { id: string }).id;
h.connection.transaction(() => new DocumentService(db).update({ orgId: h.orgId, documentId: docId, title: "Launch memo", content: "Ship it later.", status: "draft", reason: "edit", changedByType: "employee", changedById: employeeId }));
expect(approvalDrifts(db, h.orgId)).toEqual({ [fileReview]: "removed", [docReview]: "changed" });
expect(approvalDrifts(db, h.orgId, checked)).toEqual({ [fileReview]: "removed", [docReview]: "changed" });
});
test("a declined deliverable is never written, and held work keeps its task open", () => {