feat(coding-agent): threaded sort mode and compact format for /resume (#1124)

Adds 'Threaded' as a new sort mode (now default) that displays sessions
in a tree structure based on parent-child relationships. Compact one-line
format with message count and age right-aligned for clean title alignment.

Closes #1108
This commit is contained in:
Mario Zechner 2026-02-01 01:10:58 +01:00
commit 6e4508f129
4 changed files with 171 additions and 53 deletions

View file

@ -168,6 +168,8 @@ export interface SessionInfo {
cwd: string;
/** User-defined display name from session_info entries. */
name?: string;
/** Path to the parent session (if this session was forked). */
parentSessionPath?: string;
created: Date;
modified: Date;
messageCount: number;
@ -587,6 +589,7 @@ async function buildSessionInfo(filePath: string): Promise<SessionInfo | null> {
}
const cwd = typeof (header as SessionHeader).cwd === "string" ? (header as SessionHeader).cwd : "";
const parentSessionPath = (header as SessionHeader).parentSession;
const modified = getSessionModifiedDate(entries, header as SessionHeader, stats.mtime);
@ -595,6 +598,7 @@ async function buildSessionInfo(filePath: string): Promise<SessionInfo | null> {
id: (header as SessionHeader).id,
cwd,
name,
parentSessionPath,
created: new Date((header as SessionHeader).timestamp),
modified,
messageCount,