Fix étape status: derive from child tasks instead of stored field

The étape's own status field was not reflecting actual progress. Now the displayed status is computed from child tasks: all done = Terminé, some done = En cours, none done = À faire.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arthur Belleville 2026-02-22 09:34:46 +01:00
parent bf9cabe710
commit 3f97478977
No known key found for this signature in database

View file

@ -513,7 +513,17 @@ function EtapesSection({
const totalCount = childTasks.length;
const progressPct = totalCount > 0 ? Math.round((doneCount / totalCount) * 100) : 0;
const isExpanded = expandedEtapes.has(etape.id);
const status = statusConfig[etape.status] ?? statusConfig.todo;
// Derive status from child tasks instead of etape.status
const derivedStatus =
totalCount === 0
? "todo"
: doneCount === totalCount
? "done"
: doneCount > 0
? "in_progress"
: "todo";
const status = statusConfig[derivedStatus] ?? statusConfig.todo;
return (
<div