diff --git a/cmd/bd/list.go b/cmd/bd/list.go index 44336512..2e11da03 100644 --- a/cmd/bd/list.go +++ b/cmd/bd/list.go @@ -90,6 +90,9 @@ var listCmd = &cobra.Command{ if issue.Assignee != "" { fmt.Printf(" Assignee: %s\n", issue.Assignee) } + if len(issue.Labels) > 0 { + fmt.Printf(" Labels: %v\n", issue.Labels) + } fmt.Println() } } @@ -114,17 +117,27 @@ var listCmd = &cobra.Command{ } if jsonOutput { + // Populate labels for JSON output + for _, issue := range issues { + issue.Labels, _ = store.GetLabels(ctx, issue.ID) + } outputJSON(issues) return } fmt.Printf("\nFound %d issues:\n\n", len(issues)) for _, issue := range issues { + // Load labels for display + labels, _ := store.GetLabels(ctx, issue.ID) + fmt.Printf("%s [P%d] [%s] %s\n", issue.ID, issue.Priority, issue.IssueType, issue.Status) fmt.Printf(" %s\n", issue.Title) if issue.Assignee != "" { fmt.Printf(" Assignee: %s\n", issue.Assignee) } + if len(labels) > 0 { + fmt.Printf(" Labels: %v\n", labels) + } fmt.Println() } }, diff --git a/internal/rpc/server.go b/internal/rpc/server.go index 6a8c98dd..d711f699 100644 --- a/internal/rpc/server.go +++ b/internal/rpc/server.go @@ -909,6 +909,12 @@ func (s *Server) handleList(req *Request) Response { } } + // Populate labels for each issue + for _, issue := range issues { + labels, _ := store.GetLabels(ctx, issue.ID) + issue.Labels = labels + } + data, _ := json.Marshal(issues) return Response{ Success: true, @@ -942,7 +948,27 @@ func (s *Server) handleShow(req *Request) Response { } } - data, _ := json.Marshal(issue) + // Populate labels, dependencies, and dependents + labels, _ := store.GetLabels(ctx, issue.ID) + deps, _ := store.GetDependencies(ctx, issue.ID) + dependents, _ := store.GetDependents(ctx, issue.ID) + + // Create detailed response with related data + type IssueDetails struct { + *types.Issue + Labels []string `json:"labels,omitempty"` + Dependencies []*types.Issue `json:"dependencies,omitempty"` + Dependents []*types.Issue `json:"dependents,omitempty"` + } + + details := &IssueDetails{ + Issue: issue, + Labels: labels, + Dependencies: deps, + Dependents: dependents, + } + + data, _ := json.Marshal(details) return Response{ Success: true, Data: data,