From 4131e6bf38e4650de3f15d456058ee7586f36d64 Mon Sep 17 00:00:00 2001 From: Travis Cline Date: Wed, 15 Oct 2025 14:19:54 -0700 Subject: [PATCH] list: add status-based color coding to dot format Enhance Graphviz dot output with status-based fill colors: - open: white background (default) - in_progress: light yellow background - blocked: light coral background - closed: light gray background with dimmed text Node labels show: ID, type, priority, title, and status. Priority is visible in the label (e.g., [bug P0]) but not color-coded to keep the visualization clean and focused on status. --- cmd/bd/list.go | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/cmd/bd/list.go b/cmd/bd/list.go index c5d81681..e76b8f0b 100644 --- a/cmd/bd/list.go +++ b/cmd/bd/list.go @@ -98,12 +98,32 @@ func outputDotFormat(ctx context.Context, store storage.Storage, issues []*types issueMap[issue.ID] = issue } - // Output nodes with labels + // Output nodes with labels including ID, type, priority, and status for _, issue := range issues { - // Escape quotes in title - title := issue.Title - title = fmt.Sprintf("%q", title) // Go's %q handles escaping - fmt.Printf(" %q [label=%s];\n", issue.ID, title) + // Build label with ID, type, priority, and title (using actual newlines) + label := fmt.Sprintf("%s\n[%s P%d]\n%s\n(%s)", + issue.ID, + issue.IssueType, + issue.Priority, + issue.Title, + issue.Status) + + // Color by status only - keep it simple + fillColor := "white" + fontColor := "black" + + switch issue.Status { + case "closed": + fillColor = "lightgray" + fontColor = "dimgray" + case "in_progress": + fillColor = "lightyellow" + case "blocked": + fillColor = "lightcoral" + } + + fmt.Printf(" %q [label=%q, style=\"rounded,filled\", fillcolor=%q, fontcolor=%q];\n", + issue.ID, label, fillColor, fontColor) } fmt.Println()