ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StyleSidebarItem = lipgloss.NewStyle().
						Padding(0, 1)

	StyleSidebarItemSelected = lipgloss.NewStyle().
								Padding(0, 1).
								Background(colorHighlight).
								Foreground(lipgloss.AdaptiveColor{Light: "#FFFFFF", Dark: "#1E1E2E"}).
								Bold(true)
)
View Source
var (
	StyleDotStopped    = lipgloss.NewStyle().Foreground(colorStopped)
	StyleDotStarting   = lipgloss.NewStyle().Foreground(colorStarting)
	StyleDotRunning    = lipgloss.NewStyle().Foreground(colorRunning)
	StyleDotReady      = lipgloss.NewStyle().Foreground(colorReady)
	StyleDotCrashed    = lipgloss.NewStyle().Foreground(colorCrashed)
	StyleDotRestarting = lipgloss.NewStyle().Foreground(colorRestarting)
)
View Source
var (
	// Subtle background tint on the cursor line when viewport is focused.
	// We avoid Foreground/Underline here because the line already carries ANSI
	// codes from applyHighlight — layering another fg style produces broken
	// escape sequences. Background-only is safe on pre-styled text.
	StyleCursorLine = lipgloss.NewStyle().
					Background(lipgloss.AdaptiveColor{Light: "#DDEEFF", Dark: "#313244"})

	// Stronger background for lines inside an active selection.
	StyleSelectedLine = lipgloss.NewStyle().
						Background(lipgloss.AdaptiveColor{Light: "#CCE5FF", Dark: "#45475A"})
)
View Source
var (
	StyleHelp = lipgloss.NewStyle().
				Foreground(colorSubtle).
				Padding(0, 1)

	StyleHelpKey = lipgloss.NewStyle().
					Foreground(colorHighlight).
					Bold(true)

	StyleHelpDesc = lipgloss.NewStyle().
					Foreground(colorSubtle)
)
View Source
var (
	// StyleModal is the outer box of the worktree picker overlay.
	StyleModal = lipgloss.NewStyle().
				BorderStyle(lipgloss.RoundedBorder()).
				BorderForeground(colorHighlight).
				Padding(0, 1)

	StyleModalTitle = lipgloss.NewStyle().
					Bold(true).
					Foreground(colorHighlight).
					Padding(0, 1)

	StyleModalItem = lipgloss.NewStyle().
					Padding(0, 1)

	StyleModalItemSelected = lipgloss.NewStyle().
							Padding(0, 1).
							Background(colorHighlight).
							Foreground(lipgloss.AdaptiveColor{Light: "#FFFFFF", Dark: "#1E1E2E"}).
							Bold(true)

	StyleModalHint = lipgloss.NewStyle().
					Foreground(colorSubtle).
					Padding(0, 1)
)

Functions

func HighlightStyle

func HighlightStyle(colorName string) lipgloss.Style

HighlightStyle returns a lipgloss Style that applies the named colour as a foreground. If the name is not in the palette map it is forwarded directly to lipgloss as a hex/ANSI colour string.

Types

type KeyMap

type KeyMap struct {
	// ── Navigation ───────────────────────────────────────────────────────────
	Up         key.Binding
	Down       key.Binding
	PageUp     key.Binding
	PageDown   key.Binding
	GotoTop    key.Binding
	GotoBottom key.Binding

	// ── Pane focus ───────────────────────────────────────────────────────────
	FocusNext key.Binding // Tab — cycle focus between sidebar / viewport

	// ── Process control ──────────────────────────────────────────────────────
	Start   key.Binding // s — start focused process
	Stop    key.Binding // x — stop focused process
	Restart key.Binding // r — restart focused process
	Clear   key.Binding // c — clear output buffer of focused process

	// ── Worktree ─────────────────────────────────────────────────────────────
	Worktree key.Binding // w — open worktree switcher

	// ── Selection ────────────────────────────────────────────────────────────
	Select key.Binding // v — enter/exit selection mode
	Yank   key.Binding // y — copy selected lines via OSC 52
	Escape key.Binding // esc — cancel selection mode

	// ── Search (later stage) ─────────────────────────────────────────────────
	Search key.Binding // / — open search input

	// ── Application ──────────────────────────────────────────────────────────
	Quit key.Binding // q / ctrl+c
	Help key.Binding // ? — toggle full help
}

KeyMap holds all keybinding definitions for lazyproc. Using bubbles/key so bindings integrate cleanly with the bubbles/help bar.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default production keybindings.

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns the full set of bindings shown when the user presses '?'. Implements the help.KeyMap interface from bubbles/help.

func (KeyMap) FullHelpVisual

func (k KeyMap) FullHelpVisual() [][]key.Binding

FullHelpVisual returns the full help layout used while in visual mode.

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns the condensed set of bindings shown in normal mode.

func (KeyMap) ShortHelpVisual

func (k KeyMap) ShortHelpVisual() []key.Binding

ShortHelpVisual returns the condensed set of bindings shown in visual mode.

type Model

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

Model is the root Bubbletea model for lazyproc.

func NewModel

func NewModel(cfg *config.Config) Model

NewModel constructs the root model from a parsed config. It wires up state-change and output callbacks so the Bubbletea program receives messages from background goroutines via a shared channel.

func (Model) Init

func (m Model) Init() tea.Cmd

Init is called once by Bubbletea before the first render.

func (Model) Update

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

Update handles all incoming messages and returns the updated model plus any commands to run next.

func (Model) View

func (m Model) View() string

View renders the full TUI layout.

type ProcessOutputMsg

type ProcessOutputMsg struct {
	ID   string
	Line process.OutputLine
}

ProcessOutputMsg is sent by the pipe-reader goroutine for each captured line.

type ProcessStateMsg

type ProcessStateMsg struct {
	ID    string
	State process.State
}

ProcessStateMsg is sent whenever a process changes state.

type TermSizeMsg

type TermSizeMsg struct {
	Width  int
	Height int
}

TermSizeMsg is sent on terminal resize.

Jump to

Keyboard shortcuts

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