Documentation
¶
Index ¶
- Variables
- func CalculateColumnWidths(totalWidth int, columns []Column) []int
- func EditInteractive(template string) (string, error)
- func ExtractEmail(user string) string
- func ExtractName(user 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 RenderHistory(events []model.Event, termWidth int)
- func RenderIssueDetails(issue *model.Issue, children []*model.Issue, isArchived bool, termWidth int) string
- func RenderIssueList(issues []*model.Issue, termWidth int, prefix string) string
- func RenderReview(data ReviewData, termWidth int) string
- 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 Stylize(s string) string
- func TerminalWidth() int
- func Truncate(s string, maxWidth int) string
- type Column
- 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 AccentColor = lipgloss.Color("#6f42c1") // 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 = "✗" OKPrefix = "✓" NotePrefix = "ℹ" )
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 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 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 RenderHistory ¶
RenderHistory renders the event history for an issue.
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 RenderReview ¶
func RenderReview(data ReviewData, termWidth int) string
RenderReview renders the review summary for an issue with a matching branch.
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 ReviewCommit ¶
type ReviewData ¶
type ReviewData struct {
Issue *model.Issue
Base string
Commits []ReviewCommit
Files []ReviewFile
}