Each project is now a single sidebar row with its own icon and color that opens the project's coordinator conversation. The whole row drags to reorder. The row menu gains Customize for name, icon and color. Inside the coordinator conversation, an overview lists the project's agent threads that need the user, are running, or recently finished. Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ Co-authored-by: Claude <noreply@anthropic.com>
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import type { RunActivityRow } from "@rakazo/contracts";
|
|
import { describe, expect, it } from "vitest";
|
|
import { projectThreads } from "./project-threads.js";
|
|
|
|
function run(
|
|
runId: string,
|
|
threadId: string,
|
|
status: RunActivityRow["status"],
|
|
spaceId = "space-1",
|
|
botId = "bot-1",
|
|
): RunActivityRow {
|
|
return {
|
|
runId,
|
|
botId,
|
|
botName: "Researcher",
|
|
groupId: null,
|
|
groupName: null,
|
|
threadId,
|
|
spaceId,
|
|
status,
|
|
trigger: "delegation",
|
|
notificationsEnabled: true,
|
|
promptSnippet: "",
|
|
updatedAt: "2026-10-10T00:00:00.000Z",
|
|
};
|
|
}
|
|
|
|
describe("projectThreads", () => {
|
|
it("sorts a project's threads into needs you, running and done, once each", () => {
|
|
const threads = projectThreads(
|
|
{
|
|
active: [
|
|
run("r1", "t-research", "running"),
|
|
run("r2", "t-design", "queued"),
|
|
run("r3", "t-design", "waiting_input"),
|
|
run("r4", "t-other-space", "running", "space-2"),
|
|
run("r5", "t-chief", "running", "space-1", "chief"),
|
|
],
|
|
recent: [
|
|
run("r6", "t-research", "completed"),
|
|
run("r7", "t-write", "failed"),
|
|
// A specialist that worked inside the coordinator's conversation.
|
|
run("r8", "t-chief", "completed", "space-1", "gardener"),
|
|
],
|
|
},
|
|
{ spaceId: "space-1", coordinator: { threadId: "t-chief", botId: "chief" } },
|
|
);
|
|
expect(threads.needsYou.map((item) => item.runId)).toEqual(["r3"]);
|
|
expect(threads.running.map((item) => item.runId)).toEqual(["r1"]);
|
|
expect(threads.done.map((item) => item.runId)).toEqual(["r7", "r8"]);
|
|
});
|
|
});
|