From bb6d67ec1b8ceb860ff32a75dc717693b8da9ea3 Mon Sep 17 00:00:00 2001 From: Callum Alpass Date: Tue, 3 Nov 2026 00:52:35 +1100 Subject: [PATCH] Live status pinned above the composer --- src/ui/App.tsx | 11 ++++++++++- src/ui/LiveStatus.tsx | 20 ++++++++++++++++++++ src/ui/ThreadList.tsx | 3 ++- src/ui/ThreadView.tsx | 22 ++++------------------ test/app/app.test.tsx | 19 ++++++++++++++++++- test/app/fixtures.ts | 29 +++++++++++++++++++++++++++++ 6 files changed, 83 insertions(+), 21 deletions(-) create mode 100644 src/ui/LiveStatus.tsx 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