feat(workstate): dette de contrat DTO work-state (frontend)
Aligne le contrat DTO du panneau work-state (#5). - ajout summary: string|null à BackgroundCompletion, mappé depuis task.summary - affichage discret du résumé sur une tâche terminale - suppression du chemin de merge top-level mort des background tasks Tests verts : vitest workstate.test.tsx (21), suite complète (507), npm run build (exit 0). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -104,6 +104,11 @@ function formatTaskStatus(status: BackgroundCompletion["status"]): string {
|
||||
}
|
||||
}
|
||||
|
||||
/** Terminal (finished) task states that carry a result summary (ticket #5). */
|
||||
function isTerminalTaskStatus(status: BackgroundCompletion["status"]): boolean {
|
||||
return status === "completed" || status === "failed" || status === "cancelled";
|
||||
}
|
||||
|
||||
function taskStatusClass(status: BackgroundCompletion["status"]): string {
|
||||
if (status === "running" || status === "pending") return "bg-warning/15 text-warning";
|
||||
if (status === "completed" || status === "delivered") return "bg-success/10 text-success";
|
||||
@ -407,6 +412,15 @@ function BackgroundTaskRow({
|
||||
{shortTicket(task.taskId)}
|
||||
</code>
|
||||
</div>
|
||||
{task.summary && isTerminalTaskStatus(task.status) && (
|
||||
<p
|
||||
aria-label={`task ${shortTicket(task.taskId)} summary`}
|
||||
title={task.summary}
|
||||
className="mt-1 truncate pl-1 text-[11px] text-muted"
|
||||
>
|
||||
{task.summary}
|
||||
</p>
|
||||
)}
|
||||
{message && (
|
||||
<p role="alert" className="mt-1 text-xs text-danger">
|
||||
{message}
|
||||
|
||||
Reference in New Issue
Block a user