Documentation
¶
Overview ¶
Package panel holds the views that replace the editor at the bottom of the screen until dismissed: permission requests, questions, lists and text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ask ¶
type Ask struct {
// contains filtered or unexported fields
}
Ask gives each of several questions a tab, plus a final review tab.
type Consent ¶
type Consent struct {
// contains filtered or unexported fields
}
Consent asks about items that would run as the user. A folder's are checked one by one, the checked agreed to and the rest declined; a plugin's are listed, to be taken or left as a whole.
func NewApproval ¶
func NewApproval(key any, title, lead string, items app.Surface, choices []Choice, esc func() tea.Cmd) *Consent
NewApproval lists items to be taken or left as a whole; the choices receive none.
type List ¶
type List struct {
Title string
Items []Item
Hint string // replaces the default hint
Filter bool
// Select runs on enter, and the list closes.
Select func(Item) tea.Cmd
// Keys sees keys first. handled stops the list from processing the key;
// done closes the list. item is nil when nothing is selected.
Keys func(k string, item *Item) (cmd tea.Cmd, handled, done bool)
// Reload, if set, refreshes the items every second while shown.
Reload func() []Item
// contains filtered or unexported fields
}
type Permission ¶
type Permission struct {
// contains filtered or unexported fields
}
func NewPermission ¶
func NewPermission(req interact.Approval, reply chan<- interact.Verdict, acceptEdits func()) *Permission
acceptEdits switches to the accept-edits mode; it is offered for edits.
func (*Permission) Key ¶
func (p *Permission) Key() any
func (*Permission) View ¶
func (p *Permission) View(width, height int) string
type Request ¶
A Request answers the agent and may be withdrawn by Key. Requests wait their turn; Queue tells the shown one how many wait behind it.