refactor(issue,pr): trim help, restating comments and single-use helpers

Cut issue, pr, label, milestone and comment examples to at most three, drop
doc comments that only restate the name, fold the comment and attachment
argument lookups into one closure each, and inline label helpers with one
caller.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 20:48:00 +02:00
1 parent 4a85bb3d40
commit 2826726557
13 files changed
+57 -147

No files matched your search

+1 -4
View File
@@ -37,12 +37,10 @@ type discussionComment struct {
meta [2]string
}
// stateBadge shows a discussion state, such as Open or Merged, in its color.
func stateBadge(state string) terminal.Cell {
return terminal.Cell{Text: titleCase(state), Color: stateColors[state]}
}
// labelCells shows labels in their colors.
func labelCells(labels []services.Label) []terminal.Cell {
cells := make([]terminal.Cell, len(labels))
for i, label := range labels {
@@ -151,7 +149,6 @@ func pullView(item services.Pull, repo string, details pullDetails) discussionVi
if checks != "" {
checksHint = fmt.Sprintf("%s (tea pr checks %d)", checks, item.Number)
}
reviews := details.reviews
return discussionView{
number: item.Number, comments: item.Comments, summary: summary,
view: terminal.View{
@@ -176,7 +173,7 @@ func pullView(item services.Pull, repo string, details pullDetails) discussionVi
}
},
extraComments: func(cmd *cobra.Command, t target, n int64) ([]discussionComment, error) {
return pullReviewComments(cmd, t, n, reviews)
return pullReviewComments(cmd, t, n, details.reviews)
},
}
}