Navigate to snapshots from the transcript

This commit is contained in:
Ian Gulliver
2026-10-15 00:08:32 -07:00
parent 75c76eff0a
commit c778741a4a
23 changed files with 763 additions and 202 deletions
+9
View File
@@ -8,6 +8,7 @@ export const state = {
selectedTaskId: undefined,
transcript: [],
lastTranscriptSeq: 0,
pinned: undefined,
connected: false,
};
const listeners = new Map();
@@ -48,6 +49,13 @@ export function findTask(id) {
export function currentSession(taskId) {
return state.sessions.get(taskId)?.findLast((s) => s.state !== "completed") ?? state.sessions.get(taskId)?.at(-1);
}
export function snapshots() {
return state.transcript.filter((e) => e.kind === "snapshot.created").map((e) => e.payload);
}
export function pinSnapshot(n) {
state.pinned = n;
notify("pin");
}
export async function loadMe() {
state.me = await get("/api/me");
notify("me");
@@ -95,6 +103,7 @@ export function selectTask(taskId) {
state.selectedTaskId = taskId;
state.transcript = [];
state.lastTranscriptSeq = 0;
state.pinned = undefined;
notify("selection");
if (!taskId) {
return;