tui

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: GPL-3.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ViewModeSearch = iota
	ViewModeSelectScope
	ViewModeEvalValue
	ViewModeHelp
)

Variables

This section is empty.

Functions

func OptionTUI

func OptionTUI(args OptionTUIArgs) error

Types

type ChangeScopeMsg

type ChangeScopeMsg struct {
	Name       string
	Options    option.NixosOptionSource
	Evaluator  option.EvaluatorFunc
	KeepSearch bool
	Err        error
}

type ChangeViewModeMsg

type ChangeViewModeMsg ViewMode

type ClearNotificationMsg added in v0.3.2

type ClearNotificationMsg struct {
	ID int
}

type DebounceMsg

type DebounceMsg struct {
	ID  int
	Msg tea.Msg
}

type Debouncer

type Debouncer struct {
	ID int
}

func (*Debouncer) Tick

func (d *Debouncer) Tick(dur time.Duration, msg func() tea.Msg) tea.Cmd

type EvalValueFinishedMsg

type EvalValueFinishedMsg struct {
	Value string
	Err   error
}

type EvalValueModel

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

func NewEvalValueModel

func NewEvalValueModel(evaluator option.EvaluatorFunc) EvalValueModel

func (EvalValueModel) SetEvaluator

func (m EvalValueModel) SetEvaluator(evaluator option.EvaluatorFunc) EvalValueModel

func (EvalValueModel) SetOption

func (m EvalValueModel) SetOption(o string) (EvalValueModel, tea.Cmd)

func (EvalValueModel) Update

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

func (EvalValueModel) View

func (m EvalValueModel) View() string

type EvalValueStartMsg

type EvalValueStartMsg struct {
	Option string
}

type FocusArea

type FocusArea int
const (
	FocusAreaResults FocusArea = iota
	FocusAreaPreview
)

type HelpModel

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

func NewHelpModel

func NewHelpModel() HelpModel

func (HelpModel) Update

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

func (HelpModel) View

func (m HelpModel) View() string

type LoadScopeFinishedMsg

type LoadScopeFinishedMsg struct {
	Name      string
	Options   option.NixosOptionSource
	Evaluator option.EvaluatorFunc
	Err       error
}

type LoadScopeStartMsg

type LoadScopeStartMsg option.Scope

type Model

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

func NewModel

func NewModel(
	scopes []option.Scope,
	selectedScope string,
	minScore int64,
	debounceTime int64,
	initialInput string,
) (*Model, error)

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type NotificationKind added in v0.3.2

type NotificationKind int
const (
	NotificationNormal NotificationKind = iota
	NotificationError
)

type NotificationMsg added in v0.3.2

type NotificationMsg struct {
	Message string
	Kind    NotificationKind
}

type OptionTUIArgs

type OptionTUIArgs struct {
	Scopes            []option.Scope
	SelectedScopeName string
	MinScore          int64
	DebounceTime      int64
	InitialInput      string
	LogFileName       string
}

type PreviewModel

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

func NewPreviewModel

func NewPreviewModel() PreviewModel

func (PreviewModel) ForceContentUpdate

func (m PreviewModel) ForceContentUpdate() PreviewModel

func (PreviewModel) SetFocused

func (m PreviewModel) SetFocused(focus bool) PreviewModel

func (PreviewModel) SetHeight

func (m PreviewModel) SetHeight(height int) PreviewModel

func (PreviewModel) SetOption

func (m PreviewModel) SetOption(opt *option.NixosOption) PreviewModel

func (PreviewModel) SetWidth

func (m PreviewModel) SetWidth(width int) PreviewModel

func (PreviewModel) Update

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

func (PreviewModel) View

func (m PreviewModel) View() string

type ResultListModel

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

func NewResultListModel

func NewResultListModel(options option.NixosOptionSource, scopeName string) ResultListModel

func (ResultListModel) GetSelectedOption

func (m ResultListModel) GetSelectedOption() *option.NixosOption

func (ResultListModel) ScrollDown

func (m ResultListModel) ScrollDown() ResultListModel

func (ResultListModel) ScrollUp

func (m ResultListModel) ScrollUp() ResultListModel

Scroll up one entry in the result list window. Note that scrolling up in the results list means less relevant results.

func (ResultListModel) SetFocused

func (m ResultListModel) SetFocused(focus bool) ResultListModel

func (ResultListModel) SetHeight

func (m ResultListModel) SetHeight(height int) ResultListModel

func (ResultListModel) SetQuery

func (m ResultListModel) SetQuery(input string) ResultListModel

func (ResultListModel) SetResultList

func (m ResultListModel) SetResultList(matches []fuzzy.Match) ResultListModel

func (ResultListModel) SetSearchError

func (m ResultListModel) SetSearchError(err error) ResultListModel

func (ResultListModel) SetSelectedIndex

func (m ResultListModel) SetSelectedIndex(index int) ResultListModel

func (ResultListModel) SetWidth

func (m ResultListModel) SetWidth(width int) ResultListModel

func (ResultListModel) Update

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

func (ResultListModel) View

func (m ResultListModel) View() string

type RunSearchMsg

type RunSearchMsg struct {
	Query string
	Mode  SearchMode
}

type SearchBarModel

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

func NewSearchBarModel

func NewSearchBarModel(totalCount int, debounceTime int64) SearchBarModel

func (SearchBarModel) SetFocused

func (m SearchBarModel) SetFocused(focused bool) SearchBarModel

func (SearchBarModel) SetHeight

func (m SearchBarModel) SetHeight(height int) SearchBarModel

func (SearchBarModel) SetResultCount

func (m SearchBarModel) SetResultCount(count int) SearchBarModel

func (SearchBarModel) SetValue

func (m SearchBarModel) SetValue(input string) SearchBarModel

func (SearchBarModel) SetWidth

func (m SearchBarModel) SetWidth(width int) SearchBarModel

func (SearchBarModel) Update

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

func (SearchBarModel) Value

func (m SearchBarModel) Value() string

func (SearchBarModel) View

func (m SearchBarModel) View() string

type SearchMode

type SearchMode int
const (
	SearchModeFuzzy SearchMode = iota
	SearchModeRegex
)

type SelectScopeModel

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

func NewSelectScopeModel

func NewSelectScopeModel(scopes []option.Scope, selectedScope string) SelectScopeModel

func (SelectScopeModel) NextScope added in v0.3.2

func (m SelectScopeModel) NextScope() option.Scope

func (SelectScopeModel) Update

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

func (SelectScopeModel) View

func (m SelectScopeModel) View() string

type StatusBarModel added in v0.3.2

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

func NewStatusBarModel added in v0.3.2

func NewStatusBarModel() StatusBarModel

func (StatusBarModel) SetWidth added in v0.3.2

func (m StatusBarModel) SetWidth(width int) StatusBarModel

func (StatusBarModel) Update added in v0.3.2

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

func (StatusBarModel) View added in v0.3.2

func (m StatusBarModel) View() string

type ViewMode

type ViewMode int

Jump to

Keyboard shortcuts

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