tui

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IconSuccess    = "✓"
	IconFailure    = "✗"
	IconWarning    = "!"
	IconInProgress = "●"
	IconQueued     = "…"
	IconSkipped    = "-"
)

Status icons

Variables

View Source
var (
	ColorGreen  = lipgloss.Color("2")  // Green
	ColorRed    = lipgloss.Color("1")  // Red
	ColorYellow = lipgloss.Color("3")  // Yellow
	ColorDim    = lipgloss.Color("8")  // Dim gray
	ColorWhite  = lipgloss.Color("15") // White
	ColorCyan   = lipgloss.Color("6")  // Cyan
)

Colors

Functions

func StatusIcon

func StatusIcon(status string, conclusion *string) string

StatusIcon returns the appropriate icon for a status/conclusion combination

Types

type ArtifactDownloadedMsg

type ArtifactDownloadedMsg struct {
	Filename string
}

ArtifactDownloadedMsg is sent when an artifact is downloaded

type ArtifactsLoadedMsg

type ArtifactsLoadedMsg struct {
	Artifacts []gh.Artifact
}

ArtifactsLoadedMsg is sent when artifacts are loaded

type BranchesLoadedMsg

type BranchesLoadedMsg struct {
	Branches []gh.Branch
}

BranchesLoadedMsg is sent when branches are loaded

type CompareLogsLoadedMsg

type CompareLogsLoadedMsg struct {
	Logs1 string
	Logs2 string
}

CompareLogsLoadedMsg is sent when logs for comparison are loaded (v0.6)

type ErrMsg

type ErrMsg struct {
	Err error
}

ErrMsg is sent when an error occurs

type JobDetailsLoadedMsg

type JobDetailsLoadedMsg struct {
	Job *gh.Job
}

JobDetailsLoadedMsg is sent when job details are loaded

type JobsLoadedMsg

type JobsLoadedMsg struct {
	Jobs []gh.Job
}

JobsLoadedMsg is sent when jobs are loaded

type KeyMap

type KeyMap struct {
	Quit         key.Binding
	Refresh      key.Binding
	Watch        key.Binding
	Open         key.Binding
	Up           key.Binding
	Down         key.Binding
	Enter        key.Binding
	Logs         key.Binding
	Search       key.Binding
	NextMatch    key.Binding
	PrevMatch    key.Binding
	NextRun      key.Binding
	PrevRun      key.Binding
	BranchSelect key.Binding
	Filter       key.Binding
	Help         key.Binding
	Workflow     key.Binding
	Artifacts    key.Binding

	// v0.6 Log keys
	LogFilter     key.Binding
	LogSave       key.Binding
	LogHighlight  key.Binding
	LogCompare    key.Binding
	LogMulti      key.Binding
	LogViewToggle key.Binding

	// General UI keys
	Escape key.Binding
	Space  key.Binding
}

KeyMap defines the key bindings for the TUI

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings

type LogExportedMsg

type LogExportedMsg struct {
	Filename string
	Error    error
}

LogExportedMsg is sent when logs are exported to file (v0.6)

type LogLoadedMsg

type LogLoadedMsg struct {
	Content string
}

LogLoadedMsg is sent when job logs are loaded

type LogUpdatedMsg

type LogUpdatedMsg struct {
	Content string
}

LogUpdatedMsg is sent when logs are updated during streaming

type Model

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

Model is the Bubble Tea model for the TUI

func NewModel

func NewModel(cfg *config.Config, client *gh.Client) Model

NewModel creates a new TUI model

func (Model) ExitCode

func (m Model) ExitCode() int

ExitCode returns the exit code to use when quitting

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model

func (Model) View

func (m Model) View() string

View implements tea.Model

type MultiJobLogsLoadedMsg

type MultiJobLogsLoadedMsg struct {
	Contents map[int64]string
}

MultiJobLogsLoadedMsg is sent when logs for multiple jobs are loaded (v0.6)

type MultiRepoRunsLoadedMsg

type MultiRepoRunsLoadedMsg struct {
	SourcedRuns []gh.SourcedRun
}

MultiRepoRunsLoadedMsg is sent when runs from multiple repos are loaded (v0.8)

type ParsedLogsLoadedMsg

type ParsedLogsLoadedMsg struct {
	Logs *gh.ParsedLogs
}

ParsedLogsLoadedMsg is sent when structured logs are loaded (v0.6)

type RunLoadedMsg

type RunLoadedMsg struct {
	Run *gh.WorkflowRun
}

RunLoadedMsg is sent when a workflow run is loaded

type RunsLoadedMsg

type RunsLoadedMsg struct {
	Runs []gh.WorkflowRun
}

RunsLoadedMsg is sent when multiple workflow runs are loaded

type State

type State int

State represents the current state of the TUI

const (
	StateLoading State = iota
	StateReady
	StateWatching
	StateError
	StateJobDetails
	StateLogViewer
	StateBranchSelection
	StateStatusFilter
	StateHelp
	StateWorkflowViewer
	StateArtifactSelection
	StateLogFilter      // v0.6: Log filter selection
	StateMultiJobSelect // v0.6: Multi-job selection for following
	StateCompareSelect  // v0.6: Run selection for comparison
	StateCompareView    // v0.6: Viewing log comparison
)

type Styles

type Styles struct {
	// Header styles
	RepoName  lipgloss.Style
	Branch    lipgloss.Style
	Separator lipgloss.Style

	// Status badge styles
	StatusSuccess    lipgloss.Style
	StatusFailure    lipgloss.Style
	StatusInProgress lipgloss.Style
	StatusQueued     lipgloss.Style

	// Job table styles
	JobName     lipgloss.Style
	JobDuration lipgloss.Style
	JobTimeAgo  lipgloss.Style

	// Icon styles
	IconSuccess    lipgloss.Style
	IconFailure    lipgloss.Style
	IconInProgress lipgloss.Style
	IconQueued     lipgloss.Style
	IconSkipped    lipgloss.Style

	// Footer styles
	HelpKey  lipgloss.Style
	HelpDesc lipgloss.Style

	// General
	Dim      lipgloss.Style
	Bold     lipgloss.Style
	Selected lipgloss.Style

	// Error
	Error     lipgloss.Style
	ErrorHint lipgloss.Style

	// Watch indicator
	Watching lipgloss.Style

	// Log syntax highlighting (v0.6)
	LogError     lipgloss.Style
	LogWarning   lipgloss.Style
	LogCommand   lipgloss.Style
	LogGroup     lipgloss.Style
	LogTimestamp lipgloss.Style

	// Diff styles (v0.6)
	DiffAdded   lipgloss.Style
	DiffRemoved lipgloss.Style
}

Styles holds all the lipgloss styles used in the TUI

func DefaultStyles

func DefaultStyles(colorEnabled bool) *Styles

DefaultStyles returns the default style set

func (*Styles) StatusBadge

func (s *Styles) StatusBadge(status string, conclusion *string) string

StatusBadge returns a styled status badge text

func (*Styles) StatusIconStyled

func (s *Styles) StatusIconStyled(status string, conclusion *string) string

StatusIconStyled returns a styled icon for a status/conclusion

type TickMsg

type TickMsg struct {
	Time time.Time
}

TickMsg is sent for watch mode polling

type WorkflowLoadedMsg

type WorkflowLoadedMsg struct {
	Content string
	Path    string
}

WorkflowLoadedMsg is sent when workflow content is loaded

Jump to

Keyboard shortcuts

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