Documentation
¶
Overview ¶
Package poll demonstrates pkg/poll driving auto-refresh of a list, with keyed items so the user's cursor survives every refresh even as the underlying set churns.
The synthetic data is a "task runner" — a fixed set of jobs whose status, age, and ordering change on every tick (some flip from running to succeeded, occasionally a new job appears or finishes off the list). Each job carries a stable Key, so SetKeyedItems lets the list snap back to the previously-selected job by ID after the swap.
Keys: p pauses/resumes the ticker, r refreshes immediately, +/- adjust the cadence, /↑↓ all behave normally on the list. The pane title reflects "refreshed Xs ago" or "paused" so the user can see the ticker's state without leaving the screen.
Index ¶
- func New(t theme.Theme) screen.Screen
- type Screen
- func (s *Screen) Help() []key.Binding
- func (s *Screen) Init() tea.Cmd
- func (s *Screen) IsCapturingKeys() bool
- func (s *Screen) Layout() layout.Node
- func (s *Screen) OnEnter(any) tea.Cmd
- func (s *Screen) SetTheme(t theme.Theme)
- func (s *Screen) Title() string
- func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Screen ¶
type Screen struct {
// contains filtered or unexported fields
}