Match T3 Code's sidebar, timeline and composer

Reuse the web app's timeline derivation (turn folds, work groups, live
work), its sidebar sections and status words, steer-by-default sending,
the question panel, decline-with-feedback, and visit/read marking.
This commit is contained in:
Callum Alpass committed 2026-11-02 17:35:56 +11:00
1 parent 4f42407099
commit 2dac4763d2
17 files changed
+988 -430

No files matched your search

+26 -3
View File
@@ -19,12 +19,35 @@ const isCommand = Schema.is(OrchestrationV2Command);
const threadId = ThreadId.make("thread-1");
describe("commands tui3 dispatches", () => {
test("a queued message is a valid message.dispatch", async () => {
test("messages dispatch like the web composer: auto, steer or queue", async () => {
const { session, sent } = capturingSession();
await session.sendMessage(threadId, "hello");
expect(sent).toHaveLength(1);
await session.sendMessage(threadId, "change course", "steer");
await session.sendMessage(threadId, "after that", "queue");
expect(sent.every(isCommand)).toBe(true);
expect(sent[0]).toMatchObject({ type: "message.dispatch", threadId, text: "hello", dispatchMode: { type: "start_immediately" }, deliveryIntent: "auto" });
expect(sent[1]).toMatchObject({ dispatchMode: { type: "start_immediately" }, deliveryIntent: "steer" });
expect(sent[2]).toMatchObject({ dispatchMode: { type: "queue_after_active" } });
expect(sent[2]).not.toHaveProperty("deliveryIntent");
});
test("declining with feedback, answering and dismissing questions are valid", async () => {
const { session, sent } = capturingSession();
const requestId = RuntimeRequestId.make("req-1");
await session.respond(threadId, requestId, "decline", "use the staging bucket");
await session.answer(threadId, requestId, { q1: "yes", q2: ["a", "b"] });
await session.dismissQuestion(threadId, requestId);
expect(sent.every(isCommand)).toBe(true);
expect(sent[0]).toMatchObject({ decision: "decline", feedback: "use the staging bucket" });
expect(sent[1]).toMatchObject({ type: "runtime-request.respond", answers: { q1: "yes", q2: ["a", "b"] } });
expect(sent[2]).toMatchObject({ type: "thread.user-input.dismiss" });
});
test("a visit is a valid thread.visit", async () => {
const { session, sent } = capturingSession();
await session.visit(threadId);
expect(isCommand(sent[0])).toBe(true);
expect(sent[0]).toMatchObject({ type: "message.dispatch", threadId, text: "hello", dispatchMode: { type: "queue_after_active" } });
expect(sent[0]).toMatchObject({ type: "thread.visit", threadId, opened: true });
});
test("an approval is a valid runtime-request.respond", async () => {