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 RenderNotFound ¶
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 ¶
StatusString returns the display string for a status
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewDefaultRenderer ¶
func NewRenderer ¶
func (*Renderer) RenderAgenda ¶
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.
Click to show internal directories.
Click to hide internal directories.