Documentation
¶
Index ¶
- Variables
- func CalculateColumnWidths(totalWidth int, columns []Column) []int
- func DescribeEvent(evt model.Event) string
- func EditInteractive(template string) (string, error)
- func ExtractEmail(user string) string
- func ExtractName(user string) string
- func FormatActor(createdBy, onBehalfOf string) string
- func FormatBranchStats(stats *model.BranchStats) string
- func FormatID(id string, maxWidth int) string
- func FormatLabels(labels []string) string
- func FormatLabelsBadge(labels []string) string
- func GetRecentDoneIDs(issues []*model.Issue, count int) map[string]bool
- func GetRecentDoneIDsFromMap(issuesMap map[string]*model.Issue, count int) map[string]bool
- func Indent(level int) string
- func LabelColor(label string) lipgloss.Color
- func RenderCell(content string, width int, style lipgloss.Style) string
- func RenderHeader(title string) string
- func RenderIssueDetails(issue *model.Issue, children []*model.Issue, isArchived bool, termWidth int) string
- func RenderIssueList(issues []*model.Issue, termWidth int, prefix string) string
- func RenderPulse(d PulseData, width int) string
- func RenderRationale(data RationaleData, termWidth int) string
- func RenderReview(data ReviewData, termWidth int) string
- func RenderTimeline(w io.Writer, entries []model.TimelineEntry, termWidth int)
- func RenderTimelineJSON(entries []model.TimelineEntry, w io.Writer)
- func ScreenWidth() int
- func SetLabelColors(labels map[string]string)
- func StatusIcon(status model.IssueStatus) string
- func StatusIconForIssue(issue *model.Issue) string
- func StatusStyle(status model.IssueStatus) lipgloss.Style
- func TerminalWidth() int
- func Truncate(s string, maxWidth int) string
- type Column
- type PulseData
- type RationaleData
- type RationaleHit
- type ReviewCommit
- type ReviewData
- type ReviewFile
Constants ¶
This section is empty.
Variables ¶
var ( BacklogColor = lipgloss.Color("#6c757d") // Gray PlannedColor = lipgloss.Color("#ffffff") // White DoingColor = lipgloss.Color("#198754") // Green BlockedColor = lipgloss.Color("#dc3545") // Red DoneColor = lipgloss.Color("#adb5bd") // Light Gray CanceledColor = lipgloss.Color("#8b8b8b") // Medium Gray DuplicateColor = lipgloss.Color("#8b8b8b") // Medium Gray AccentColor = lipgloss.Color("#b392f0") // Purple MutedColor = lipgloss.Color("#6c757d") // Gray WhiteColor = lipgloss.Color("#ffffff") )
--- Color Constants ---
var ( WhiteStyle = lipgloss.NewStyle().Foreground(WhiteColor) AccentStyle = lipgloss.NewStyle().Foreground(AccentColor) MutedStyle = lipgloss.NewStyle().Foreground(MutedColor) BoldStyle = lipgloss.NewStyle().Bold(true) )
--- Base Styles ---
var ( ErrorPrefix = errStyle.Render("✗") OKPrefix = okStyle.Render("✓") NotePrefix = warnStyle.Render("!") )
var HeaderStyle = lipgloss.NewStyle(). Bold(true). Border(lipgloss.NormalBorder(), false, false, true, false). BorderForeground(lipgloss.Color("240"))
HeaderStyle matches the list command header style
WarningStyle is used for warning messages.
Functions ¶
func CalculateColumnWidths ¶
CalculateColumnWidths helper
func DescribeEvent ¶ added in v1.2.0
DescribeEvent returns a human-readable description for an event. Returns empty string for unrecognized or empty updates (caller should skip).
func EditInteractive ¶
EditInteractive opens the user's EDITOR to edit the given template. Returns the content or an empty string if aborted/unchanged.
func ExtractEmail ¶
ExtractEmail extracts the email from a "Name <email>" formatted string.
func ExtractName ¶
ExtractName extracts the name from a "Name <email>" formatted string.
func FormatActor ¶ added in v1.2.0
FormatActor returns a display name, appending "(via Principal)" when on_behalf_of is set.
func FormatBranchStats ¶
func FormatBranchStats(stats *model.BranchStats) string
FormatBranchStats renders a compact commit count badge like "⊙ 3". Returns empty string if stats is nil or the branch has no commits.
func FormatLabels ¶
FormatLabels renders a list of labels as styled tags.
func FormatLabelsBadge ¶
FormatLabelsBadge renders a list of labels as [label] badges.
func GetRecentDoneIDs ¶
GetRecentDoneIDs returns a map of the most recently updated DONE issue IDs
func GetRecentDoneIDsFromMap ¶
GetRecentDoneIDsFromMap is a convenience wrapper for map-based issue collections
func LabelColor ¶
LabelColor returns a color for a label, checking config colors first, then falling back to a deterministic hash-based color.
func RenderCell ¶
RenderCell renders a table cell padded to a given width.
func RenderIssueDetails ¶
func RenderIssueDetails(issue *model.Issue, children []*model.Issue, isArchived bool, termWidth int) string
RenderIssueDetails renders a detailed view of an issue.
func RenderIssueList ¶
RenderIssueList renders a formatted issue list for the terminal. The prefix parameter is the configured issue ID prefix (e.g. "xpo-"); it determines the width of the ID column.
func RenderPulse ¶ added in v1.2.0
func RenderRationale ¶ added in v1.2.0
func RenderRationale(data RationaleData, termWidth int) string
RenderRationale renders search results with colors, labels, fragments, and file paths.
func RenderReview ¶
func RenderReview(data ReviewData, termWidth int) string
RenderReview renders the review summary for an issue with a matching branch.
func RenderTimeline ¶ added in v1.2.0
func RenderTimeline(w io.Writer, entries []model.TimelineEntry, termWidth int)
RenderTimeline renders a human-readable activity timeline to w. Accepts TimelineEntry slices that may contain both issue events and commits.
func RenderTimelineJSON ¶ added in v1.2.0
func RenderTimelineJSON(entries []model.TimelineEntry, w io.Writer)
RenderTimelineJSON writes timeline entries as JSONL (one JSON object per line).
func SetLabelColors ¶
SetLabelColors sets the label color map from config. Call this once after loading config to enable config-driven label colors in CLI output.
func StatusIcon ¶
func StatusIcon(status model.IssueStatus) string
StatusIcon returns the icon for a given status.
func StatusIconForIssue ¶
StatusIconForIssue returns the status icon, using a distinct icon for issues whose DOING status was inferred from a remote git branch.
func StatusStyle ¶
func StatusStyle(status model.IssueStatus) lipgloss.Style
StatusStyle returns the style for a given status.
func TerminalWidth ¶
func TerminalWidth() int
TerminalWidth returns the current terminal width with a default fallback.
Types ¶
type Column ¶
type Column struct {
Title string
Width int // Fixed width or minimum width if Flex is true
Flex bool // If true, expands to fill available space
}
Column defines a table column
type RationaleData ¶ added in v1.2.0
type RationaleData struct {
Results []RationaleHit
Query string
TotalMatches int
}
RationaleData is the input for rendering rationale search results.
type RationaleHit ¶ added in v1.2.0
type RationaleHit struct {
IssueID string
Title string
Status string
Labels []string
Document string
Fragment string
Score float64
ArtifactPath string
}
RationaleHit is the UI-facing data for a single search result.
type ReviewCommit ¶
type ReviewData ¶
type ReviewData struct {
Issue *model.Issue
Base string
Commits []ReviewCommit
Files []ReviewFile
}