MCPcopy Create free account
hub / github.com/driangle/taskmd / outputNextAllProjectsTable

Function outputNextAllProjectsTable

apps/cli/internal/cli/next.go:220–251  ·  view source on GitHub ↗
(recs []ProjectRecommendation)

Source from the content-addressed store, hash-verified

218}
219
220func 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.
254func projectRecRow(rec ProjectRecommendation, columns []string, r *lipgloss.Renderer) ([]string, []string) {

Callers 1

runNextAllProjectsFunction · 0.85

Calls 11

AddHeaderMethod · 0.95
AddSeparatorMethod · 0.95
AddRowMethod · 0.95
FlushMethod · 0.95
parseNextColumnsFunction · 0.85
injectProjectColumnFunction · 0.85
getRendererFunction · 0.85
formatLabelFunction · 0.85
NewTableWriterFunction · 0.85
nextColumnDisplayNameFunction · 0.85
projectRecRowFunction · 0.85

Tested by

no test coverage detected