{/* Top Header: Bot info + Live Status Badge */}
{running ? (
) : isInterrupted ? (
) : (
)}
{botName}
{botRole}
{/* Right Status Badge */}
{running ? (
{t`In Bearbeitung`}
{liveElapsed ? · {liveElapsed} : null}
) : isInterrupted ? (
{t`Unterbrochen`}
{durationText ? (
· {durationText}
) : null}
{onRestart ? (
) : null}
) : (
{t`Abgeschlossen`}
{durationText ? (
· {durationText}
) : null}
)}
{/* Task / Objective Brief (only while running or interrupted to avoid repeating user bubble above completed answers) */}
{taskTitle && status !== "completed" ? (
Aufgabe
{taskTitle}
) : null}
{/* Live Action or Latest Finding Preview */}
{running ? (
{stepCount > 0 ? (
Schritt {stepCount + 1}
) : (
Initialisiere…
)}
{activeAction || t`Analysiert die Aufgabe und führt Tools aus…`}
{/* Subtle animated activity track */}
) : latestFinding && !open ? (
Letzter Stand:
{latestFinding}
) : null}
{/* Tools badges + Accordion toggle */}
{previewBadges.map((badge, idx) => (
{badge.icon}
{badge.label}
{badge.count > 1 ? ({badge.count}) : null}
))}
{previewBadges.length === 0 && stepCount > 0 ? (
) : null}
{stepCount > 0 ? (
) : null}
{/* Expanded Step Timeline */}
{open && stepCount > 0 ? (
{steps.map((step, stepIndex) => {
const meta = detectStepMeta(step);
return (
-
{String(stepIndex + 1).padStart(2, "0")}
{meta.icon}
{step.blocks.map((block, index) =>
block.kind === "text" ? (
{block.text}
) : null,
)}
);
})}
) : null}
);
}
/** A run's earlier step messages, folded behind an interactive milestone card. */
export function RunSteps({
steps,
bot,
taskTitle,
status = "completed",
onRestart,
restarting = false,
}: {
steps: readonly ThreadMessage[];
bot?: JobProgressCardProps["bot"];
taskTitle?: string | null;
status?: "running" | "completed" | "interrupted" | "waiting";
onRestart?: () => void | Promise