Documentation
¶
Overview ¶
Package tui implements a terminal user interface using bubbletea.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfirmPager ¶
type ConfirmPager struct {
// contains filtered or unexported fields
}
ConfirmPager is a scrollable diff pager with embedded confirm keybindings. Shown instead of the bare Picker when a tool confirmation includes a diff preview.
func NewConfirmPager ¶
func NewConfirmPager(title, diff, pattern string, response chan<- ui.ConfirmAction, width, height int) *ConfirmPager
NewConfirmPager creates a ConfirmPager from highlighted diff content.
func (*ConfirmPager) HandleKey ¶
func (c *ConfirmPager) HandleKey(msg tea.KeyPressMsg) (action *ui.ConfirmAction, dismissed bool)
HandleKey processes key events. Returns (action, dismissed). action is non-nil when the user picks a confirm action. dismissed is true when the user cancels (esc/ctrl+c).
func (*ConfirmPager) View ¶
func (c *ConfirmPager) View() string
View renders the confirm pager with diff content and keybinding footer.
type HintFunc ¶
HintFunc resolves a slash command name (e.g. "/hello") to its hint text (e.g. "<name> [arguments]").
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model holds the TUI state.
func NewModel ¶
func NewModel( status ui.Status, input chan<- ui.UserInput, actions chan<- ui.UserAction, cancel chan<- struct{}, historyPath string, hintFunc HintFunc, workdir string, ) Model
NewModel creates a new TUI model.
type Pager ¶
type Pager struct {
// contains filtered or unexported fields
}
Pager is a scrollable read-only overlay for multi-line command output.
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker is an interactive overlay for selecting an item from a grouped list.
func NewPicker ¶
func NewPicker(title string, items []ui.PickerItem, width, height int) *Picker
NewPicker creates a picker from the given items. The cursor starts on the current item (if any).
func (*Picker) HandleKey ¶
func (p *Picker) HandleKey(msg tea.KeyPressMsg) (selected *ui.PickerItem, dismissed bool)
HandleKey processes a key event. Returns: handled (always true), selected item (if Enter), dismissed (if Esc).
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI implements a bubbletea-based TUI.
func (*UI) Actions ¶
func (u *UI) Actions() <-chan ui.UserAction
Actions returns the channel for sending UI actions to the assistant.
func (*UI) Cancel ¶
func (u *UI) Cancel() <-chan struct{}
Cancel returns the channel for receiving cancel requests.
func (*UI) SetHintFunc ¶
SetHintFunc sets the function used to resolve slash command hints.
func (*UI) SetWorkdir ¶
SetWorkdir sets the working directory for directive autocomplete.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package autocomplete provides directive name and path completions for the TUI.
|
Package autocomplete provides directive name and path completions for the TUI. |