Start the folded to-do list two steps before the current one

This commit is contained in:
Callum Alpass committed 2026-11-03 01:51:16 +11:00
1 parent 46e0588359
commit 24d25bb8ff
1 file changed
+2 -2
+2 -2
View File
@@ -276,8 +276,8 @@ function latestTasks(projection: OrchestrationV2ThreadProjection | null): Tasks
const steps = item.steps; const steps = item.steps;
const running = steps.findIndex((step) => step.status === "running"); const running = steps.findIndex((step) => step.status === "running");
const current = running >= 0 ? running : Math.max(0, steps.findIndex((step) => step.status === "pending")); const current = running >= 0 ? running : Math.max(0, steps.findIndex((step) => step.status === "pending"));
// One more step than fits would fold into "1 more"; show it instead. // Two finished steps lead into the current one; one more step than fits shows rather than folds.
const start = Math.max(0, Math.min(current - 1, steps.length - MAX_TASKS)); const start = Math.max(0, Math.min(current - 2, steps.length - MAX_TASKS));
return { return {
done: steps.filter((step) => step.status === "completed").length, done: steps.filter((step) => step.status === "completed").length,
total: steps.length, total: steps.length,