ticket: parse item frontmatter as YAML

This commit is contained in:
2026-06-08 08:13:19 +09:00
parent de3a5569da
commit 10d7844fc8
53 changed files with 450 additions and 151 deletions
+40
View File
@@ -1139,6 +1139,46 @@ mod tests {
assert_eq!(queued.next_action, Some(NextUserAction::Wait));
}
#[test]
fn workspace_panel_treats_yaml_null_attention_required_as_unblocked_intake() {
let temp = TempDir::new().unwrap();
write_ticket_config(temp.path());
let backend = LocalTicketBackend::new(temp.path().join(".yoi/tickets"));
let ticket_ref = backend
.create({
let mut input = NewTicket::new("Null Attention Intake");
input.slug = Some("null-attention-intake".to_string());
input.workflow_state = Some(TicketWorkflowState::Intake);
input
})
.unwrap();
let item_path = temp
.path()
.join(".yoi/tickets/open")
.join(&ticket_ref.id)
.join("item.md");
let item = fs::read_to_string(&item_path).unwrap();
fs::write(
&item_path,
item.replace(
"workflow_state: intake\ncreated_at:",
"workflow_state: intake\nattention_required: null\ncreated_at:",
),
)
.unwrap();
let model = build_workspace_panel(temp.path(), &empty_pods());
let row = model
.rows
.iter()
.find(|row| row.title == "Null Attention Intake")
.unwrap();
assert_eq!(row.status, "intake");
assert_eq!(row.next_action, Some(NextUserAction::Clarify));
assert_eq!(row.priority, ActionPriority::Background);
}
#[test]
fn workspace_panel_defaults_missing_open_state_to_intake_and_displays_done_state() {
let temp = TempDir::new().unwrap();