diff --git a/command/issue.go b/command/issue.go index fd6e23d7f..96e33643a 100644 --- a/command/issue.go +++ b/command/issue.go @@ -251,16 +251,25 @@ func issueView(cmd *cobra.Command, args []string) error { func printIssuePreview(out io.Writer, issue *api.Issue) error { coloredLabels := labelList(*issue) if coloredLabels != "" { - coloredLabels = utils.Gray(fmt.Sprintf("(%s)", coloredLabels)) + coloredLabels = fmt.Sprintf("%s", coloredLabels) } + now := time.Now() + ago := now.Sub(issue.CreatedAt) + issueStateColorFunc := utils.ColorFuncForState(issue.State) + fmt.Fprintln(out, utils.Bold(issue.Title)) - fmt.Fprintln(out, utils.Gray(fmt.Sprintf( - "opened by %s. %s. %s", + fmt.Fprintf(out, "%s", issueStateColorFunc(issue.State)) + fmt.Fprint(out, utils.Gray(fmt.Sprintf( + " • %s opened %s • %s • ", issue.Author.Login, + utils.FuzzyAgo(ago), utils.Pluralize(issue.Comments.TotalCount, "comment"), - coloredLabels, ))) + if coloredLabels != "" { + fmt.Fprintf(out, "%s", utils.Gray(coloredLabels)) + } + fmt.Fprintf(out, "\n") if issue.Body != "" { fmt.Fprintln(out)