From 021080d763e2ec28cf67f4f3f549a076e81b3c1f Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Fri, 2 Jan 2026 14:44:54 -0300 Subject: [PATCH] fix: Mark child sections as Completed when all items inside are completed --- src/auto_task/app_generator.rs | 10 ++++++++++ src/tasks/mod.rs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/auto_task/app_generator.rs b/src/auto_task/app_generator.rs index e0bf5c1dc..5d5804694 100644 --- a/src/auto_task/app_generator.rs +++ b/src/auto_task/app_generator.rs @@ -701,6 +701,16 @@ impl AppGenerator { item.duration_seconds = Some((Utc::now() - started).num_seconds() as u64); } child.current_step += 1; + + // Check if all items in child are completed, then mark child as completed + let all_completed = child.items.iter().all(|i| i.status == crate::auto_task::ItemStatus::Completed); + if all_completed && !child.items.is_empty() { + child.status = SectionStatus::Completed; + child.completed_at = Some(Utc::now()); + if let Some(started) = child.started_at { + child.duration_seconds = Some((Utc::now() - started).num_seconds() as u64); + } + } } found = true; break; diff --git a/src/tasks/mod.rs b/src/tasks/mod.rs index fedb7b1e7..72ab8609f 100644 --- a/src/tasks/mod.rs +++ b/src/tasks/mod.rs @@ -922,7 +922,7 @@ fn build_progress_log_from_web_json(manifest: &serde_json::Value) -> String { html } -fn build_status_section_html(manifest: &TaskManifest, title: &str, runtime: &str) -> String { +fn build_status_section_html(manifest: &TaskManifest, _title: &str, runtime: &str) -> String { let mut html = String::new(); let current_action = manifest.current_status.current_action.as_deref().unwrap_or("Processing...");