S3.8: office people show real agent state: running, queued, cooling down, blocked or idle, from sessions, task holds and pending approvals
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
202418f81c
commit
ccd698602e
15 files changed
+164
-69
No files matched your search
@@ -154,7 +154,8 @@ test("the list width, office people and chart values all work from the keyboard
|
||||
await page.getByRole("button", { name: "Office", exact: true }).click();
|
||||
await expect(page.getByRole("img", { name: /People here: 1./ })).toBeVisible();
|
||||
const people = page.getByRole("combobox", { name: "Show a person" });
|
||||
await people.selectOption({ label: "CEO, Idle" });
|
||||
// The only person is the CEO, listed after the empty choice with whatever state their real work gives them.
|
||||
await people.selectOption({ index: 1 });
|
||||
await expect(page.getByRole("dialog", { name: "Agent CEO" })).toBeVisible();
|
||||
await people.selectOption({ label: "Show a person…" });
|
||||
await expect(page.getByRole("dialog", { name: "Agent CEO" })).toHaveCount(0);
|
||||
|
||||
@@ -3,6 +3,7 @@ import { mkdirSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { DatabaseSync } from "node:sqlite";
|
||||
import { buildFloorPlan } from "../../src/renderer/src/pages/office/floor-plan";
|
||||
import { cameraFor } from "../../src/renderer/src/pages/office/simulation";
|
||||
import { isoFrame, isoPixelSize, toIso } from "../../src/renderer/src/pages/office/iso";
|
||||
@@ -78,6 +79,21 @@ test("the office floor opens agent details on click", async () => {
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(card).not.toBeVisible();
|
||||
|
||||
// The office shows real state: a blocked task makes its agent blocked, with the reason on the card.
|
||||
const db = new DatabaseSync(join(profileDir, "agentcompany.db"));
|
||||
const blocked = db.prepare("update tasks set blocked_reason = 'needs the staging key' where assignee_agent_id = (select id from agents where name = 'CEO') and status <> 'done'").run();
|
||||
db.close();
|
||||
expect(blocked.changes).toBeGreaterThan(0);
|
||||
await app.evaluate(({ BrowserWindow }) => {
|
||||
BrowserWindow.getAllWindows()[0]!.webContents.send("agentcompany:renderer-event", { type: "snapshot-changed", version: Number.MAX_SAFE_INTEGER });
|
||||
});
|
||||
await expect(page.getByLabel("Show a person").locator("option", { hasText: "CEO, Blocked" })).toHaveCount(1);
|
||||
await page.getByLabel("Show a person").selectOption({ label: "CEO, Blocked" });
|
||||
await expect(card.getByText("Blocked: needs the staging key")).toBeVisible();
|
||||
await expect(card.getByText("Waiting on you.")).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(card).not.toBeVisible();
|
||||
|
||||
// Clicking empty corridor floor selects nothing.
|
||||
const corridor = onScreen(plan, box!, ratio, { x: 500, y: 320 }, 0);
|
||||
await page.mouse.click(corridor.x, corridor.y);
|
||||
|
||||
Reference in new issue
Block a user