Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/desktop/src/state/recap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* The chat recap: when the user comes back to a chat they have not looked at for a
* while (Settings › General, an hour by default), a card at the top of that chat
* while (Settings › General, an hour by default), a card after its last turn
* says what they asked last, where the reply left off and whether the thread is
* still working, waits on them or failed. It is per chat, like Claude Code's
* recap, and built from the transcript, so it costs no model turn. Pure, so the
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/ui/ChatRecap.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* The chat recap card: back in a chat after it went unseen for a while (Settings ›
* General, an hour by default), a card at the top of that chat says what the user
* General, an hour by default), a card after its last turn says what the user
* asked last, where the reply left off and whether the thread still works, waits on
* them or failed. One chat at a time, like Claude Code's recap; dismissing it puts
* it away until the next return after a gap.
Expand Down Expand Up @@ -108,7 +108,7 @@ const STATE_TONE: Record<RecapState, string> = {
done: "text-success",
};

/** The recap of the chat on screen, floating over the top of its transcript. */
/** The recap of the chat on screen: a row after its last turn (ui/Transcript.tsx). */
export function ChatRecapCard({ threadId, className }: { threadId: string; className?: string }) {
const open = useApp((s) => (s.chatRecaps && s.chatRecap?.threadId === threadId ? s.chatRecap : null));
const items = useApp((s) => s.threads[threadId]?.items);
Expand Down
9 changes: 0 additions & 9 deletions apps/desktop/src/ui/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { overviewExpanded, setOverviewExpanded } from "../state/widgets";
import { AttentionCard, ResolvedApprovalBar } from "./AttentionCards";
import { OriginChip } from "./Branches";
import { NewThreadLight, ThreadLight } from "./ChatLight";
import { ChatRecapCard } from "./ChatRecap";
import { Composer } from "./Composer";
import { DelegateStatusPanel } from "./DelegateStatus";
import {
Expand Down Expand Up @@ -760,14 +759,6 @@ export function ChatView() {
{thread && !isNew && !showsPending && (
<ThreadLight threadId={thread.id} stack={stackRef} stackHeight={stackHeight} />
)}
{thread && !isNew && !showsPending && (
<div
className="rc-lane-inset pointer-events-none absolute z-20 mx-auto max-w-[var(--rc-chat-content-max-width)]"
style={{ top: HEADER_HEIGHT + 8 }}
>
<ChatRecapCard threadId={thread.id} className="pointer-events-auto" />
</div>
)}
{showsPending && setup ? (
// Preferred over the thread: while its message is still arriving, the screen that has it
// is this one, and the row it draws is the row the transcript draws (`FIRST_ROW_PAD`).
Expand Down
8 changes: 8 additions & 0 deletions apps/desktop/src/ui/Transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import { useWaiting, type Waiting, waitingLabel } from "../state/waiting";
import { StartedThreadsRow, SubagentGroupRow, SubagentRow } from "./AgentViews";
import { ApprovalRow, ChildRequestCard } from "./AttentionCards";
import { BranchRow } from "./Branches";
import { ChatRecapCard } from "./ChatRecap";
import { StatusReplyRow } from "./DelegateStatus";
import { EarlierAttempts } from "./EarlierAttempts";
import { ArrowDown, ChevronDown, ChevronUp, RotateCw, Search, X } from "./icons";
Expand Down Expand Up @@ -167,6 +168,8 @@ export type Row = {
leaving?: QueuedPrompt;
/** Resume, under a queue a stopped or failed turn held. */
resume?: { threadId: string; count: number };
/** The chat's recap (ui/ChatRecap.tsx), after the last turn: where the reader comes back in. */
recap?: true;
};

/** The turns the reader opened, by thread: kept while the app runs, so going back keeps them. */
Expand Down Expand Up @@ -468,6 +471,7 @@ export function Transcript({
// skips a streamed chunk (state/fold.ts keepUnchangedRows).
const drawnRows = useRef<Row[]>([]);
const showTools = useApp((s) => s.showToolCalls);
const recapOpen = useApp((s) => !peek && s.chatRecaps && s.chatRecap?.threadId === thread.id);
// The messages that open a day keep their time in view: where a long thread's days begin.
const newDays = useMemo(() => newDayMessages(visible), [visible]);
const rows = useMemo<Row[]>(() => {
Expand Down Expand Up @@ -610,6 +614,7 @@ export function Transcript({
// What waits for the thread comes after all of it: its queued messages, the one quiet line a
// wake turn waits under, and Resume when a stopped or failed turn held them. They scroll with
// the transcript, and the pinned view follows them like any other row.
if (recapOpen) out.push({ key: "recap", recap: true });
out.push(...queueRows(thread, links));
// A steering note the plan does not hold is not drawn again here: the message it was sent as
// already says `Steered` on its own bubble, and one steer reads once.
Expand All @@ -629,6 +634,7 @@ export function Transcript({
settleEnd,
branches,
showTools,
recapOpen,
]);
// Footers of folded turns: their time is in the summary row, not repeated. The turn that just
// finished still counts as folded while its live header holds the place of that summary row.
Expand Down Expand Up @@ -1322,6 +1328,8 @@ export function Transcript({
flat
item={{ kind: "notice", id: row.key, text: row.queueNotice.line, tone: "info" }}
/>
) : row.recap ? (
<ChatRecapCard threadId={thread.id} />
) : row.resume ? (
<ResumeQueueRow threadId={row.resume.threadId} count={row.resume.count} />
) : row.working ? (
Expand Down
Loading