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.
This commit is contained in:
Travis Cline
2025-10-15 14:19:54 -07:00
parent 6f357ea536
commit 4131e6bf38

View File

@@ -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()