Add Fetch Request pipeline UI with real-time SSEs #8

Merged
aetos merged 16 commits from ai/fetch-request-steps-ui into fetch-request-steps-ui 2026-05-30 15:58:49 +00:00
Showing only changes of commit baffd11a49 - Show all commits

View File

@@ -65,7 +65,7 @@ function statusToActiveStep(status: FetchRequestStatus): number {
case "paused": return 2;
case "raw_expenses_done": return 2;
case "enriched_done": return 3;
case "completed": return 4;
case "completed": return stepLabels.length;
case "failed": return 0;
default: return -1;
}
@@ -110,17 +110,15 @@ export default function FetchRequestDetail() {
const dicts = source?.txn_dicts ?? [];
const blockCount = typeof blocks === "object"
? Object.keys(blocks).length : Array.isArray(blocks) ? blocks.length : 0;
if (blockCount || dicts.length) {
const parts: string[] = [];
if (blockCount) parts.push(`${blockCount} blocks`);
if (dicts.length) parts.push(`${dicts.length} dicts`);
msgs[1] = parts.join(" · ");
}
if (blockCount)
msgs[1] = `${blockCount} blocks`;
if (dicts.length)
msgs[2] = `${dicts.length} dicts`;
if (["enriched_done", "completed"].includes((fetchRequest as any)?.status))
msgs[2] = "done";
msgs[3] = "done";
if ((fetchRequest as any)?.status === "completed")
msgs[3] = (fetchRequest as any)?.completed_at
msgs[4] = (fetchRequest as any)?.completed_at
? new Date((fetchRequest as any).completed_at).toLocaleString() : "done";
return msgs;