diff --git a/src/ui/App.tsx b/src/ui/App.tsx
index 5a00609..fde4e48 100644
--- a/src/ui/App.tsx
+++ b/src/ui/App.tsx
@@ -17,7 +17,8 @@ import { paletteEntries, paletteGroups, pickerGroups, type Picker, type PickerIt
import { pullRequestRepository } from "../model/pullRequests.ts";
import { serverSettingLines, settingRows } from "../model/settings.ts";
import { resetCreditOutcome, usageLimits, usageSummaryLines } from "../model/usage.ts";
-import { buildTimeline, type Timeline } from "../model/timeline.ts";
+import { buildTimeline, liveWorkEntryLabel, type Timeline } from "../model/timeline.ts";
+import { formatWorkingDurationLabel } from "@t3tools/client-runtime/state/models";
import { statusLabel, type Section } from "../model/threads.ts";
import { ComposerMenu } from "./ComposerMenu.tsx";
import { ConfirmBar, type Confirmation } from "./ConfirmBar.tsx";
@@ -33,6 +34,7 @@ import { useThreadMenu } from "./useThreadMenu.ts";
import { editInEditor } from "./editor.ts";
import { Palette } from "./Palette.tsx";
import { ApprovalPanel } from "./ApprovalPanel.tsx";
+import { LiveStatus } from "./LiveStatus.tsx";
import { QuestionPanel } from "./QuestionPanel.tsx";
import { QueuePanel } from "./QueuePanel.tsx";
import { SecretPanel } from "./SecretPanel.tsx";
@@ -254,6 +256,12 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C
const pendingApproval = current?.pending.approvals[0];
const pendingInput = current?.pending.userInputs[0];
const working = current?.isWorking ?? false;
+ // The status line above the composer: the timeline's working/thinking rows live here now.
+ const liveRow = current?.rows.findLast((row) => row.kind === "work-live");
+ const liveTool = liveRow?.kind === "work-live" ? truncate(firstLine(liveWorkEntryLabel(liveRow.entry, threadShell?.worktreePath ?? undefined, liveRow.active)), 60) : null;
+ const liveVerb = current?.rows.some((row) => row.kind === "working" && row.compacting) ? "Compacting" : !liveRow && current?.rows.some((row) => row.kind === "thinking") ? "Thinking" : "Working";
+ const liveSince = current?.workStartedAt ? Date.parse(current.workStartedAt) : NaN;
+ const liveLabel = Number.isFinite(liveSince) ? `${liveVerb} for ${formatWorkingDurationLabel(now - liveSince)}` : `${liveVerb}…`;
// A thread opens at its latest message: once its first snapshot renders, jump to the bottom.
const loaded = current !== null;
@@ -1171,6 +1179,7 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C
) : null}
+ {working && threadId && !draft ? : null}
{threadId || draft ? (
{pendingApproval && !draft ? (
diff --git a/src/ui/LiveStatus.tsx b/src/ui/LiveStatus.tsx
new file mode 100644
index 0000000..dcd3697
--- /dev/null
+++ b/src/ui/LiveStatus.tsx
@@ -0,0 +1,20 @@
+import { useEffect, useState } from "react";
+
+import { SPINNER } from "./ThreadList.tsx";
+import { colors } from "./theme.ts";
+
+/** The one live status line pinned above the composer while a run is active. */
+export function LiveStatus(props: { readonly label: string; readonly tool?: string | null }) {
+ const [spin, setSpin] = useState(0);
+ useEffect(() => {
+ const timer = setInterval(() => setSpin((frame) => frame + 1), 100);
+ return () => clearInterval(timer);
+ }, []);
+ return (
+
+ {SPINNER[spin % SPINNER.length]!}
+ {` ${props.label}`}
+ {props.tool ? {` · ${props.tool}`} : null}
+
+ );
+}
diff --git a/src/ui/ThreadList.tsx b/src/ui/ThreadList.tsx
index 8694031..7655af9 100644
--- a/src/ui/ThreadList.tsx
+++ b/src/ui/ThreadList.tsx
@@ -8,7 +8,8 @@ import { BAR } from "./edges.ts";
import { truncate } from "./text.ts";
import { colors, statusColor } from "./theme.ts";
-const SPINNER = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
+/** The braille spinner's frames, for anything that is working. */
+export const SPINNER = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
/** The 2-column gutter's mark for a row: a spinner while it works, then what it needs from you. */
function statusGlyph(row: ThreadRow, spin: number): { readonly glyph: string; readonly color: string } {
diff --git a/src/ui/ThreadView.tsx b/src/ui/ThreadView.tsx
index 77c5f3f..0a16f54 100644
--- a/src/ui/ThreadView.tsx
+++ b/src/ui/ThreadView.tsx
@@ -1,6 +1,5 @@
import type { MouseEvent, ScrollBoxRenderable } from "@opentui/core";
import type { ThreadId, TurnItemId } from "@t3tools/contracts";
-import { formatWorkingDurationLabel } from "@t3tools/client-runtime/state/models";
import { liveThoughtLine, workEntryDisplayIndicatesToolFailure, type ToolGroupSummaryKind } from "@t3tools/client-runtime/work-log/presentation";
import { memo, useEffect, useState, type RefObject } from "react";
import { findTextSegments } from "../model/search.ts";
@@ -84,8 +83,6 @@ export function ThreadView(props: {
activeOccurrence={props.findMatch?.entryId === row.id ? props.findMatch.occurrence : null}
workspaceRoot={props.workspaceRoot}
footer={assistantFooter(row, timeline, props.timestampFormat, props.now)}
- now={row.kind === "working" ? props.now : 0}
- workStartedAt={timeline.workStartedAt}
onOpenThread={props.onOpenThread}
mouse={props.mouse}
/>
@@ -144,8 +141,7 @@ function Divider({ label, color, onPress }: { readonly label: string; readonly c
/**
* Memoized: computeStableMessagesTimelineRows keeps unchanged rows identical,
- * so a streamed update re-renders only its own rows. `now` is nonzero only for
- * the working row, which ticks.
+ * so a streamed update re-renders only its own rows.
*/
const Row = memo(function Row(props: {
readonly row: MessagesTimelineRow;
@@ -158,8 +154,6 @@ const Row = memo(function Row(props: {
readonly workspaceRoot: string | undefined;
/** The turn footer's text for this row, or "" for none. */
readonly footer: string;
- readonly now: number;
- readonly workStartedAt: string | null;
readonly onOpenThread: (threadId: ThreadId) => void;
readonly mouse: ConversationMouse;
}) {
@@ -219,18 +213,10 @@ const Row = memo(function Row(props: {
);
- case "working": {
- const since = props.workStartedAt ? Date.parse(props.workStartedAt) : NaN;
- const verb = row.compacting ? "Compacting" : "Working";
- return (
-
- ◐
- {Number.isFinite(since) ? ` ${verb} for ${formatWorkingDurationLabel(props.now - since)}` : ` ${verb}…`}
-
- );
- }
+ case "working":
case "thinking":
- return ∴ Thinking…;
+ // The live status line above the composer carries these now.
+ return null;
case "context-compaction":
return ;
case "proposed-plan":
diff --git a/test/app/app.test.tsx b/test/app/app.test.tsx
index f934a3a..474b961 100644
--- a/test/app/app.test.tsx
+++ b/test/app/app.test.tsx
@@ -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() }) });
diff --git a/test/app/fixtures.ts b/test/app/fixtures.ts
index e251b7a..a8b2d57 100644
--- a/test/app/fixtures.ts
+++ b/test/app/fixtures.ts
@@ -130,6 +130,35 @@ export function withCompletedTurn(): OrchestrationV2ThreadProjection {
} as unknown as OrchestrationV2ThreadProjection;
}
+/** A thread mid-run, with a command under way. */
+export function withWorking(): OrchestrationV2ThreadProjection {
+ const base = {
+ threadId: v2Projection.thread.id,
+ runId: "run-1",
+ nodeId: null,
+ providerThreadId: null,
+ providerTurnId: null,
+ nativeItemRef: null,
+ parentItemId: null,
+ title: null,
+ };
+ const turnItems = [
+ { ...base, id: "item-user", ordinal: 0, status: "completed", startedAt: at, completedAt: at, updatedAt: at, type: "user_message", createdBy: "user", creationSource: "web", messageId: "msg-user-1", inputIntent: "turn_start", text: "Run the tests", attachments: [] },
+ { ...base, id: "item-cmd", ordinal: 1, status: "running", startedAt: after(10), completedAt: null, updatedAt: after(10), type: "command_execution", input: "bun test", output: "" },
+ ];
+ return {
+ ...v2Projection,
+ runs: [
+ { id: "run-1", threadId: v2Projection.thread.id, ordinal: 1, providerInstanceId: "codex", modelSelection: { instanceId: "codex", model: "gpt-5.4" }, providerThreadId: null, userMessageId: "msg-user-1", rootNodeId: null, activeAttemptId: null, status: "running", requestedAt: at, startedAt: at, completedAt: null, checkpointId: null, contextHandoffId: null },
+ ],
+ messages: [
+ { createdBy: "user", creationSource: "web", id: "msg-user-1", threadId: v2Projection.thread.id, runId: "run-1", nodeId: null, role: "user", text: "Run the tests", attachments: [], streaming: false, createdAt: at, updatedAt: at },
+ ],
+ turnItems,
+ visibleTurnItems: turnItems.map((item, position) => ({ position, visibility: "local", sourceThreadId: v2Projection.thread.id, sourceItemId: item.id, item })),
+ } as unknown as OrchestrationV2ThreadProjection;
+}
+
export function withOmittedOutput(): OrchestrationV2ThreadProjection {
return {
...v2Projection,