Skip to main content

ras_agent/application/
render_plan.rs

1use crate::domain::agent_output::PlanItem;
2
3#[must_use]
4pub fn render_plan(plan: &[PlanItem], current: Option<u32>) -> String {
5    if plan.is_empty() {
6        return String::new();
7    }
8    let mut out = String::from("Plan:\n");
9    for item in plan {
10        let marker = if item.completed {
11            "[x]"
12        } else if Some(item.step) == current {
13            "[>]"
14        } else {
15            "[ ]"
16        };
17        out.push_str(&format!(
18            "  {marker} {} - {}\n",
19            item.step, item.description
20        ));
21    }
22    out
23}