Documentation
¶
Index ¶
- Variables
- func Run(containerPrefix string, cachedState *CachedState) (*TUIResult, *CachedState, error)
- type ActionType
- type CachedState
- type ConfirmActionMsg
- type ContainerActionMsg
- type Modal
- func NewConfirmModal(title, content string, onConfirm, onCancel func() tea.Msg) *Modal
- func NewErrorModal(title, content string) *Modal
- func NewInfoModal(title, content string) *Modal
- func NewLoadingModal(title, message string, determinate bool) *Modal
- func NewScrollableHelpModal(title, content string, contentHeight int) *Modal
- func NewScrollableInfoModal(title, content string, contentHeight int) *Modal
- func NewScrollableInfoModalWide(title, content string, contentHeight, width int) *Modal
- func (m *Modal) GetContextHelp() []key.Binding
- func (m *Modal) Init() tea.Cmd
- func (m *Modal) RenderWithBackground(background string, screenWidth, screenHeight int) string
- func (m *Modal) SetProgress(percent float64) tea.Cmd
- func (m *Modal) Update(msg tea.Msg) (*Modal, tea.Cmd)
- func (m *Modal) View(screenWidth, screenHeight int) string
- type ModalAction
- type ModalType
- type Model
- type TUIResult
Constants ¶
This section is empty.
Variables ¶
var ( PurpleHaze = style.PurpleHaze CrimsonPulse = style.CrimsonPulse SunsetGlow = style.SunsetGlow )
Primary Colors
var ( OceanTide = style.OceanTide OceanSurge = style.OceanSurge OceanDepth = style.OceanDepth OceanAbyss = style.OceanAbyss HotPink = style.HotPink NeonGreen = style.NeonGreen )
Accent Colors (Maestro-Specific)
var ( GhostWhite = style.GhostWhite SilverMist = style.SilverMist DimGray = style.DimGray DeepSpace = style.DeepSpace )
Grayscale
var ( FocusedBorder = style.FocusedBorder UnfocusedBorder = style.UnfocusedBorder )
Focus
var ( GetOceanTideShade = style.GetOceanTideShade GetDaemonShade = style.GetDaemonShade )
Re-export functions
Functions ¶
func Run ¶
func Run(containerPrefix string, cachedState *CachedState) (*TUIResult, *CachedState, error)
Run launches the TUI and returns the result and final state Pass cached state from previous run for instant rendering
Types ¶
type ActionType ¶
type ActionType int
ActionType defines what action the TUI wants the caller to perform
const ( ActionNone ActionType = iota ActionQuit ActionConnect // Connect to a container ActionEditConfig // Edit config file ActionRunCommand // Run a CLI command ActionCreate // Create a new container ActionRunAuth // Run maestro auth command )
type CachedState ¶
CachedState holds TUI state for seamless return
type ConfirmActionMsg ¶
type ConfirmActionMsg struct {
Action container.OperationType
ContainerName string
}
ConfirmActionMsg signals that a confirmed action should be executed
type ContainerActionMsg ¶
type ContainerActionMsg struct {
Action container.OperationType
ContainerName string
}
ContainerActionMsg signals a container action should be performed
type Modal ¶
type Modal struct {
Type ModalType
Title string
Content string // Main content (can be multi-line) - used if viewport is nil
Width int // Modal width (0 = auto)
Height int // Modal height (0 = auto)
Actions []ModalAction // Buttons
SelectedAction int // Currently selected action index
DisableEsc bool // Disable Esc key for modal dismissal (for wizard)
// contains filtered or unexported fields
}
Modal represents a modal dialog
func NewConfirmModal ¶
NewConfirmModal creates a confirmation modal
func NewErrorModal ¶
NewErrorModal creates an error modal
func NewInfoModal ¶
NewInfoModal creates an info modal
func NewLoadingModal ¶
NewLoadingModal creates a loading modal with progress or spinner
func NewScrollableHelpModal ¶
NewScrollableHelpModal creates a help modal with scrollable content
func NewScrollableInfoModal ¶
NewScrollableInfoModal creates an info modal with scrollable content
func NewScrollableInfoModalWide ¶
NewScrollableInfoModalWide creates an info modal with scrollable content and custom width
func (*Modal) GetContextHelp ¶
GetContextHelp returns context-specific help bindings based on modal state Returns nil if the modal doesn't support context-specific help
func (*Modal) RenderWithBackground ¶
RenderWithBackground renders modal centered on dimmed background
func (*Modal) SetProgress ¶
SetProgress updates the progress bar percentage (0.0 to 1.0)
type ModalAction ¶
type ModalAction struct {
Label string
Key string // Keyboard shortcut (e.g., "y", "n", "enter")
IsPrimary bool // Primary actions highlighted
OnSelect func() tea.Msg
}
ModalAction represents a button in the modal
type ModalType ¶
type ModalType int
ModalType defines the type of modal
const ( ModalNone ModalType = iota ModalInfo // Information message ModalError // Error message (Crimson Pulse) ModalConfirm // Yes/No confirmation ModalHelp // Help/keybindings ModalActions // Container actions menu ModalContainerDetails // Container info (i key) ModalLoading // Loading with progress bar ModalForm // Interactive form with multiple fields )
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main TUI model
func NewWithCache ¶
func NewWithCache(containerPrefix string, cached *CachedState) *Model
NewWithCache creates a new TUI model with optional cached state
func (Model) GetState ¶
func (m Model) GetState() *CachedState
GetState exports the current state for caching
type TUIResult ¶
type TUIResult struct {
Action ActionType
ContainerName string
FilePath string
TaskDescription string // For ActionCreate
BranchName string // For ActionCreate
NoConnect bool // For ActionCreate
Exact bool // For ActionCreate
}
TUIResult is returned when the TUI exits, telling the caller what action to take