iteration_graph
Composes the PhaseHeader and TaskRow molecules with inline
branch-connector helpers to render an iteration as a phased task graph.
const BRANCH_CLOSE_LAST
const BRANCH_CLOSE_LAST: &str = "\u{2570}";╰: starts the closing connector of the last phase, where the graph ends.
const BRANCH_CLOSE_MID
const BRANCH_CLOSE_MID: &str = "\u{251C}";├: starts the closing connector of a phase that has another phase after it.
const BRANCH_DASH
const BRANCH_DASH: &str = "\u{2500}";─: joins the tips of an opening or closing connector.
const BRANCH_OPEN
const BRANCH_OPEN: &str = "\u{251C}";├: starts the opening connector of a phase with more than one task.
const BRANCH_OPEN_TIP
const BRANCH_OPEN_TIP: &str = "\u{256E}";╮: opens one more parallel column in an opening connector.
const CLOSE_TIP
const CLOSE_TIP: &str = "\u{256F}";╯: closes one parallel column in a closing connector.
const CONTINUATION
const CONTINUATION: &str = "\u{2502}";│: the line between one phase and the next.
struct Component
pub struct ComponentPhased dependency graph with box-drawing connectors.
| Field | Type | Description |
|---|---|---|
iteration_title |
String | Title on the graph’s first line. |
tasks |
Vec<GraphTask> | Tasks in any order; the graph groups them by phase, lowest phase first. |
Implements Display.
Component::new
pub fn new(iteration_title: impl Into<String>, tasks: Vec<GraphTask>) -> SelfCreate a graph view for the given iteration title and task list.
| Parameter | Type | Description |
|---|---|---|
iteration_title |
impl Into<String> | the iteration title |
tasks |
Vec<GraphTask> | the tasks to draw; an empty list renders no tasks in this iteration |
| returns | Self | The graph view. |
struct GraphTask
pub struct GraphTaskA task entry for the graph.
| Field | Type | Description |
|---|---|---|
blocked_by |
Vec<String> | Short ids of tasks that block this task. |
id_short |
String | Short ID used to render the task’s highlighted two-tone identifier. |
is_blocking |
bool | True when this task blocks at least one other task. |
phase |
u32 | Phase number used to group tasks under phase headers. |
prefix_len |
usize | Number of highlighted prefix characters for this task’s ID. |
priority |
Option<u8> | Task priority used to render the [Pn] badge. |
status |
String | Task status, used to select the row icon and color. |
title |
String | Task title rendered inside the row. |
fn write_branch_close
fn write_branch_close(f: &mut Formatter<'_>, cols: usize, is_last_phase: bool) -> fmt::ResultWrite the connector that merges a phase’s parallel columns back into one line.
| Parameter | Type | Description |
|---|---|---|
f |
&mut Formatter<'_> | the formatter to write into |
cols |
usize | the number of tasks in the phase; one ─╯ is written for each column after the first |
is_last_phase |
bool | whether the phase ends the graph, which starts the line with ╰ rather than ├ |
| returns | fmt::Result | Ok(()), or the error from writing to f. |
fn write_branch_open
fn write_branch_open(f: &mut Formatter<'_>, cols: usize) -> fmt::ResultWrite the connector that splits a phase into parallel columns, one per task.
| Parameter | Type | Description |
|---|---|---|
f |
&mut Formatter<'_> | the formatter to write into |
cols |
usize | the number of tasks in the phase; one ─╮ is written for each column after the first |
| returns | fmt::Result | Ok(()), or the error from writing to f. |