MCPcopy Create free account
hub / github.com/Facets-cloud/flow / notesCell

Function notesCell

internal/app/list.go:527–548  ·  view source on GitHub ↗

notesCell builds the trailing NOTES column in table output. Each fragment is colored independently so the row reads well at a glance. waitMax > 0 truncates the waiting field; 0 disables truncation (the --no-truncate path).

(p listfmt.Painter, r taskListRow, waitMax int)

Source from the content-addressed store, hash-verified

525// truncates the waiting field; 0 disables truncation (the --no-truncate
526// path).
527func notesCell(p listfmt.Painter, r taskListRow, waitMax int) string {
528 var parts []string
529 if r.Stale {
530 parts = append(parts, p.Wrap(fmt.Sprintf("⚠ stale (%dd)", r.StaleDays), listfmt.Red))
531 }
532 if r.WaitingOn != "" {
533 parts = append(parts, p.Wrap("[waiting: "+listfmt.Truncate(r.WaitingOn, waitMax)+"]", listfmt.Yellow))
534 }
535 if r.Assignee != "" {
536 parts = append(parts, p.Wrap("[@"+r.Assignee+"]", listfmt.Blue))
537 }
538 if r.Live {
539 parts = append(parts, p.Wrap("[live]", listfmt.Cyan))
540 }
541 for _, t := range r.Tags {
542 parts = append(parts, p.Wrap("#"+t, listfmt.Gray))
543 }
544 if r.Archived {
545 parts = append(parts, p.Wrap("(archived)", listfmt.Dim))
546 }
547 return strings.Join(parts, " ")
548}
549
550func listProjectsCmd(args []string) int {
551 fs := flagSet("list projects")

Callers 1

listTasksCmdFunction · 0.85

Calls 2

TruncateFunction · 0.92
WrapMethod · 0.80

Tested by

no test coverage detected