Live status pinned above the composer
This commit is contained in:
1 parent
3a7c183e1c
commit
bb6d67ec1b
6 files changed
+83
-21
No files matched your search
+10
-1
@@ -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
|
||||
<Button label="+ file" shortcut="a" onPress={attach.attachFile} />
|
||||
</box>
|
||||
) : null}
|
||||
{working && threadId && !draft ? <LiveStatus label={liveLabel} tool={liveTool} /> : null}
|
||||
{threadId || draft ? (
|
||||
<box flexDirection="column" flexShrink={0} marginTop={1} marginLeft={1} marginRight={1}>
|
||||
{pendingApproval && !draft ? (
|
||||
|
||||
Reference in new issue
Block a user