tui

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TitleStyle renders top-level titles with bold accent background
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.AdaptiveColor{Light: "255", Dark: "255"}).
				Background(colorAccent).
				Padding(0, 1)

	// HeaderStyle renders table/section headers
	HeaderStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(colorAccent)

	// SelectedStyle highlights the currently selected row
	SelectedStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.AdaptiveColor{Light: "232", Dark: "229"}).
					Background(colorHighlight)

	// BaseStyle is the default unstyled base
	BaseStyle = lipgloss.NewStyle()

	// MutedStyle renders secondary/less important text
	MutedStyle = lipgloss.NewStyle().
				Foreground(colorMuted)

	// ErrorStyle renders error messages
	ErrorStyle = lipgloss.NewStyle().
				Foreground(colorUnhealthy).
				Bold(true)

	// SuccessStyle renders success/status messages
	SuccessStyle = lipgloss.NewStyle().
					Foreground(colorHealthy)

	// StatusBarStyle renders the bottom status bar
	StatusBarStyle = lipgloss.NewStyle().
					Foreground(colorMuted).
					Background(colorBgDark).
					Padding(0, 1)

	// HelpStyle renders keybinding hints
	HelpStyle = lipgloss.NewStyle().
				Foreground(colorMuted)
)

Functions

func NewModel

func NewModel(ctx context.Context, client Client, refreshInterval time.Duration) model

NewModel creates a new TUI model. The context controls the lifetime of all API calls; cancel it to cleanly abort in-flight requests on shutdown.

func RenderError

func RenderError(err error) string

RenderError formats an error with ErrorStyle

func RenderHelp

func RenderHelp(text string) string

RenderHelp wraps help text with HelpStyle

func RenderTitle

func RenderTitle(text string) string

RenderTitle wraps text with TitleStyle

Types

type Client

type Client interface {
	GetServers(ctx context.Context) ([]map[string]interface{}, error)
	ListActivities(ctx context.Context, filter cliclient.ActivityFilterParams) ([]map[string]interface{}, int, error)
	ServerAction(ctx context.Context, name, action string) error
	TriggerOAuthLogin(ctx context.Context, name string) error
}

Client defines the interface for API operations

type UIMode

type UIMode string

UIMode represents the current interaction mode

const (
	ModeNormal     UIMode = "normal"      // Navigate table
	ModeFilterEdit UIMode = "filter_edit" // Edit filters
	ModeSortSelect UIMode = "sort_select" // Choose sort column
	ModeSearch     UIMode = "search"      // Text search
	ModeHelp       UIMode = "help"        // Show keybindings
)

Jump to

Keyboard shortcuts

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