(recs []ProjectRecommendation)
| 218 | } |
| 219 | |
| 220 | func outputNextAllProjectsTable(recs []ProjectRecommendation) error { |
| 221 | if len(recs) == 0 { |
| 222 | fmt.Println("No actionable tasks found across projects.") |
| 223 | return nil |
| 224 | } |
| 225 | |
| 226 | columns, err := parseNextColumns(nextColumns) |
| 227 | if err != nil { |
| 228 | return err |
| 229 | } |
| 230 | columns = injectProjectColumn(columns) |
| 231 | |
| 232 | r := getRenderer() |
| 233 | fmt.Println(formatLabel("Recommended tasks (all projects):", r)) |
| 234 | fmt.Println() |
| 235 | |
| 236 | tw := NewTableWriter() |
| 237 | headers := make([]string, len(columns)) |
| 238 | for i, col := range columns { |
| 239 | headers[i] = nextColumnDisplayName(col) |
| 240 | } |
| 241 | tw.AddHeader(headers) |
| 242 | tw.AddSeparator() |
| 243 | |
| 244 | for _, rec := range recs { |
| 245 | plain, colored := projectRecRow(rec, columns, r) |
| 246 | tw.AddRow(plain, colored) |
| 247 | } |
| 248 | |
| 249 | tw.Flush(os.Stdout) |
| 250 | return nil |
| 251 | } |
| 252 | |
| 253 | // projectRecRow builds plain and colored column values for a project recommendation. |
| 254 | func projectRecRow(rec ProjectRecommendation, columns []string, r *lipgloss.Renderer) ([]string, []string) { |
no test coverage detected