cliui

package
v0.0.0-...-5ad71b7 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ui provides terminal output rendering using lipgloss v2. All styling is defined here; no other package may import lipgloss.

Index

Constants

View Source
const (
	IDWidth     = 10
	StatusWidth = 10
)

Layout widths

View Source
const (
	OverdueIndicator = "⚠"
	DueSoonIndicator = "⏰"
)

Due indicator constants

Variables

View Source
var (
	StatusTodoColor      = lipgloss.Color("15") // white
	StatusDoingColor     = lipgloss.Color("12") // blue
	StatusDoneColor      = lipgloss.Color("10") // green
	StatusBlockedColor   = lipgloss.Color("11") // yellow
	StatusCancelledColor = lipgloss.Color("8")  // gray
)

Status colors

View Source
var (
	ErrorColor   = lipgloss.Color("9")  // red
	SuccessColor = lipgloss.Color("10") // green
	MutedColor   = lipgloss.Color("8")  // gray
	HeaderColor  = lipgloss.Color("7")  // light gray
	BorderColor  = lipgloss.Color("8")  // gray
	OverdueColor = lipgloss.Color("9")  // red - for overdue tasks
	DueSoonColor = lipgloss.Color("11") // yellow - for tasks due soon
)

Semantic colors

View Source
var (
	BaseStyle = lipgloss.NewStyle()

	HeaderStyle = lipgloss.NewStyle().
				Foreground(HeaderColor).
				Bold(true)

	MutedStyle = lipgloss.NewStyle().
				Foreground(MutedColor)

	ErrorStyle = lipgloss.NewStyle().
				Foreground(ErrorColor).
				Bold(true)

	SuccessStyle = lipgloss.NewStyle().
					Foreground(SuccessColor)

	LabelStyle = lipgloss.NewStyle().
				Foreground(MutedColor).
				Width(12)

	ValueStyle = lipgloss.NewStyle()
)

Base styles

View Source
var TitleStyle = lipgloss.NewStyle().
	Bold(true).
	Underline(true)

TitleStyle is used for the detail view title

Functions

func RenderError

func RenderError(err error) string

RenderError returns a styled error message.

func RenderNotFound

func RenderNotFound(id string) string

RenderNotFound returns a styled "not found" message for a task ID.

func RenderTaskDetail

func RenderTaskDetail(t *repository.Entity) string

RenderTaskDetail returns a full detailed view of a task. Used by the show command.

func StatusString

func StatusString(s task.Status) string

StatusString returns the display string for a status

func StatusStyle

func StatusStyle(s task.Status) lipgloss.Style

StatusStyle maps status to its styled representation

Types

type Renderer

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

func NewDefaultRenderer

func NewDefaultRenderer(clock clock.Clock) *Renderer

func NewRenderer

func NewRenderer(clock clock.Clock) *Renderer

func (*Renderer) RenderAgenda

func (r *Renderer) RenderAgenda(ag *agenda.Agenda, viewportLength uint32, totalRankedCount int) string

func (*Renderer) RenderTaskList

func (r *Renderer) RenderTaskList(tasks []*repository.Entity) string

RenderTaskList returns a formatted table of tasks. Used by the ls command.

func (*Renderer) RenderTaskSummary

func (r *Renderer) RenderTaskSummary(t *repository.Entity) string

RenderTaskSummary returns a one-line summary of a task. Used after add/do/done/mod commands.

Jump to

Keyboard shortcuts

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