From 94db2dc8c9f63d761b03f0d846ff852194574ed5 Mon Sep 17 00:00:00 2001 From: Hare Date: Tue, 9 Jun 2026 21:19:42 +0900 Subject: [PATCH] fix: hide obsolete ticket fields in cli show --- crates/yoi/src/ticket_cli.rs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/crates/yoi/src/ticket_cli.rs b/crates/yoi/src/ticket_cli.rs index f6245135..d6e96a27 100644 --- a/crates/yoi/src/ticket_cli.rs +++ b/crates/yoi/src/ticket_cli.rs @@ -473,7 +473,10 @@ fn show(backend: &LocalTicketBackend, query: String) -> Result bool { - matches!(key, "legacy_ticket" | "needs_preflight") + matches!( + key, + "legacy_ticket" | "needs_preflight" | "action_required" | "attention_required" + ) } fn comment( @@ -1321,6 +1324,36 @@ mod tests { ); } + #[test] + fn ticket_cli_show_omits_obsolete_overlay_fields_from_legacy_frontmatter() { + let temp = TempDir::new().unwrap(); + let created = run(&temp, &["create", "--title", "Legacy Overlay"]); + let ticket_id = created_id(&created); + let item_path = temp + .path() + .join(".yoi/tickets") + .join(&ticket_id) + .join("item.md"); + let item = fs::read_to_string(&item_path).unwrap(); + fs::write( + &item_path, + item.replacen( + "---\n", + "---\naction_required: legacy action\nattention_required: legacy attention\n", + 1, + ), + ) + .unwrap(); + + let shown = run(&temp, &["show", &ticket_id]); + assert_eq!(shown.status, TicketCliStatus::Success); + assert!(shown.stdout.contains("# Legacy Overlay")); + assert!(!shown.stdout.contains("action_required")); + assert!(!shown.stdout.contains("attention_required")); + assert!(!shown.stdout.contains("legacy action")); + assert!(!shown.stdout.contains("legacy attention")); + } + #[test] fn ticket_cli_records_lists_and_shows_relations() { let temp = TempDir::new().unwrap();