Documentation
¶
Index ¶
- Variables
- func Error(msg string) string
- func ErrorWithDetails(msg string, details []string) string
- func Info(msg string) string
- func RunConfirm(model ConfirmModel) (bool, error)
- func RunDashboard(model DashboardModel) (string, error)
- func RunPicker(model PickerModel) (*session.Session, error)
- func RunTable(model TableModel) ([]string, error)
- func Success(msg string) string
- func Warning(msg string) string
- type ConfirmModel
- type DashboardModel
- type MenuItem
- type PickerModel
- type TableModel
Constants ¶
This section is empty.
Variables ¶
var ( // Status colors SuccessColor = lipgloss.Color("#00D787") // Bright green ErrorColor = lipgloss.Color("#FF5F87") // Bright red WarningColor = lipgloss.Color("#FFD700") // Gold/yellow InfoColor = lipgloss.Color("#5FAFD7") // Blue MutedColor = lipgloss.Color("#6C6C6C") // Gray // Session type colors RegularColor = lipgloss.Color("#FFFFFF") // White/default ForkColor = lipgloss.Color("#00D7D7") // Cyan IncognitoColor = lipgloss.Color("#6C6C6C") // Dim gray )
Color palette
var ( BoldStyle = lipgloss.NewStyle().Bold(true) DimStyle = lipgloss.NewStyle().Foreground(MutedColor) ItalicStyle = lipgloss.NewStyle().Italic(true) // Status text styles SuccessStyle = lipgloss.NewStyle().Foreground(SuccessColor).Bold(true) ErrorStyle = lipgloss.NewStyle().Foreground(ErrorColor).Bold(true) WarningStyle = lipgloss.NewStyle().Foreground(WarningColor).Bold(true) InfoStyle = lipgloss.NewStyle().Foreground(InfoColor).Bold(true) )
Base text styles
var ( // Base box style with padding BoxStyle = lipgloss.NewStyle(). Padding(0, 1). Border(lipgloss.RoundedBorder()) // Session type box styles RegularBoxStyle = BoxStyle. BorderForeground(RegularColor) ForkBoxStyle = BoxStyle. BorderForeground(ForkColor) IncognitoBoxStyle = BoxStyle. BorderForeground(IncognitoColor) // Status box styles ErrorBoxStyle = BoxStyle. BorderForeground(ErrorColor). Padding(1, 2) WarningBoxStyle = BoxStyle. BorderForeground(WarningColor). Padding(1, 2) InfoBoxStyle = BoxStyle. BorderForeground(InfoColor). Padding(1, 2) )
Box and border styles
Functions ¶
func ErrorWithDetails ¶
ErrorWithDetails renders an error message with optional detail lines
func RunConfirm ¶
func RunConfirm(model ConfirmModel) (bool, error)
RunConfirm runs the confirmation dialog and returns true if confirmed
func RunDashboard ¶
func RunDashboard(model DashboardModel) (string, error)
RunDashboard runs the dashboard and returns the selected action
func RunPicker ¶
func RunPicker(model PickerModel) (*session.Session, error)
RunPicker runs the session picker and returns the selected session
func RunTable ¶
func RunTable(model TableModel) ([]string, error)
RunTable runs the table and returns the selected row data (or nil if cancelled)
Types ¶
type ConfirmModel ¶
type ConfirmModel struct {
Title string
Message string
Details []string
Destructive bool
Confirmed bool
Cancelled bool
Focused int // 0 = Cancel (default), 1 = Confirm
}
ConfirmModel represents the confirmation dialog state
func NewConfirm ¶
func NewConfirm(title, message string) ConfirmModel
NewConfirm creates a new confirmation dialog
func (ConfirmModel) Init ¶
func (m ConfirmModel) Init() tea.Cmd
Init initializes the model (required by bubbletea)
func (ConfirmModel) WithDestructive ¶
func (m ConfirmModel) WithDestructive() ConfirmModel
WithDestructive marks the action as destructive (red styling)
func (ConfirmModel) WithDetails ¶
func (m ConfirmModel) WithDetails(details []string) ConfirmModel
WithDetails adds detail lines to the confirmation dialog
type DashboardModel ¶
type DashboardModel struct {
Sessions []*session.Session
Cursor int
Selected string // Selected action ID
Cancelled bool
Width int
Height int
// contains filtered or unexported fields
}
DashboardModel represents the main dashboard state
func NewDashboard ¶
func NewDashboard(sessions []*session.Session) DashboardModel
NewDashboard creates a new dashboard model
func (DashboardModel) Init ¶
func (m DashboardModel) Init() tea.Cmd
Init initializes the model (required by bubbletea)
type PickerModel ¶
type PickerModel struct {
Sessions []*session.Session
Cursor int
Selected *session.Session
Cancelled bool
Title string
FilterText string
Filtering bool
ShowPreview bool // Show preview pane with session metadata
}
PickerModel represents the session picker state
func NewPicker ¶
func NewPicker(sessions []*session.Session, title string) PickerModel
NewPicker creates a new session picker
func (PickerModel) Init ¶
func (m PickerModel) Init() tea.Cmd
Init initializes the model (required by bubbletea)
func (PickerModel) WithPreview ¶
func (m PickerModel) WithPreview() PickerModel
WithPreview enables the preview pane
type TableModel ¶
type TableModel struct {
Headers []string
Rows [][]string
Cursor int
Selected int // -1 if cancelled
SelectedRow []string // actual selected row data
Cancelled bool
SortColumn int // -1 for no sort, 0+ for column index
SortAscending bool // true for ascending, false for descending
FilterText string // current filter text
Filtering bool // whether in filter mode
// contains filtered or unexported fields
}
TableModel represents a table with headers, rows, and cursor navigation
func NewTable ¶
func NewTable(headers []string, rows [][]string) TableModel
NewTable creates a new table model
func (TableModel) Init ¶
func (m TableModel) Init() tea.Cmd
Init initializes the model (required by bubbletea)
func (TableModel) WithSorting ¶
func (m TableModel) WithSorting() TableModel
WithSorting enables sorting on this table