merge a /clear chain into one conversation
The list collapses each chain to its newest link — the only one that can be resumed — carrying the root's title and start time, the summed message count and a part badge. The detail splices the chain's transcripts oldest-first with a divider between parts, server-side, so the client's index-window pagination needed no change. The divider says "context cleared — nothing above this is in memory", because the whole risk of merging is that the history reads as continuous when the agent's context is not. Delete cascades the chain and the confirm says how many. Supersedes the "continues X" line from the previous commit: there is nowhere to link to once the parent is scrolled up above you. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,11 +19,16 @@ export type ClaudeSessionSummary = {
|
||||
/** This conversation was opened by `/clear`ing another one. */
|
||||
bornFromClear?: boolean;
|
||||
/**
|
||||
* The conversation this one continues, when the server could identify it. Absent means either not a
|
||||
* continuation or a continuation whose parent could not be named with confidence — the two are
|
||||
* deliberately indistinguishable here, because a guess is worth nothing to the reader.
|
||||
* The conversation this one continues, when the server could identify it. Always absent on a listed
|
||||
* row — the list merges a chain into one row, so there is no earlier row left to point at. It still
|
||||
* carries the inference that made the merge possible.
|
||||
*/
|
||||
continuedFrom?: ClaudeSessionOrigin | null;
|
||||
/**
|
||||
* Transcripts behind this row. `> 1` means a `/clear` chain the server has merged into one
|
||||
* conversation; absent or 1 is the ordinary case.
|
||||
*/
|
||||
partCount?: number;
|
||||
};
|
||||
|
||||
// Display-ready message, matching the frontend ChatMessage union (rebuilt from Claude's transcript).
|
||||
@@ -37,7 +42,9 @@ export type ClaudeSessionMessage =
|
||||
toolCallId: string;
|
||||
output?: string;
|
||||
isError?: boolean;
|
||||
};
|
||||
}
|
||||
/** The seam between two parts of a merged `/clear` chain. `sessionId` is the part that ends there. */
|
||||
| { role: 'divider'; sessionId: string };
|
||||
|
||||
export type ClaudeSessionDetail = {
|
||||
id: string;
|
||||
@@ -48,8 +55,8 @@ export type ClaudeSessionDetail = {
|
||||
offset: number; // absolute index of messages[0]; older messages remain above when > 0
|
||||
/** The title the list shows this session under, so the open conversation is labelled the same way. */
|
||||
title?: string | null;
|
||||
/** The conversation this one continues, if any — so an open chat can link back to what preceded it. */
|
||||
continuedFrom?: ClaudeSessionOrigin | null;
|
||||
/** Transcripts spliced into `messages` — `> 1` when this is a merged `/clear` chain. */
|
||||
partCount?: number;
|
||||
};
|
||||
|
||||
export type ClaudePwd = { cwd: string; sessionCount: number; updatedAt: string; isDefault: boolean };
|
||||
|
||||
Reference in New Issue
Block a user