huskies: merge 944
This commit is contained in:
@@ -92,9 +92,20 @@ struct WorkItemContentResponse {
|
||||
|
||||
impl From<WorkItemContent> for WorkItemContentResponse {
|
||||
fn from(w: WorkItemContent) -> Self {
|
||||
use crate::pipeline_state::Stage;
|
||||
// Frozen items report "frozen" so the UI can render them distinctly;
|
||||
// otherwise we emit the canonical clean stage directory name.
|
||||
let stage = if w.frozen {
|
||||
"frozen".to_string()
|
||||
} else {
|
||||
match &w.stage {
|
||||
Stage::Coding => "current".to_string(),
|
||||
other => other.dir_name().to_string(),
|
||||
}
|
||||
};
|
||||
Self {
|
||||
content: w.content,
|
||||
stage: w.stage,
|
||||
stage,
|
||||
name: w.name,
|
||||
agent: w.agent,
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ pub(crate) fn tool_show_epic(args: &Value, _ctx: &AppContext) -> Result<String,
|
||||
// Find member items.
|
||||
let all_items = crate::pipeline_state::read_all_typed();
|
||||
let mut member_items: Vec<Value> = Vec::new();
|
||||
let mut done = 0usize;
|
||||
for item in &all_items {
|
||||
let sid = &item.story_id.0;
|
||||
let Some(member_view) = crate::crdt_state::read_item(sid) else {
|
||||
@@ -141,6 +142,9 @@ pub(crate) fn tool_show_epic(args: &Value, _ctx: &AppContext) -> Result<String,
|
||||
Stage::Blocked { .. } => "blocked",
|
||||
}
|
||||
};
|
||||
if matches!(item.stage, Stage::Done { .. }) {
|
||||
done += 1;
|
||||
}
|
||||
member_items.push(json!({
|
||||
"story_id": sid,
|
||||
"name": item.name,
|
||||
@@ -150,7 +154,6 @@ pub(crate) fn tool_show_epic(args: &Value, _ctx: &AppContext) -> Result<String,
|
||||
}
|
||||
|
||||
let total = member_items.len();
|
||||
let done = member_items.iter().filter(|i| i["stage"] == "done").count();
|
||||
|
||||
serde_json::to_string_pretty(&json!({
|
||||
"epic_id": epic_id,
|
||||
|
||||
Reference in New Issue
Block a user