components

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SidebarWidth = 22

SidebarWidth is the fixed width of the sidebar.

Variables

View Source
var SparkBlocks = []rune{'▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'}

SparkBlocks are the 8 block characters used for sparkline bars.

Functions

func PillStatus

func PillStatus(status string) string

PillStatus renders a colored status pill.

func ProvBadge

func ProvBadge(actorType string) string

ProvBadge renders a colored pill for actor type.

func SectionTitle

func SectionTitle(title string, width int) string

SectionTitle renders an uppercase gray label with bottom border.

Types

type HeatGrid

type HeatGrid struct {
	Values []int
	Width  int
}

HeatGrid renders a row of colored cells representing intensity levels.

func (HeatGrid) View

func (h HeatGrid) View() string

View renders the heat grid.

type InlineBar

type InlineBar struct {
	Label string
	Value float64 // 0.0 to 1.0
	Width int
	Color lipgloss.Color
}

InlineBar renders a single-row progress bar with label and value.

func (InlineBar) View

func (b InlineBar) View() string

View renders the inline bar.

type LogRow

type LogRow struct {
	Time    string
	Source  string
	Message string
	Code    string
	Level   string // "info", "ok", "warn", "err", "security"
}

LogRow is a single row in the log table.

type LogTable

type LogTable struct {
	Viewport   viewport.Model
	Rows       []LogRow
	Filter     string
	AutoScroll bool
	Width      int
	Height     int
}

LogTable is a scrollable viewport for log rows.

func NewLogTable

func NewLogTable(w, h int) LogTable

NewLogTable creates a new log table.

func (*LogTable) SetRows

func (l *LogTable) SetRows(rows []LogRow)

SetRows updates the log rows and re-renders content.

func (*LogTable) SetSize

func (l *LogTable) SetSize(w, h int)

SetSize updates the viewport dimensions.

func (*LogTable) Update

func (l *LogTable) Update(msg tea.Msg)

Update handles viewport messages.

func (LogTable) View

func (l LogTable) View() string

View renders the log table.

type Sidebar struct {
	Sections  []SidebarSection
	Collapsed bool
	Height    int
}

Sidebar renders a fixed-width left pane with sections.

func (Sidebar) View

func (s Sidebar) View() string

View renders the sidebar.

type SidebarItem

type SidebarItem struct {
	Name  string
	Value string
	Dot   string // color name: "green", "amber", "red", ""
}

SidebarItem is a key-value pair in the sidebar.

type SidebarSection

type SidebarSection struct {
	Title string
	Items []SidebarItem
}

SidebarSection is a group of items with a header.

type Sparkline

type Sparkline struct {
	Values []float64
	Width  int
	Color  lipgloss.Color
}

Sparkline renders a mini bar chart from a slice of values.

func (Sparkline) View

func (s Sparkline) View() string

View renders the sparkline.

type Stage

type Stage struct {
	Number  int
	Name    string
	Status  string // "HIT", "SKIP", "MISS", "OK", "ERR"
	Latency string
}

Stage represents a single stage in a flow.

type StageFlow

type StageFlow struct {
	Stages []Stage
	Width  int
}

StageFlow renders a horizontal chain of stage boxes connected by › glyphs.

func (StageFlow) View

func (sf StageFlow) View() string

View renders the stage flow.

type StatCard

type StatCard struct {
	Label    string
	Value    string
	Subtitle string
	Color    lipgloss.Color
	Width    int
}

StatCard renders a metric card with label, value, subtitle, and accent color.

func (StatCard) View

func (s StatCard) View() string

View renders the stat card.

type Statusbar

type Statusbar struct {
	Data  StatusbarData
	Width int
}

Statusbar renders the bottom status strip.

func (Statusbar) View

func (s Statusbar) View() string

View renders the statusbar.

type StatusbarData

type StatusbarData struct {
	Status  string
	Version string
	Queue   int
	Paused  bool
}

StatusbarData holds the key-value pairs for the status bar.

Jump to

Keyboard shortcuts

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