ui

package
v0.0.0-...-7c3daf4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UIStateHelping uiState = iota
	UIStateListing
	UIStateEditing
	UIStatePicking
	UIStateAsking
)
View Source
const (
	DirtStateUnchanged dirtState = iota
	DirtStateDirty
	DirtStateClean
)

Variables

This section is empty.

Functions

func Ask

func Ask(question string, answer string, placeholder string, action AskAnswerAction) tea.Cmd

func New

func New(name string, data storage.Storage) tea.Model

func PickOne

func PickOne(prompt string, options []string, action PickOneAction) tea.Cmd

func RequestEdit

func RequestEdit(entryMeta storage.EntryMeta) tea.Cmd

func SetUiState

func SetUiState(newState uiState) tea.Cmd

func UpdateIndex

func UpdateIndex(idx storage.Index) tea.Cmd

func UpdateStatus

func UpdateStatus(message string, dirt dirtState) tea.Cmd

func UpdateStatusName

func UpdateStatusName(name string) tea.Cmd

Types

type AskAnswerAction

type AskAnswerAction func(answer string) tea.Cmd

type AskRequestMsg

type AskRequestMsg struct {
	Question    string
	Answer      string
	Placeholder string
	Action      AskAnswerAction
}

type AskScreen

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

func NewAskScreen

func NewAskScreen() AskScreen

func (AskScreen) Init

func (as AskScreen) Init() tea.Cmd

func (AskScreen) Update

func (as AskScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (AskScreen) View

func (as AskScreen) View() string

type EditRequestMsg

type EditRequestMsg struct {
	EntryMeta storage.EntryMeta
}

type EditScreen

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

func NewEditScreen

func NewEditScreen(data storage.Storage) EditScreen

func (EditScreen) Init

func (es EditScreen) Init() tea.Cmd

func (EditScreen) Name

func (es EditScreen) Name() string

func (EditScreen) Update

func (es EditScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (EditScreen) View

func (es EditScreen) View() string

type HelpScreen

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

func NewHelpScreen

func NewHelpScreen() HelpScreen

func (HelpScreen) Init

func (h HelpScreen) Init() tea.Cmd

func (HelpScreen) Update

func (h HelpScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (HelpScreen) View

func (h HelpScreen) View() string

type IndexUpdateMsg

type IndexUpdateMsg struct {
	Index storage.Index
}

type ListScreen

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

func NewListScreen

func NewListScreen(data storage.Storage) ListScreen

func (ListScreen) Init

func (ls ListScreen) Init() tea.Cmd

func (ListScreen) Update

func (ls ListScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ListScreen) View

func (ls ListScreen) View() string

type PickOneAction

type PickOneAction func(selected int) tea.Cmd

type PickOneRequestMsg

type PickOneRequestMsg struct {
	Prompt  string
	Options []string
	Action  PickOneAction
}

type PickOneScreen

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

func NewPickOneScreen

func NewPickOneScreen() PickOneScreen

func (PickOneScreen) Init

func (po PickOneScreen) Init() tea.Cmd

func (PickOneScreen) Update

func (po PickOneScreen) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (PickOneScreen) View

func (po PickOneScreen) View() string

type Placeholder

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

func (Placeholder) Init

func (ph Placeholder) Init() tea.Cmd

func (Placeholder) Update

func (ph Placeholder) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Placeholder) View

func (ph Placeholder) View() string

type StatusNameUpdateMsg

type StatusNameUpdateMsg string

type Statusbar

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

func NewStatusbar

func NewStatusbar(filename string) Statusbar

func (Statusbar) Init

func (sb Statusbar) Init() tea.Cmd

func (Statusbar) IsDirty

func (sb Statusbar) IsDirty() bool

func (Statusbar) Update

func (sb Statusbar) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Statusbar) View

func (sb Statusbar) View() string

type StatusbarUpdateMsg

type StatusbarUpdateMsg struct {
	Message string
	Dirt    dirtState
}

type UI

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

func (UI) Distribute

func (ui UI) Distribute(msg tea.Msg) (tea.Model, tea.Cmd)

func (UI) Init

func (ui UI) Init() tea.Cmd

func (UI) ToCurrent

func (ui UI) ToCurrent(msg tea.Msg) (tea.Model, tea.Cmd)

func (UI) Update

func (ui UI) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (UI) View

func (ui UI) View() string

type UIStateUpdateMsg

type UIStateUpdateMsg struct {
	SetState uiState
}

Jump to

Keyboard shortcuts

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