Documentation
¶
Overview ¶
Package tui provides the interactive terminal UI for browsing and editing tickets.
Index ¶
- Variables
- func ColorPriority(p int, text string) string
- func ColorStatus(s ticket.Status, text string) string
- func ColorType(t ticket.TicketType, text string) string
- func IDSuffix(id string) string
- func PriorityBadge(p int) string
- func ProgressBar(done, total, width int) string
- func SelectedChip(bg lipgloss.Color, label string) string
- func StatusBadge(s ticket.Status) string
- func TypeBadge(t ticket.TicketType) string
- type App
Constants ¶
This section is empty.
Variables ¶
var ( StatusColors = map[ticket.Status]lipgloss.Color{ ticket.StatusBacklog: colorGray, ticket.StatusReady: colorCyan, ticket.StatusOpen: colorYellow, ticket.StatusDone: colorGreen, ticket.StatusClosed: colorGray, } PriorityColors = map[int]lipgloss.Color{ 0: colorRed, 1: colorYellow, 2: colorWhite, 3: colorGray, 4: colorGray, } TypeColors = map[ticket.TicketType]lipgloss.Color{ ticket.TypeBug: colorRed, ticket.TypeFeature: colorGreen, ticket.TypeEpic: colorMagenta, } )
var ( BorderRounded = lipgloss.RoundedBorder() BorderNormal = lipgloss.NormalBorder() )
var ( // Text styles StyleBold = lipgloss.NewStyle().Bold(true) StyleDim = lipgloss.NewStyle().Foreground(colorMuted) StyleAccent = lipgloss.NewStyle().Foreground(colorAccent) StyleDanger = lipgloss.NewStyle().Foreground(colorDanger) StyleSuccess = lipgloss.NewStyle().Foreground(colorSuccess) StyleWarning = lipgloss.NewStyle().Foreground(colorWarning) StyleInfo = lipgloss.NewStyle().Foreground(colorInfo) StyleUnderline = lipgloss.NewStyle().Underline(true) // Tab bar StyleTabActive = lipgloss.NewStyle().Bold(true).Foreground(colorWhite).Underline(true).UnderlineSpaces(true) StyleTabDim = lipgloss.NewStyle().Foreground(colorMuted) // List rows StyleRow = lipgloss.NewStyle() StyleRowSelected = lipgloss.NewStyle().Bold(true).Background(colorSurface) // Field labels (detail view, form) StyleFieldKey = lipgloss.NewStyle().Bold(true).Foreground(colorInfo).Width(14) StyleFieldVal = lipgloss.NewStyle() // Section headers StyleSection = lipgloss.NewStyle().Bold(true).Foreground(colorAccent) StyleTimestamp = lipgloss.NewStyle().Bold(true).Foreground(colorInfo) // Input StyleInputLabel = lipgloss.NewStyle().Bold(true).Foreground(colorWarning) StyleInputText = lipgloss.NewStyle().Foreground(colorWhite) StyleCursor = lipgloss.NewStyle().Foreground(colorWarning) StyleTextCursor = lipgloss.NewStyle().Foreground(colorBlack).Background(colorWarning) // Filter / search StyleFilter = lipgloss.NewStyle().Foreground(colorWarning) // Help bar StyleHelp = lipgloss.NewStyle().Foreground(colorMuted) // Cards (pipeline) StyleCard = lipgloss.NewStyle().PaddingLeft(1).PaddingRight(1) StyleCardSelected = lipgloss.NewStyle().PaddingLeft(1).PaddingRight(1). Bold(true).Background(colorSurface) StyleColHeader = lipgloss.NewStyle().Bold(true).Underline(true) // Overlay StyleOverlayBorder = lipgloss.NewStyle(). Border(BorderRounded). BorderForeground(colorMuted) )
Functions ¶
func ColorPriority ¶
ColorPriority renders text in the priority's color.
func ColorStatus ¶
ColorStatus renders text in the status's color.
func ColorType ¶
func ColorType(t ticket.TicketType, text string) string
ColorType renders text in the ticket type's color.
func PriorityBadge ¶
PriorityBadge renders "P0" as a colored pill badge.
func ProgressBar ¶
ProgressBar renders a simple text progress bar: ━━━━━━━━━━ (filled/total).
func SelectedChip ¶
SelectedChip renders a selector chip (type/priority/status) as the highlighted choice: bold black text on the chip's own domain color. High contrast and preserves identity without nesting ANSI fg codes.
func StatusBadge ¶
StatusBadge renders a status in the appropriate color.
func TypeBadge ¶
func TypeBadge(t ticket.TicketType) string
TypeBadge renders a ticket type as a fixed-width colored pill.