Documentation
¶
Overview ¶
Package tui contains reusable TUI components
Package tui contains diagnostic view models for TUI integration ¶
Package tui contains help view components ¶
Package tui contains help section adapters for scrollable help content ¶
Package tui contains the terminal user interface components using Bubble Tea ¶
Package tui contains navigation components for the TUI ¶
Package tui contains pager component for scrollable content ¶
MIGRATION GUIDE:
The Pager component has been enhanced to work with the new standardized scrolling system. Existing code using Pager will continue to work unchanged, but new code should consider using the StandardScrollPager or ScrollableView components for better consistency.
Migration options:
- Keep using Pager (no changes needed): pager := NewPager() pager.SetContent("your content")
- Use PagerScrollableAdapter for ScrollableList compatibility: pager := NewPager() adapter := NewPagerScrollableAdapter(pager) adapter.SetItems([]ScrollableItem{...})
- Migrate to StandardScrollPager (recommended for new code): scrollPager := NewStandardScrollPager() scrollPager.SetItems([]ScrollableItem{...})
- Use ScrollableView for viewport-based scrolling: view := NewScrollableView() view.SetItems([]ScrollableItem{...}) // New scrollable list mode // OR view.SetContent("string content") // Legacy string mode
Package tui contains animated progress components ¶
Package tui contains result view models for displaying diagnostic results ¶
Package tui contains core scrolling interfaces and types for standardized scroll behavior ¶
Package tui contains scrollable view components ¶
Package tui contains the StandardScrollPager implementation ¶
Package tui contains test harness for TUI interaction testing ¶
Package tui contains theme system for the TUI
Index ¶
- func CalculateTotalHelpHeight(sections []ScrollableItem) int
- func MockTUITestComponent() domain.TUIComponent
- type AnimatedProgress
- func (p *AnimatedProgress) IsActive() bool
- func (p *AnimatedProgress) SetMessage(message string)
- func (p *AnimatedProgress) SetSize(width, height int)
- func (p *AnimatedProgress) SetTheme(theme domain.Theme)
- func (p *AnimatedProgress) Start(message string) tea.Cmd
- func (p *AnimatedProgress) Stop()
- func (p *AnimatedProgress) Update(msg tea.Msg) (*AnimatedProgress, tea.Cmd)
- func (p *AnimatedProgress) View() string
- type AppState
- type DarkTheme
- type DefaultTheme
- type DiagnosticErrorMsg
- type DiagnosticResultMsg
- type DiagnosticStartMsg
- type DiagnosticViewModel
- func (m *DiagnosticViewModel) Blur()
- func (m *DiagnosticViewModel) Focus()
- func (m *DiagnosticViewModel) GetError() error
- func (m *DiagnosticViewModel) GetResult() domain.Result
- func (m *DiagnosticViewModel) GetState() DiagnosticViewState
- func (m *DiagnosticViewModel) GetTool() domain.DiagnosticTool
- func (m *DiagnosticViewModel) Init() tea.Cmd
- func (m *DiagnosticViewModel) IsLoading() bool
- func (m *DiagnosticViewModel) SetSize(width, height int)
- func (m *DiagnosticViewModel) SetTheme(theme domain.Theme)
- func (m *DiagnosticViewModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *DiagnosticViewModel) View() string
- type DiagnosticViewState
- type FormField
- type FormModel
- func (m *FormModel) AddField(key, label string, required bool)
- func (m *FormModel) Blur()
- func (m *FormModel) Focus()
- func (m *FormModel) GetFieldValue(key string) string
- func (m *FormModel) GetValues() map[string]string
- func (m *FormModel) Init() tea.Cmd
- func (m *FormModel) SetFieldValue(key, value string)
- func (m *FormModel) SetSize(width, height int)
- func (m *FormModel) SetTheme(theme domain.Theme)
- func (m *FormModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *FormModel) View() string
- type FormSubmitMsg
- type HelpItem
- type HelpModel
- type HelpSection
- type KeyMap
- type LightTheme
- type MainModel
- type NavigationAction
- type NavigationItem
- type NavigationModel
- func (m *NavigationModel) AddBreadcrumb(crumb string)
- func (m *NavigationModel) AddItem(item NavigationItem)
- func (m *NavigationModel) Blur()
- func (m *NavigationModel) DisableItem(id string)
- func (m *NavigationModel) EnableItem(id string)
- func (m *NavigationModel) Focus()
- func (m *NavigationModel) GetBreadcrumbs() []string
- func (m *NavigationModel) GetSelected() *NavigationItem
- func (m *NavigationModel) Init() tea.Cmd
- func (m *NavigationModel) PopBreadcrumb() string
- func (m *NavigationModel) RemoveItem(id string)
- func (m *NavigationModel) SetSelected(index int)
- func (m *NavigationModel) SetSize(width, height int)
- func (m *NavigationModel) SetTheme(theme domain.Theme)
- func (m *NavigationModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *NavigationModel) View() string
- type NavigationMsg
- type Pager
- func (p *Pager) Blur()
- func (p *Pager) CanScrollDown() bool
- func (p *Pager) CanScrollUp() bool
- func (p *Pager) Focus()
- func (p *Pager) GetScrollPosition() (int, int)
- func (p *Pager) SetContent(content string)
- func (p *Pager) SetContentLines(lines []string)
- func (p *Pager) SetShowScrollIndicators(show bool)
- func (p *Pager) SetSize(width, height int)
- func (p *Pager) SetTheme(theme domain.Theme)
- func (p *Pager) Update(msg tea.Msg) (*Pager, tea.Cmd)
- func (p *Pager) View() string
- type PagerScrollableAdapter
- func (p *PagerScrollableAdapter) AddItem(item ScrollableItem)
- func (p *PagerScrollableAdapter) End() bool
- func (p *PagerScrollableAdapter) GetItems() []ScrollableItem
- func (p *PagerScrollableAdapter) GetScrollPosition() ScrollPosition
- func (p *PagerScrollableAdapter) GetSelected() int
- func (p *PagerScrollableAdapter) GetVisibleRange() (start, end int)
- func (p *PagerScrollableAdapter) Home() bool
- func (p *PagerScrollableAdapter) Init() tea.Cmd
- func (p *PagerScrollableAdapter) IsItemVisible(index int) bool
- func (p *PagerScrollableAdapter) MoveDown() bool
- func (p *PagerScrollableAdapter) MoveUp() bool
- func (p *PagerScrollableAdapter) PageDown() bool
- func (p *PagerScrollableAdapter) PageUp() bool
- func (p *PagerScrollableAdapter) RemoveItem(index int)
- func (p *PagerScrollableAdapter) ScrollToItem(index int)
- func (p *PagerScrollableAdapter) SetItems(items []ScrollableItem)
- func (p *PagerScrollableAdapter) SetSelected(index int)
- func (p *PagerScrollableAdapter) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- type ProgressBar
- func (p *ProgressBar) IsComplete() bool
- func (p *ProgressBar) SetMessage(message string)
- func (p *ProgressBar) SetProgress(current, total int)
- func (p *ProgressBar) SetShowPercentage(show bool)
- func (p *ProgressBar) SetSize(width, height int)
- func (p *ProgressBar) SetTheme(theme domain.Theme)
- func (p *ProgressBar) View() string
- type ProgressModel
- func (m *ProgressModel) Blur()
- func (m *ProgressModel) Focus()
- func (m *ProgressModel) Init() tea.Cmd
- func (m *ProgressModel) IsComplete() bool
- func (m *ProgressModel) SetMessage(message string)
- func (m *ProgressModel) SetProgress(current, total int)
- func (m *ProgressModel) SetSize(width, height int)
- func (m *ProgressModel) SetTheme(theme domain.Theme)
- func (m *ProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *ProgressModel) View() string
- type ProgressTickMsg
- type ResponsiveLayout
- func (rl *ResponsiveLayout) GetColumnCount() int
- func (rl *ResponsiveLayout) GetContentArea(headerHeight, footerHeight int) (int, int)
- func (rl *ResponsiveLayout) GetFormWidth() int
- func (rl *ResponsiveLayout) GetMaxTableWidth() int
- func (rl *ResponsiveLayout) IsLargeScreen() bool
- func (rl *ResponsiveLayout) IsMediumScreen() bool
- func (rl *ResponsiveLayout) IsSmallScreen() bool
- func (rl *ResponsiveLayout) SetSize(width, height int)
- type ResultViewMode
- type ResultViewModel
- func (m *ResultViewModel) Blur()
- func (m *ResultViewModel) Focus()
- func (m *ResultViewModel) Init() tea.Cmd
- func (m *ResultViewModel) SetResult(result domain.Result)
- func (m *ResultViewModel) SetSize(width, height int)
- func (m *ResultViewModel) SetTheme(theme domain.Theme)
- func (m *ResultViewModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *ResultViewModel) View() string
- type SSLCheckCompleteMsg
- type SSLCheckErrorMsg
- type ScrollPosition
- func (sp ScrollPosition) CanScrollDown(itemCount int) bool
- func (sp ScrollPosition) CanScrollUp() bool
- func (sp *ScrollPosition) EnsureSelectionVisible(itemCount int)
- func (sp ScrollPosition) GetVisibleRange(itemCount int) (start, end int)
- func (sp ScrollPosition) IsItemVisible(index int) bool
- func (sp ScrollPosition) IsValid(itemCount int) bool
- type ScrollableContent
- type ScrollableItem
- type ScrollableList
- type ScrollableView
- func (s *ScrollableView) AddItem(item ScrollableItem)
- func (s *ScrollableView) Blur()
- func (s *ScrollableView) DisableScrollableList()
- func (s *ScrollableView) EnableScrollableList()
- func (s *ScrollableView) End() bool
- func (s *ScrollableView) Focus()
- func (s *ScrollableView) GetItems() []ScrollableItem
- func (s *ScrollableView) GetScrollPercent() float64
- func (s *ScrollableView) GetScrollPosition() ScrollPosition
- func (s *ScrollableView) GetSelected() int
- func (s *ScrollableView) GetVisibleRange() (start, end int)
- func (s *ScrollableView) Home() bool
- func (s *ScrollableView) Init() tea.Cmd
- func (s *ScrollableView) IsItemVisible(index int) bool
- func (s *ScrollableView) MoveDown() bool
- func (s *ScrollableView) MoveUp() bool
- func (s *ScrollableView) PageDown() bool
- func (s *ScrollableView) PageUp() bool
- func (s *ScrollableView) RemoveItem(index int)
- func (s *ScrollableView) ScrollToBottom()
- func (s *ScrollableView) ScrollToItem(index int)
- func (s *ScrollableView) ScrollToTop()
- func (s *ScrollableView) SetContent(content string)
- func (s *ScrollableView) SetFooter(footer string)
- func (s *ScrollableView) SetHeader(header string)
- func (s *ScrollableView) SetItems(items []ScrollableItem)
- func (s *ScrollableView) SetSelected(index int)
- func (s *ScrollableView) SetSize(width, height int)
- func (s *ScrollableView) SetTheme(theme domain.Theme)
- func (s *ScrollableView) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (s *ScrollableView) View() string
- type StandardScrollPager
- func (p *StandardScrollPager) AddItem(item ScrollableItem)
- func (p *StandardScrollPager) Blur()
- func (p *StandardScrollPager) End() bool
- func (p *StandardScrollPager) Focus()
- func (p *StandardScrollPager) GetItems() []ScrollableItem
- func (p *StandardScrollPager) GetScrollPosition() ScrollPosition
- func (p *StandardScrollPager) GetSelected() int
- func (p *StandardScrollPager) GetVisibleRange() (start, end int)
- func (p *StandardScrollPager) Home() bool
- func (p *StandardScrollPager) Init() tea.Cmd
- func (p *StandardScrollPager) IsItemVisible(index int) bool
- func (p *StandardScrollPager) MoveDown() bool
- func (p *StandardScrollPager) MoveUp() bool
- func (p *StandardScrollPager) PageDown() bool
- func (p *StandardScrollPager) PageUp() bool
- func (p *StandardScrollPager) RemoveItem(index int)
- func (p *StandardScrollPager) ScrollToItem(index int)
- func (p *StandardScrollPager) SetItems(items []ScrollableItem)
- func (p *StandardScrollPager) SetSelected(index int)
- func (p *StandardScrollPager) SetShowScrollIndicators(show bool)
- func (p *StandardScrollPager) SetSize(width, height int)
- func (p *StandardScrollPager) SetTheme(theme domain.Theme)
- func (p *StandardScrollPager) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (p *StandardScrollPager) View() string
- type StringScrollableItem
- type TUITestHarness
- func (h *TUITestHarness) AssertOutput(expected string) bool
- func (h *TUITestHarness) AssertOutputNot(notExpected string) bool
- func (h *TUITestHarness) GetModel() tea.Model
- func (h *TUITestHarness) GetOutput() string
- func (h *TUITestHarness) GetOutputHistory() []string
- func (h *TUITestHarness) IsRunning() bool
- func (h *TUITestHarness) Read(p []byte) (n int, err error)
- func (h *TUITestHarness) SendKey(key tea.KeyType)
- func (h *TUITestHarness) SendKeyRune(r rune)
- func (h *TUITestHarness) SendKeyString(s string)
- func (h *TUITestHarness) SendMessage(msg tea.Msg)
- func (h *TUITestHarness) SendWindowSize(width, height int)
- func (h *TUITestHarness) Start() error
- func (h *TUITestHarness) Stop()
- func (h *TUITestHarness) WaitForOutput(text string, timeout time.Duration) bool
- func (h *TUITestHarness) WaitForOutputMatch(predicate func(string) bool, timeout time.Duration) bool
- type TUITestSuite
- func (s *TUITestSuite) Cleanup()
- func (s *TUITestSuite) CreateHarness(model tea.Model) *TUITestHarness
- func (s *TUITestSuite) TestFormInteraction(harness *TUITestHarness) error
- func (s *TUITestSuite) TestKeyboardShortcuts(harness *TUITestHarness) error
- func (s *TUITestSuite) TestNavigationFlow(harness *TUITestHarness) error
- func (s *TUITestSuite) TestResponsiveLayout(harness *TUITestHarness) error
- type TableModel
- func (m *TableModel) AddRow(row []string)
- func (m *TableModel) Blur()
- func (m *TableModel) Focus()
- func (m *TableModel) Init() tea.Cmd
- func (m *TableModel) SetData(rows [][]string)
- func (m *TableModel) SetFilter(filter string)
- func (m *TableModel) SetSize(width, height int)
- func (m *TableModel) SetTheme(theme domain.Theme)
- func (m *TableModel) SortBy(column int, descending bool)
- func (m *TableModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *TableModel) View() string
- type TableSelectMsg
- type ThemeManager
- func (tm *ThemeManager) ApplyThemeToComponent(component domain.TUIComponent)
- func (tm *ThemeManager) GetAvailableThemes() []string
- func (tm *ThemeManager) GetCurrentThemeName() string
- func (tm *ThemeManager) GetTheme() domain.Theme
- func (tm *ThemeManager) RegisterTheme(name string, theme domain.Theme)
- func (tm *ThemeManager) SetTheme(name string) bool
- type ViewState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateTotalHelpHeight ¶
func CalculateTotalHelpHeight(sections []ScrollableItem) int
CalculateTotalHelpHeight calculates the total height needed for all help sections
func MockTUITestComponent ¶
func MockTUITestComponent() domain.TUIComponent
MockTUITestComponent creates a mock component for testing
Types ¶
type AnimatedProgress ¶
type AnimatedProgress struct {
// contains filtered or unexported fields
}
AnimatedProgress provides animated progress indicators
func NewAnimatedProgress ¶
func NewAnimatedProgress() *AnimatedProgress
NewAnimatedProgress creates a new animated progress indicator
func (*AnimatedProgress) IsActive ¶
func (p *AnimatedProgress) IsActive() bool
IsActive returns whether the progress indicator is active
func (*AnimatedProgress) SetMessage ¶
func (p *AnimatedProgress) SetMessage(message string)
SetMessage updates the progress message
func (*AnimatedProgress) SetSize ¶
func (p *AnimatedProgress) SetSize(width, height int)
SetSize sets the progress indicator dimensions
func (*AnimatedProgress) SetTheme ¶
func (p *AnimatedProgress) SetTheme(theme domain.Theme)
SetTheme sets the progress indicator theme
func (*AnimatedProgress) Start ¶
func (p *AnimatedProgress) Start(message string) tea.Cmd
Start starts the progress animation
func (*AnimatedProgress) Update ¶
func (p *AnimatedProgress) Update(msg tea.Msg) (*AnimatedProgress, tea.Cmd)
Update handles progress animation updates
func (*AnimatedProgress) View ¶
func (p *AnimatedProgress) View() string
View renders the progress indicator
type DefaultTheme ¶
type DefaultTheme struct {
// contains filtered or unexported fields
}
DefaultTheme implements the domain.Theme interface
func NewDefaultTheme ¶
func NewDefaultTheme() *DefaultTheme
NewDefaultTheme creates a new default theme
func (*DefaultTheme) GetColor ¶
func (t *DefaultTheme) GetColor(element string) string
GetColor implements domain.Theme
func (*DefaultTheme) GetLipglossStyle ¶
func (t *DefaultTheme) GetLipglossStyle(element string) lipgloss.Style
GetLipglossStyle returns a lipgloss.Style for the given element
func (*DefaultTheme) GetStyle ¶
func (t *DefaultTheme) GetStyle(element string) map[string]interface{}
GetStyle implements domain.Theme
func (*DefaultTheme) SetColor ¶
func (t *DefaultTheme) SetColor(element, color string)
SetColor implements domain.Theme
type DiagnosticErrorMsg ¶
type DiagnosticErrorMsg struct {
Error error
}
type DiagnosticResultMsg ¶
type DiagnosticViewModel ¶
type DiagnosticViewModel struct {
// contains filtered or unexported fields
}
DiagnosticViewModel wraps diagnostic tools for TUI integration
func NewDiagnosticViewModel ¶
func NewDiagnosticViewModel(tool domain.DiagnosticTool) *DiagnosticViewModel
NewDiagnosticViewModel creates a new diagnostic view model
func (*DiagnosticViewModel) Blur ¶
func (m *DiagnosticViewModel) Blur()
Blur implements domain.TUIComponent
func (*DiagnosticViewModel) Focus ¶
func (m *DiagnosticViewModel) Focus()
Focus implements domain.TUIComponent
func (*DiagnosticViewModel) GetError ¶
func (m *DiagnosticViewModel) GetError() error
GetError returns the current error
func (*DiagnosticViewModel) GetResult ¶
func (m *DiagnosticViewModel) GetResult() domain.Result
GetResult returns the current result
func (*DiagnosticViewModel) GetState ¶
func (m *DiagnosticViewModel) GetState() DiagnosticViewState
GetState returns the current view state
func (*DiagnosticViewModel) GetTool ¶
func (m *DiagnosticViewModel) GetTool() domain.DiagnosticTool
GetTool returns the underlying diagnostic tool
func (*DiagnosticViewModel) Init ¶
func (m *DiagnosticViewModel) Init() tea.Cmd
Init implements tea.Model
func (*DiagnosticViewModel) IsLoading ¶
func (m *DiagnosticViewModel) IsLoading() bool
IsLoading returns whether the view is in loading state
func (*DiagnosticViewModel) SetSize ¶
func (m *DiagnosticViewModel) SetSize(width, height int)
SetSize implements domain.TUIComponent
func (*DiagnosticViewModel) SetTheme ¶
func (m *DiagnosticViewModel) SetTheme(theme domain.Theme)
SetTheme implements domain.TUIComponent
func (*DiagnosticViewModel) View ¶
func (m *DiagnosticViewModel) View() string
View implements tea.Model
type DiagnosticViewState ¶
type DiagnosticViewState int
DiagnosticViewState represents the current state of the diagnostic view
const ( DiagnosticStateInput DiagnosticViewState = iota DiagnosticStateLoading DiagnosticStateResult DiagnosticStateError )
type FormField ¶
type FormField struct {
Key string
Label string
Input textinput.Model
Required bool
Validator domain.Validator
HelpText string
ErrorText string
}
FormField represents a single form field
type FormModel ¶
type FormModel struct {
// contains filtered or unexported fields
}
FormModel provides input forms with validation
func NewFormModel ¶
NewFormModel creates a new form model
func (*FormModel) GetFieldValue ¶
GetFieldValue gets the value of a field
func (*FormModel) SetFieldValue ¶
SetFieldValue sets the value of a field
type FormSubmitMsg ¶
FormSubmitMsg represents a form submission message
type HelpItem ¶
type HelpItem struct {
// Key is the keyboard shortcut or command (e.g., "↑/↓ or j/k")
Key string
// Description explains what the key/command does
Description string
}
HelpItem represents an individual help entry within a section
func NewHelpItem ¶
NewHelpItem creates a new help item with key and description
type HelpModel ¶
type HelpModel struct {
// contains filtered or unexported fields
}
HelpModel displays help information and keyboard shortcuts using viewport for smooth scrolling
type HelpSection ¶
type HelpSection struct {
// Title is the section title (e.g., "Navigation & Scrolling")
Title string
// Items contains the help entries within this section
Items []HelpItem
// ID is a unique identifier for this section
ID string
}
HelpSection represents a section of help content that implements ScrollableItem
func GetHelpSectionByID ¶
func GetHelpSectionByID(sections []ScrollableItem, id string) *HelpSection
GetHelpSectionByID finds a help section by its ID
func NewHelpSection ¶
func NewHelpSection(title string, items []HelpItem) *HelpSection
NewHelpSection creates a new help section with the given title and items
func (*HelpSection) GetHeight ¶
func (hs *HelpSection) GetHeight() int
GetHeight implements ScrollableItem interface
func (*HelpSection) GetID ¶
func (hs *HelpSection) GetID() string
GetID implements ScrollableItem interface
func (*HelpSection) IsSelectable ¶
func (hs *HelpSection) IsSelectable() bool
IsSelectable implements ScrollableItem interface
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
Left key.Binding
Right key.Binding
Enter key.Binding
Back key.Binding
Quit key.Binding
Help key.Binding
Tab key.Binding
PageUp key.Binding
PageDown key.Binding
Home key.Binding
End key.Binding
}
KeyMap defines keyboard shortcuts for the application
type MainModel ¶
type MainModel struct {
// contains filtered or unexported fields
}
MainModel represents the root application model
func NewMainModel ¶
func NewMainModel(plugins domain.PluginRegistry, config *domain.Config, configManager *configpkg.Manager, theme domain.Theme) *MainModel
NewMainModel creates a new main application model
type NavigationAction ¶
type NavigationAction int
NavigationAction represents different navigation actions
const ( )
type NavigationItem ¶
type NavigationItem struct {
}
NavigationItem represents a menu item
func (NavigationItem) GetHeight ¶
func (n NavigationItem) GetHeight() int
GetHeight implements ScrollableItem interface Returns the number of lines this item occupies when rendered
func (NavigationItem) GetID ¶
func (n NavigationItem) GetID() string
GetID implements ScrollableItem interface Returns a unique identifier for this item
func (NavigationItem) IsSelectable ¶
func (n NavigationItem) IsSelectable() bool
IsSelectable implements ScrollableItem interface Returns true if this item can be selected by the user
type NavigationModel ¶
type NavigationModel struct {
// contains filtered or unexported fields
}
NavigationModel handles menu and navigation
func NewNavigationModel ¶
func NewNavigationModel() *NavigationModel
NewNavigationModel creates a new navigation model
func (*NavigationModel) AddBreadcrumb ¶
func (m *NavigationModel) AddBreadcrumb(crumb string)
AddBreadcrumb adds a breadcrumb to the navigation
func (*NavigationModel) AddItem ¶
func (m *NavigationModel) AddItem(item NavigationItem)
AddItem adds a new navigation item
func (*NavigationModel) DisableItem ¶
func (m *NavigationModel) DisableItem(id string)
DisableItem disables a menu item by ID
func (*NavigationModel) EnableItem ¶
func (m *NavigationModel) EnableItem(id string)
EnableItem enables a menu item by ID
func (*NavigationModel) Focus ¶
func (m *NavigationModel) Focus()
Focus implements domain.TUIComponent
func (*NavigationModel) GetBreadcrumbs ¶
func (m *NavigationModel) GetBreadcrumbs() []string
GetBreadcrumbs returns the current breadcrumbs
func (*NavigationModel) GetSelected ¶
func (m *NavigationModel) GetSelected() *NavigationItem
GetSelected returns the currently selected item
func (*NavigationModel) PopBreadcrumb ¶
func (m *NavigationModel) PopBreadcrumb() string
PopBreadcrumb removes the last breadcrumb
func (*NavigationModel) RemoveItem ¶
func (m *NavigationModel) RemoveItem(id string)
RemoveItem removes a navigation item by ID
func (*NavigationModel) SetSelected ¶
func (m *NavigationModel) SetSelected(index int)
SetSelected sets the selected item by index
func (*NavigationModel) SetSize ¶
func (m *NavigationModel) SetSize(width, height int)
SetSize implements domain.TUIComponent
func (*NavigationModel) SetTheme ¶
func (m *NavigationModel) SetTheme(theme domain.Theme)
SetTheme implements domain.TUIComponent
type Pager ¶
type Pager struct {
// contains filtered or unexported fields
}
Pager provides scrollable content functionality
func (*Pager) CanScrollDown ¶
CanScrollDown returns true if content can be scrolled down
func (*Pager) CanScrollUp ¶
CanScrollUp returns true if content can be scrolled up
func (*Pager) GetScrollPosition ¶
GetScrollPosition returns current scroll position and max scroll
func (*Pager) SetContent ¶
SetContent sets the content to be displayed in the pager
func (*Pager) SetContentLines ¶
SetContentLines sets the content as a slice of lines
func (*Pager) SetShowScrollIndicators ¶
SetShowScrollIndicators controls whether scroll indicators are shown
type PagerScrollableAdapter ¶
type PagerScrollableAdapter struct {
*Pager
// contains filtered or unexported fields
}
PagerScrollableAdapter provides backward compatibility by adapting the existing Pager to work with the new ScrollableList interface. This allows existing code using Pager to continue working while gradually migrating to the new scrolling system.
func NewPagerScrollableAdapter ¶
func NewPagerScrollableAdapter(pager *Pager) *PagerScrollableAdapter
NewPagerScrollableAdapter creates a new adapter that wraps an existing Pager
func (*PagerScrollableAdapter) AddItem ¶
func (p *PagerScrollableAdapter) AddItem(item ScrollableItem)
AddItem implements ScrollableList interface
func (*PagerScrollableAdapter) End ¶
func (p *PagerScrollableAdapter) End() bool
End implements ScrollableList interface
func (*PagerScrollableAdapter) GetItems ¶
func (p *PagerScrollableAdapter) GetItems() []ScrollableItem
GetItems implements ScrollableList interface
func (*PagerScrollableAdapter) GetScrollPosition ¶
func (p *PagerScrollableAdapter) GetScrollPosition() ScrollPosition
GetScrollPosition implements ScrollableList interface
func (*PagerScrollableAdapter) GetSelected ¶
func (p *PagerScrollableAdapter) GetSelected() int
GetSelected implements ScrollableList interface
func (*PagerScrollableAdapter) GetVisibleRange ¶
func (p *PagerScrollableAdapter) GetVisibleRange() (start, end int)
GetVisibleRange implements ScrollableList interface
func (*PagerScrollableAdapter) Home ¶
func (p *PagerScrollableAdapter) Home() bool
Home implements ScrollableList interface
func (*PagerScrollableAdapter) Init ¶
func (p *PagerScrollableAdapter) Init() tea.Cmd
Init implements the TUIComponent interface (required by ScrollableList)
func (*PagerScrollableAdapter) IsItemVisible ¶
func (p *PagerScrollableAdapter) IsItemVisible(index int) bool
IsItemVisible implements ScrollableList interface
func (*PagerScrollableAdapter) MoveDown ¶
func (p *PagerScrollableAdapter) MoveDown() bool
MoveDown implements ScrollableList interface
func (*PagerScrollableAdapter) MoveUp ¶
func (p *PagerScrollableAdapter) MoveUp() bool
MoveUp implements ScrollableList interface
func (*PagerScrollableAdapter) PageDown ¶
func (p *PagerScrollableAdapter) PageDown() bool
PageDown implements ScrollableList interface
func (*PagerScrollableAdapter) PageUp ¶
func (p *PagerScrollableAdapter) PageUp() bool
PageUp implements ScrollableList interface
func (*PagerScrollableAdapter) RemoveItem ¶
func (p *PagerScrollableAdapter) RemoveItem(index int)
RemoveItem implements ScrollableList interface
func (*PagerScrollableAdapter) ScrollToItem ¶
func (p *PagerScrollableAdapter) ScrollToItem(index int)
ScrollToItem implements ScrollableList interface
func (*PagerScrollableAdapter) SetItems ¶
func (p *PagerScrollableAdapter) SetItems(items []ScrollableItem)
SetItems implements ScrollableList interface
func (*PagerScrollableAdapter) SetSelected ¶
func (p *PagerScrollableAdapter) SetSelected(index int)
SetSelected implements ScrollableList interface
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar provides a determinate progress bar
func (*ProgressBar) IsComplete ¶
func (p *ProgressBar) IsComplete() bool
IsComplete returns true if progress is complete
func (*ProgressBar) SetMessage ¶
func (p *ProgressBar) SetMessage(message string)
SetMessage sets the progress message
func (*ProgressBar) SetProgress ¶
func (p *ProgressBar) SetProgress(current, total int)
SetProgress sets the current progress
func (*ProgressBar) SetShowPercentage ¶
func (p *ProgressBar) SetShowPercentage(show bool)
SetShowPercentage controls whether percentage is shown
func (*ProgressBar) SetSize ¶
func (p *ProgressBar) SetSize(width, height int)
SetSize sets the progress bar dimensions
func (*ProgressBar) SetTheme ¶
func (p *ProgressBar) SetTheme(theme domain.Theme)
SetTheme sets the progress bar theme
type ProgressModel ¶
type ProgressModel struct {
// contains filtered or unexported fields
}
ProgressModel shows operation progress
func NewProgressModel ¶
func NewProgressModel() *ProgressModel
NewProgressModel creates a new progress model
func (*ProgressModel) IsComplete ¶
func (m *ProgressModel) IsComplete() bool
IsComplete returns true if progress is complete
func (*ProgressModel) SetMessage ¶
func (m *ProgressModel) SetMessage(message string)
SetMessage sets the progress message
func (*ProgressModel) SetProgress ¶
func (m *ProgressModel) SetProgress(current, total int)
SetProgress sets the current progress
func (*ProgressModel) SetSize ¶
func (m *ProgressModel) SetSize(width, height int)
SetSize implements domain.TUIComponent
func (*ProgressModel) SetTheme ¶
func (m *ProgressModel) SetTheme(theme domain.Theme)
SetTheme implements domain.TUIComponent
type ProgressTickMsg ¶
type ProgressTickMsg struct{}
ProgressTickMsg is sent to update the progress animation
type ResponsiveLayout ¶
type ResponsiveLayout struct {
// contains filtered or unexported fields
}
ResponsiveLayout handles responsive layout calculations
func NewResponsiveLayout ¶
func NewResponsiveLayout() *ResponsiveLayout
NewResponsiveLayout creates a new responsive layout manager
func (*ResponsiveLayout) GetColumnCount ¶
func (rl *ResponsiveLayout) GetColumnCount() int
GetColumnCount returns the recommended number of columns for the current screen size
func (*ResponsiveLayout) GetContentArea ¶
func (rl *ResponsiveLayout) GetContentArea(headerHeight, footerHeight int) (int, int)
GetContentArea returns the available content area dimensions
func (*ResponsiveLayout) GetFormWidth ¶
func (rl *ResponsiveLayout) GetFormWidth() int
GetFormWidth returns the recommended form width
func (*ResponsiveLayout) GetMaxTableWidth ¶
func (rl *ResponsiveLayout) GetMaxTableWidth() int
GetMaxTableWidth returns the maximum recommended table width
func (*ResponsiveLayout) IsLargeScreen ¶
func (rl *ResponsiveLayout) IsLargeScreen() bool
IsLargeScreen returns true if the screen is considered large
func (*ResponsiveLayout) IsMediumScreen ¶
func (rl *ResponsiveLayout) IsMediumScreen() bool
IsMediumScreen returns true if the screen is considered medium
func (*ResponsiveLayout) IsSmallScreen ¶
func (rl *ResponsiveLayout) IsSmallScreen() bool
IsSmallScreen returns true if the screen is considered small
func (*ResponsiveLayout) SetSize ¶
func (rl *ResponsiveLayout) SetSize(width, height int)
SetSize updates the layout dimensions
type ResultViewMode ¶
type ResultViewMode int
ResultViewMode represents different ways to display results
const ( ResultViewModeFormatted ResultViewMode = iota ResultViewModeTable ResultViewModeRaw )
type ResultViewModel ¶
type ResultViewModel struct {
// contains filtered or unexported fields
}
ResultViewModel handles display of diagnostic results
func NewResultViewModel ¶
func NewResultViewModel() *ResultViewModel
NewResultViewModel creates a new result view model
func (*ResultViewModel) Focus ¶
func (m *ResultViewModel) Focus()
Focus implements domain.TUIComponent
func (*ResultViewModel) SetResult ¶
func (m *ResultViewModel) SetResult(result domain.Result)
SetResult sets the result to display
func (*ResultViewModel) SetSize ¶
func (m *ResultViewModel) SetSize(width, height int)
SetSize implements domain.TUIComponent
func (*ResultViewModel) SetTheme ¶
func (m *ResultViewModel) SetTheme(theme domain.Theme)
SetTheme implements domain.TUIComponent
type SSLCheckCompleteMsg ¶
SSL-specific messages
type SSLCheckErrorMsg ¶
type SSLCheckErrorMsg struct {
Error error
}
type ScrollPosition ¶
type ScrollPosition struct {
// SelectedIndex is the index of the currently selected item
SelectedIndex int
// TopVisible is the index of the first visible item in the viewport
TopVisible int
// ViewportHeight is the number of items that can fit in the viewport
ViewportHeight int
}
ScrollPosition tracks the current scroll and selection state
func NewScrollPosition ¶
func NewScrollPosition() ScrollPosition
NewScrollPosition creates a new ScrollPosition with default values
func (ScrollPosition) CanScrollDown ¶
func (sp ScrollPosition) CanScrollDown(itemCount int) bool
CanScrollDown returns true if content can be scrolled down
func (ScrollPosition) CanScrollUp ¶
func (sp ScrollPosition) CanScrollUp() bool
CanScrollUp returns true if content can be scrolled up
func (*ScrollPosition) EnsureSelectionVisible ¶
func (sp *ScrollPosition) EnsureSelectionVisible(itemCount int)
EnsureSelectionVisible adjusts TopVisible to ensure the selected item is visible
func (ScrollPosition) GetVisibleRange ¶
func (sp ScrollPosition) GetVisibleRange(itemCount int) (start, end int)
GetVisibleRange returns the start and end indices of visible items
func (ScrollPosition) IsItemVisible ¶
func (sp ScrollPosition) IsItemVisible(index int) bool
IsItemVisible returns true if the item at the given index is visible
func (ScrollPosition) IsValid ¶
func (sp ScrollPosition) IsValid(itemCount int) bool
IsValid returns true if the scroll position is valid for the given content
type ScrollableContent ¶
type ScrollableContent struct {
// Items contains all scrollable items
Items []ScrollableItem
// Position tracks current scroll and selection state
Position ScrollPosition
// ShowIndicators controls whether scroll indicators are displayed
ShowIndicators bool
// Theme for styling the content
Theme domain.Theme
// KeyMap for navigation key bindings
KeyMap KeyMap
}
ScrollableContent represents scrollable content with metadata
func NewScrollableContent ¶
func NewScrollableContent() *ScrollableContent
NewScrollableContent creates a new ScrollableContent with default settings
func (*ScrollableContent) AddItem ¶
func (sc *ScrollableContent) AddItem(item ScrollableItem)
AddItem adds an item to the scrollable content
func (*ScrollableContent) GetSelectedItem ¶
func (sc *ScrollableContent) GetSelectedItem() ScrollableItem
GetSelectedItem returns the currently selected item, or nil if none
func (*ScrollableContent) RemoveItem ¶
func (sc *ScrollableContent) RemoveItem(index int)
RemoveItem removes an item at the specified index
func (*ScrollableContent) SetItems ¶
func (sc *ScrollableContent) SetItems(items []ScrollableItem)
SetItems replaces all items in the scrollable content
func (*ScrollableContent) SetViewportHeight ¶
func (sc *ScrollableContent) SetViewportHeight(height int)
SetViewportHeight updates the viewport height and adjusts scroll position
type ScrollableItem ¶
type ScrollableItem interface {
// Render returns the string representation of the item
// width: available width for rendering
// selected: whether this item is currently selected
// theme: theme to apply for styling
Render(width int, selected bool, theme domain.Theme) string
// GetHeight returns the number of lines this item occupies when rendered
GetHeight() int
// IsSelectable returns true if this item can be selected by the user
IsSelectable() bool
// GetID returns a unique identifier for this item
GetID() string
}
ScrollableItem defines the contract for items that can be rendered in a scrollable list
func CreateHelpSections ¶
func CreateHelpSections() []ScrollableItem
CreateHelpSections creates all help sections for the application This function converts the existing help content structure to scrollable sections
type ScrollableList ¶
type ScrollableList interface {
domain.TUIComponent
// Content management
SetItems(items []ScrollableItem)
GetItems() []ScrollableItem
AddItem(item ScrollableItem)
RemoveItem(index int)
// Selection and scrolling
GetSelected() int
SetSelected(index int)
GetScrollPosition() ScrollPosition
ScrollToItem(index int)
// Navigation
MoveUp() bool
MoveDown() bool
PageUp() bool
PageDown() bool
Home() bool
End() bool
// Viewport management
GetVisibleRange() (start, end int)
IsItemVisible(index int) bool
}
ScrollableList defines the contract for scrollable content with selection This interface extends TUIComponent to provide unified scroll behavior
type ScrollableView ¶
type ScrollableView struct {
// contains filtered or unexported fields
}
ScrollableView provides a standardized scrollable content view It can work with both string content (legacy mode) and ScrollableItem lists (new mode)
func NewScrollableView ¶
func NewScrollableView() *ScrollableView
NewScrollableView creates a new scrollable view
func (*ScrollableView) AddItem ¶
func (s *ScrollableView) AddItem(item ScrollableItem)
AddItem implements ScrollableList interface
func (*ScrollableView) DisableScrollableList ¶
func (s *ScrollableView) DisableScrollableList()
DisableScrollableList disables the new scrollable list mode and reverts to string content
func (*ScrollableView) EnableScrollableList ¶
func (s *ScrollableView) EnableScrollableList()
EnableScrollableList enables the new scrollable list mode
func (*ScrollableView) End ¶
func (s *ScrollableView) End() bool
End implements ScrollableList interface
func (*ScrollableView) Focus ¶
func (s *ScrollableView) Focus()
Focus implements domain.TUIComponent
func (*ScrollableView) GetItems ¶
func (s *ScrollableView) GetItems() []ScrollableItem
GetItems implements ScrollableList interface
func (*ScrollableView) GetScrollPercent ¶
func (s *ScrollableView) GetScrollPercent() float64
GetScrollPercent returns the current scroll percentage
func (*ScrollableView) GetScrollPosition ¶
func (s *ScrollableView) GetScrollPosition() ScrollPosition
GetScrollPosition implements ScrollableList interface
func (*ScrollableView) GetSelected ¶
func (s *ScrollableView) GetSelected() int
GetSelected implements ScrollableList interface
func (*ScrollableView) GetVisibleRange ¶
func (s *ScrollableView) GetVisibleRange() (start, end int)
GetVisibleRange implements ScrollableList interface
func (*ScrollableView) Home ¶
func (s *ScrollableView) Home() bool
Home implements ScrollableList interface
func (*ScrollableView) IsItemVisible ¶
func (s *ScrollableView) IsItemVisible(index int) bool
IsItemVisible implements ScrollableList interface
func (*ScrollableView) MoveDown ¶
func (s *ScrollableView) MoveDown() bool
MoveDown implements ScrollableList interface
func (*ScrollableView) MoveUp ¶
func (s *ScrollableView) MoveUp() bool
MoveUp implements ScrollableList interface
func (*ScrollableView) PageDown ¶
func (s *ScrollableView) PageDown() bool
PageDown implements ScrollableList interface
func (*ScrollableView) PageUp ¶
func (s *ScrollableView) PageUp() bool
PageUp implements ScrollableList interface
func (*ScrollableView) RemoveItem ¶
func (s *ScrollableView) RemoveItem(index int)
RemoveItem implements ScrollableList interface
func (*ScrollableView) ScrollToBottom ¶
func (s *ScrollableView) ScrollToBottom()
ScrollToBottom scrolls to the bottom
func (*ScrollableView) ScrollToItem ¶
func (s *ScrollableView) ScrollToItem(index int)
ScrollToItem implements ScrollableList interface
func (*ScrollableView) ScrollToTop ¶
func (s *ScrollableView) ScrollToTop()
ScrollToTop scrolls to the top
func (*ScrollableView) SetContent ¶
func (s *ScrollableView) SetContent(content string)
SetContent sets the main content to be displayed This method disables scrollable list mode and uses string content
func (*ScrollableView) SetFooter ¶
func (s *ScrollableView) SetFooter(footer string)
SetFooter sets the footer text
func (*ScrollableView) SetHeader ¶
func (s *ScrollableView) SetHeader(header string)
SetHeader sets the header text
func (*ScrollableView) SetItems ¶
func (s *ScrollableView) SetItems(items []ScrollableItem)
SetItems implements ScrollableList interface
func (*ScrollableView) SetSelected ¶
func (s *ScrollableView) SetSelected(index int)
SetSelected implements ScrollableList interface
func (*ScrollableView) SetSize ¶
func (s *ScrollableView) SetSize(width, height int)
SetSize implements domain.TUIComponent
func (*ScrollableView) SetTheme ¶
func (s *ScrollableView) SetTheme(theme domain.Theme)
SetTheme implements domain.TUIComponent
type StandardScrollPager ¶
type StandardScrollPager struct {
// contains filtered or unexported fields
}
StandardScrollPager provides unified scrolling behavior for all TUI models
func NewStandardScrollPager ¶
func NewStandardScrollPager() *StandardScrollPager
NewStandardScrollPager creates a new StandardScrollPager
func (*StandardScrollPager) AddItem ¶
func (p *StandardScrollPager) AddItem(item ScrollableItem)
AddItem implements ScrollableList
func (*StandardScrollPager) Blur ¶
func (p *StandardScrollPager) Blur()
Blur implements domain.TUIComponent
func (*StandardScrollPager) End ¶
func (p *StandardScrollPager) End() bool
End implements ScrollableList
func (*StandardScrollPager) Focus ¶
func (p *StandardScrollPager) Focus()
Focus implements domain.TUIComponent
func (*StandardScrollPager) GetItems ¶
func (p *StandardScrollPager) GetItems() []ScrollableItem
GetItems implements ScrollableList
func (*StandardScrollPager) GetScrollPosition ¶
func (p *StandardScrollPager) GetScrollPosition() ScrollPosition
GetScrollPosition implements ScrollableList
func (*StandardScrollPager) GetSelected ¶
func (p *StandardScrollPager) GetSelected() int
GetSelected implements ScrollableList
func (*StandardScrollPager) GetVisibleRange ¶
func (p *StandardScrollPager) GetVisibleRange() (start, end int)
GetVisibleRange implements ScrollableList
func (*StandardScrollPager) Home ¶
func (p *StandardScrollPager) Home() bool
Home implements ScrollableList
func (*StandardScrollPager) Init ¶
func (p *StandardScrollPager) Init() tea.Cmd
Init implements tea.Model
func (*StandardScrollPager) IsItemVisible ¶
func (p *StandardScrollPager) IsItemVisible(index int) bool
IsItemVisible implements ScrollableList
func (*StandardScrollPager) MoveDown ¶
func (p *StandardScrollPager) MoveDown() bool
MoveDown implements ScrollableList
func (*StandardScrollPager) MoveUp ¶
func (p *StandardScrollPager) MoveUp() bool
MoveUp implements ScrollableList
func (*StandardScrollPager) PageDown ¶
func (p *StandardScrollPager) PageDown() bool
PageDown implements ScrollableList
func (*StandardScrollPager) PageUp ¶
func (p *StandardScrollPager) PageUp() bool
PageUp implements ScrollableList
func (*StandardScrollPager) RemoveItem ¶
func (p *StandardScrollPager) RemoveItem(index int)
RemoveItem implements ScrollableList
func (*StandardScrollPager) ScrollToItem ¶
func (p *StandardScrollPager) ScrollToItem(index int)
ScrollToItem implements ScrollableList
func (*StandardScrollPager) SetItems ¶
func (p *StandardScrollPager) SetItems(items []ScrollableItem)
SetItems implements ScrollableList
func (*StandardScrollPager) SetSelected ¶
func (p *StandardScrollPager) SetSelected(index int)
SetSelected implements ScrollableList
func (*StandardScrollPager) SetShowScrollIndicators ¶
func (p *StandardScrollPager) SetShowScrollIndicators(show bool)
SetShowScrollIndicators controls whether scroll indicators are displayed
func (*StandardScrollPager) SetSize ¶
func (p *StandardScrollPager) SetSize(width, height int)
SetSize implements domain.TUIComponent
func (*StandardScrollPager) SetTheme ¶
func (p *StandardScrollPager) SetTheme(theme domain.Theme)
SetTheme implements domain.TUIComponent
func (*StandardScrollPager) View ¶
func (p *StandardScrollPager) View() string
View implements tea.Model
type StringScrollableItem ¶
type StringScrollableItem struct {
// contains filtered or unexported fields
}
StringScrollableItem is a simple implementation of ScrollableItem for string content
func NewStringScrollableItem ¶
func NewStringScrollableItem(content, id string) *StringScrollableItem
NewStringScrollableItem creates a new string-based scrollable item
func (*StringScrollableItem) GetHeight ¶
func (s *StringScrollableItem) GetHeight() int
GetHeight implements ScrollableItem interface
func (*StringScrollableItem) GetID ¶
func (s *StringScrollableItem) GetID() string
GetID implements ScrollableItem interface
func (*StringScrollableItem) IsSelectable ¶
func (s *StringScrollableItem) IsSelectable() bool
IsSelectable implements ScrollableItem interface
type TUITestHarness ¶
type TUITestHarness struct {
// contains filtered or unexported fields
}
TUITestHarness enables TUI interaction testing
func NewTUITestHarness ¶
func NewTUITestHarness(model tea.Model) *TUITestHarness
NewTUITestHarness creates a new test harness
func (*TUITestHarness) AssertOutput ¶
func (h *TUITestHarness) AssertOutput(expected string) bool
AssertOutput checks if the current output contains the expected text
func (*TUITestHarness) AssertOutputNot ¶
func (h *TUITestHarness) AssertOutputNot(notExpected string) bool
AssertOutputNot checks if the current output does not contain the text
func (*TUITestHarness) GetModel ¶
func (h *TUITestHarness) GetModel() tea.Model
GetModel returns the current model (for inspection)
func (*TUITestHarness) GetOutput ¶
func (h *TUITestHarness) GetOutput() string
GetOutput returns the current output
func (*TUITestHarness) GetOutputHistory ¶
func (h *TUITestHarness) GetOutputHistory() []string
GetOutputHistory returns all output history
func (*TUITestHarness) IsRunning ¶
func (h *TUITestHarness) IsRunning() bool
IsRunning returns whether the harness is currently running
func (*TUITestHarness) Read ¶
func (h *TUITestHarness) Read(p []byte) (n int, err error)
Read implements io.Reader for tea.WithInput
func (*TUITestHarness) SendKey ¶
func (h *TUITestHarness) SendKey(key tea.KeyType)
SendKey sends a key message to the program
func (*TUITestHarness) SendKeyRune ¶
func (h *TUITestHarness) SendKeyRune(r rune)
SendKeyRune sends a key rune message to the program
func (*TUITestHarness) SendKeyString ¶
func (h *TUITestHarness) SendKeyString(s string)
SendKeyString sends a string as individual key messages
func (*TUITestHarness) SendMessage ¶
func (h *TUITestHarness) SendMessage(msg tea.Msg)
SendMessage sends a custom message to the program
func (*TUITestHarness) SendWindowSize ¶
func (h *TUITestHarness) SendWindowSize(width, height int)
SendWindowSize sends a window size message
func (*TUITestHarness) WaitForOutput ¶
func (h *TUITestHarness) WaitForOutput(text string, timeout time.Duration) bool
WaitForOutput waits for specific text to appear in the output
func (*TUITestHarness) WaitForOutputMatch ¶
func (h *TUITestHarness) WaitForOutputMatch(predicate func(string) bool, timeout time.Duration) bool
WaitForOutputMatch waits for output that matches a predicate function
type TUITestSuite ¶
type TUITestSuite struct {
// contains filtered or unexported fields
}
TUITestSuite provides utilities for testing TUI components
func NewTUITestSuite ¶
func NewTUITestSuite() *TUITestSuite
NewTUITestSuite creates a new test suite
func (*TUITestSuite) Cleanup ¶
func (s *TUITestSuite) Cleanup()
Cleanup stops all harnesses and cleans up resources
func (*TUITestSuite) CreateHarness ¶
func (s *TUITestSuite) CreateHarness(model tea.Model) *TUITestHarness
CreateHarness creates and registers a new test harness
func (*TUITestSuite) TestFormInteraction ¶
func (s *TUITestSuite) TestFormInteraction(harness *TUITestHarness) error
TestFormInteraction tests form interaction flows
func (*TUITestSuite) TestKeyboardShortcuts ¶
func (s *TUITestSuite) TestKeyboardShortcuts(harness *TUITestHarness) error
TestKeyboardShortcuts tests keyboard shortcuts
func (*TUITestSuite) TestNavigationFlow ¶
func (s *TUITestSuite) TestNavigationFlow(harness *TUITestHarness) error
TestNavigationFlow tests basic navigation flows
func (*TUITestSuite) TestResponsiveLayout ¶
func (s *TUITestSuite) TestResponsiveLayout(harness *TUITestHarness) error
TestResponsiveLayout tests responsive layout behavior
type TableModel ¶
type TableModel struct {
// contains filtered or unexported fields
}
TableModel displays tabular data with sorting and filtering
func NewTableModel ¶
func NewTableModel(headers []string) *TableModel
NewTableModel creates a new table model
func (*TableModel) AddRow ¶
func (m *TableModel) AddRow(row []string)
AddRow adds a row to the table
func (*TableModel) SetData ¶
func (m *TableModel) SetData(rows [][]string)
SetData sets the table data
func (*TableModel) SetFilter ¶
func (m *TableModel) SetFilter(filter string)
SetFilter sets the table filter
func (*TableModel) SetSize ¶
func (m *TableModel) SetSize(width, height int)
SetSize implements domain.TUIComponent
func (*TableModel) SetTheme ¶
func (m *TableModel) SetTheme(theme domain.Theme)
SetTheme implements domain.TUIComponent
func (*TableModel) SortBy ¶
func (m *TableModel) SortBy(column int, descending bool)
SortBy sorts the table by the specified column
type TableSelectMsg ¶
TableSelectMsg represents a table row selection message
type ThemeManager ¶
type ThemeManager struct {
// contains filtered or unexported fields
}
ThemeManager manages theme switching and application
func NewThemeManager ¶
func NewThemeManager() *ThemeManager
NewThemeManager creates a new theme manager
func (*ThemeManager) ApplyThemeToComponent ¶
func (tm *ThemeManager) ApplyThemeToComponent(component domain.TUIComponent)
ApplyThemeToComponent applies the current theme to a TUI component
func (*ThemeManager) GetAvailableThemes ¶
func (tm *ThemeManager) GetAvailableThemes() []string
GetAvailableThemes returns a list of available theme names
func (*ThemeManager) GetCurrentThemeName ¶
func (tm *ThemeManager) GetCurrentThemeName() string
GetCurrentThemeName returns the name of the current theme
func (*ThemeManager) GetTheme ¶
func (tm *ThemeManager) GetTheme() domain.Theme
GetTheme returns the current theme
func (*ThemeManager) RegisterTheme ¶
func (tm *ThemeManager) RegisterTheme(name string, theme domain.Theme)
RegisterTheme registers a new theme
func (*ThemeManager) SetTheme ¶
func (tm *ThemeManager) SetTheme(name string) bool
SetTheme sets the current theme by name