Live status pinned above the composer

This commit is contained in:
Callum Alpass committed 2026-11-03 00:52:35 +11:00
1 parent 3a7c183e1c
commit bb6d67ec1b
6 files changed
+83 -21

No files matched your search

+18 -1
View File
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from "bun:test";
import { omittedCommand, withApproval, withCompletedTurn, withOmittedOutput, withQuestion } from "./fixtures.ts";
import { omittedCommand, withApproval, withCompletedTurn, withOmittedOutput, withQuestion, withWorking } from "./fixtures.ts";
import { loadLayout } from "../../src/layout.ts";
import { fakeSession, renderApp, v2ThreadId } from "./harness.tsx";
@@ -163,6 +163,23 @@ describe("a finished turn", () => {
});
});
describe("live status", () => {
test("while working, one status line sits above the composer and none in the timeline", async () => {
const app = await open({ session: fakeSession({ projection: withWorking() }) });
const frame = app.frame();
expect(frame).toMatch(/[⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏] Working for /);
expect(frame.split("Working for")).toHaveLength(2);
expect(frame).not.toContain("◐");
const lines = frame.split("\n");
const status = lines.findIndex((line) => line.includes("Working for"));
const composer = lines.findIndex((line) => line.includes("Press i to type"));
expect(status).toBeGreaterThan(-1);
expect(status).toBeLessThan(composer);
// The live tool itself stays a timeline row.
expect(frame).toContain("Running bun");
});
});
describe("approvals", () => {
test("the request shows in the composer's place, with its buttons, and not in the timeline", async () => {
const app = await open({ session: fakeSession({ projection: withApproval() }) });