ui

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Event type colors
	ColorPush    = lipgloss.Color("#22c55e") // green
	ColorPR      = lipgloss.Color("#3b82f6") // blue
	ColorReview  = lipgloss.Color("#a855f7") // purple
	ColorComment = lipgloss.Color("#06b6d4") // cyan
	ColorIssue   = lipgloss.Color("#eab308") // yellow
	ColorCreate  = lipgloss.Color("#22c55e") // green
	ColorDelete  = lipgloss.Color("#ef4444") // red
	ColorRelease = lipgloss.Color("#f97316") // orange
	ColorLocal   = lipgloss.Color("#a78bfa") // light purple
	ColorDim     = lipgloss.Color("#6b7280") // gray

	// Layout styles
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("#ffffff")).
				PaddingLeft(1)

	SubtitleStyle = lipgloss.NewStyle().
					Foreground(ColorDim).
					PaddingLeft(1)

	TimeStyle = lipgloss.NewStyle().
				Foreground(ColorDim).
				Width(20)

	RepoStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#ffffff")).
				Bold(true).
				Width(18)

	ActorStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#d1d5db")).
				Width(22)

	DetailStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#9ca3af"))

	StatusBarStyle = lipgloss.NewStyle().
					Foreground(ColorDim).
					PaddingLeft(1)

	HelpStyle = lipgloss.NewStyle().
				Foreground(ColorDim)

	FlashMarker = lipgloss.NewStyle().
				Foreground(lipgloss.Color("#22c55e")).
				Bold(true)

	// Status panel styles
	PanelBorderStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(lipgloss.Color("#3b3b3b")).
						Padding(0, 1)

	PanelTitleStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("#ffffff"))

	PanelDividerStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("#3b3b3b"))

	PanelRepoStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("#3b82f6"))

	PanelDimStyle = lipgloss.NewStyle().
					Foreground(ColorDim)

	PanelCleanStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#22c55e"))

	PanelDirtyStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#eab308"))

	PanelWarnStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#f97316"))

	PanelCIFailStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("#ef4444"))

	DividerStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#3b3b3b"))

	CursorMarker = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#3b82f6")).
					Bold(true)

	CursorRowBg = lipgloss.NewStyle().
				Background(lipgloss.Color("#1a1a2e"))

	FocusBadgeActive = lipgloss.NewStyle().
						Bold(true).
						Foreground(lipgloss.Color("#000000")).
						Background(lipgloss.Color("#3b82f6")).
						Padding(0, 1)

	FocusBadgeInactive = lipgloss.NewStyle().
						Foreground(ColorDim).
						Padding(0, 1)
)

Functions

func EventColor

func EventColor(eventType string) lipgloss.Color

EventColor returns the color for a given event type.

func LabelStyle

func LabelStyle(eventType string) lipgloss.Style

LabelStyle returns a styled label for a given event type.

Types

type DebugLog added in v0.2.0

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

DebugLog is a thread-safe circular log buffer.

func NewDebugLog added in v0.2.0

func NewDebugLog() *DebugLog

func (*DebugLog) Error added in v0.2.0

func (d *DebugLog) Error(format string, args ...interface{})

func (*DebugLog) GetEntries added in v0.2.0

func (d *DebugLog) GetEntries() []LogEntry

func (*DebugLog) GetStats added in v0.2.0

func (d *DebugLog) GetStats() FetchStats

func (*DebugLog) Info added in v0.2.0

func (d *DebugLog) Info(format string, args ...interface{})

func (*DebugLog) Log added in v0.2.0

func (d *DebugLog) Log(level LogLevel, format string, args ...interface{})

func (*DebugLog) RecordFetch added in v0.2.0

func (d *DebugLog) RecordFetch(repo string, success bool, eventCount int, usingCache bool)

func (*DebugLog) SetRateLimit added in v0.2.5

func (d *DebugLog) SetRateLimit(remaining, limit int)

func (*DebugLog) Warn added in v0.2.0

func (d *DebugLog) Warn(format string, args ...interface{})

type DisplayEvent

type DisplayEvent struct {
	Event   github.Event
	AddedAt time.Time
}

DisplayEvent holds a parsed event for display.

type FetchStats added in v0.2.0

type FetchStats struct {
	TotalCalls   int
	SuccessCalls int
	FailedCalls  int
	TotalEvents  int
	LastFetchAt  time.Time
	RepoHealth   map[string]*RepoHealth
	RateRemain   int // GitHub API rate limit remaining
	RateLimit    int // GitHub API rate limit total
}

FetchStats tracks API call statistics.

type LogEntry added in v0.2.0

type LogEntry struct {
	Time    time.Time
	Level   LogLevel
	Message string
}

LogEntry is a single debug log entry.

type LogLevel added in v0.2.0

type LogLevel int

LogLevel indicates severity.

const (
	LogInfo LogLevel = iota
	LogWarn
	LogError
)

type Model

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

Model is the main Bubble Tea model.

func NewModel

func NewModel(cfg *config.Config) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type RepoHealth added in v0.2.5

type RepoHealth struct {
	LastSuccess bool
	FailStreak  int
	UsingCache  bool // true when serving cached events due to fetch failure
}

RepoHealth tracks per-repo fetch health.

Jump to

Keyboard shortcuts

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