tui

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tui provides the interactive terminal UI for browsing and editing tickets.

Index

Constants

This section is empty.

Variables

View Source
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,
	}
)
View Source
var (
	BorderRounded = lipgloss.RoundedBorder()
	BorderNormal  = lipgloss.NormalBorder()
)
View Source
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

func ColorPriority(p int, text string) string

ColorPriority renders text in the priority's color.

func ColorStatus

func ColorStatus(s ticket.Status, text string) string

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 IDSuffix

func IDSuffix(id string) string

IDSuffix returns just the 4-character hex suffix of a ticket ID.

func PriorityBadge

func PriorityBadge(p int) string

PriorityBadge renders "P0" as a colored pill badge.

func ProgressBar

func ProgressBar(done, total, width int) string

ProgressBar renders a simple text progress bar: ━━━━━━━━━━ (filled/total).

func SelectedChip

func SelectedChip(bg lipgloss.Color, label string) string

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

func StatusBadge(s ticket.Status) string

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.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the top-level bubbletea model.

func New

func New(ticketsDir string) App

New creates a new App rooted at the given ticket directory.

func (App) Init

func (a App) Init() tea.Cmd

func (App) Update

func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (App) View

func (a App) View() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL