huskies: merge 872
This commit is contained in:
@@ -47,8 +47,18 @@ pub(crate) fn tool_create_spike(args: &Value, ctx: &AppContext) -> Result<String
|
||||
);
|
||||
}
|
||||
|
||||
let depends_on: Option<Vec<u32>> = args
|
||||
.get("depends_on")
|
||||
.and_then(|v| serde_json::from_value(v.clone()).ok());
|
||||
|
||||
let root = ctx.state.get_project_root()?;
|
||||
let spike_id = create_spike_file(&root, name, description, &acceptance_criteria)?;
|
||||
let spike_id = create_spike_file(
|
||||
&root,
|
||||
name,
|
||||
description,
|
||||
&acceptance_criteria,
|
||||
depends_on.as_deref(),
|
||||
)?;
|
||||
|
||||
Ok(format!("Created spike: {spike_id}"))
|
||||
}
|
||||
|
||||
@@ -38,6 +38,19 @@ pub(crate) fn tool_update_story(args: &Value, ctx: &AppContext) -> Result<String
|
||||
crate::crdt_state::set_qa_mode(story_id, mode);
|
||||
}
|
||||
|
||||
// Sync `depends_on` to the typed CRDT register when present in the update.
|
||||
if let Some(deps_val) = front_matter.get("depends_on") {
|
||||
if let Some(arr) = deps_val.as_array() {
|
||||
let dep_nums: Vec<u32> = arr
|
||||
.iter()
|
||||
.filter_map(|v| v.as_u64().map(|n| n as u32))
|
||||
.collect();
|
||||
crate::crdt_state::set_depends_on(story_id, &dep_nums);
|
||||
} else if deps_val.is_null() {
|
||||
crate::crdt_state::set_depends_on(story_id, &[]);
|
||||
}
|
||||
}
|
||||
|
||||
let front_matter_opt = if front_matter.is_empty() {
|
||||
None
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user