mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 23:19:43 +02:00
COD-121 unified session list: welcome list frontend (slice A, unit 2)
Backs the welcome-screen "Resume Conversation" list with the new GET /api/sessions/unified endpoint instead of /api/history/sessions, so it shows the COMPLETE set (live + persisted + non-Claude + closed history) newest-first with richer context, rather than only Claude transcripts. - terminal-ui.js: new _fetchUnifiedSessions(); loadHistorySessions() now uses it. _buildHistoryItem upgraded to the unified shape (kept backward-compatible with the folder-modal's old shape): title = name || firstPrompt || dir; a mode badge + a LIVE badge (sources includes 'live'); timestamp from lastActivityAt (falls back to lastModified); size only when present; detail panel + "View all in this folder" preserved (gated on projectKey). Resume branches: an open live session selects its tab, a closed one resumes. - unified-session-service.ts + endpoint: pass projectKey through the history source so the folder drill-down survives. - styles.css: .history-item-badges / -badge / -badge-live pills. Verified: tsc 0, lint 0, frontend-syntax + public-asset format clean, service tests 13/13 (+projectKey), route tests 4/4. Playwright on an isolated beta: the welcome list renders real items from /api/sessions/unified, and the renderer produces the tab-name title + codex mode badge + visible LIVE badge, omits LIVE on closed items, keeps "View all in folder", and routes resume correctly (open->select tab, closed->resume). Persistent panel + live SSE status are later units.
This commit is contained in:
@@ -29,6 +29,7 @@ export type UnifiedSessionItem = {
|
||||
claudeSessionId?: string;
|
||||
firstPrompt?: string;
|
||||
sizeBytes?: number;
|
||||
projectKey?: string;
|
||||
remote?: boolean;
|
||||
sources: string[];
|
||||
stats?: { memoryMB: number; cpuPercent: number };
|
||||
@@ -76,6 +77,7 @@ export type HistoryInput = {
|
||||
sizeBytes: number;
|
||||
lastModified: string;
|
||||
firstPrompt?: string;
|
||||
projectKey?: string;
|
||||
};
|
||||
|
||||
/** Mux process-stat view. */
|
||||
@@ -147,6 +149,7 @@ export function mergeUnifiedSessions(sources: UnifiedSources): UnifiedSessionIte
|
||||
overwrite(item, 'workingDir', h.workingDir);
|
||||
overwrite(item, 'sizeBytes', h.sizeBytes);
|
||||
overwrite(item, 'firstPrompt', h.firstPrompt);
|
||||
overwrite(item, 'projectKey', h.projectKey);
|
||||
const ms = Date.parse(h.lastModified);
|
||||
if (!Number.isNaN(ms) && item.lastActivityAt === undefined) item.lastActivityAt = ms;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user