Skip to main content

opendev_runtime/todo/
item.rs

1use serde::{Deserialize, Serialize};
2
3use super::TodoStatus;
4
5/// A sub-step within a parent todo item.
6///
7/// Sub-todos are informational guidance for the LLM — they appear in
8/// `format_status` output but are NOT displayed in the TUI todo panel.
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct SubTodoItem {
11    /// Sub-step title text.
12    pub title: String,
13}
14
15/// A single todo item derived from a plan step.
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct TodoItem {
18    /// Unique ID within the todo list (1-based index).
19    pub id: usize,
20    /// Short title (the plan step text).
21    pub title: String,
22    /// Current status.
23    pub status: TodoStatus,
24    /// Present continuous text for spinner display (e.g., "Running tests").
25    #[serde(default)]
26    pub active_form: String,
27    /// Completion notes / log entry.
28    #[serde(default)]
29    pub log: String,
30    /// When the item was created.
31    pub created_at: String,
32    /// When the status last changed.
33    pub updated_at: String,
34    /// Sub-steps for this todo (hidden from UI, shown in LLM status output).
35    #[serde(default)]
36    pub children: Vec<SubTodoItem>,
37}