Documentation
¶
Overview ¶
Package drilldown demonstrates a master-detail screen with async fetches at both levels, plus a third level via push:
- The cities list (left) loads on Init via tea.Tick. Until it resolves the pane spins; the detail pane sits idle.
- Pressing enter on a focused city fires another async fetch into the detail list (right). Each fetch is tagged with a request ID so hammering enter never races a slow response into the pane after a newer selection — the standard "stale-response cancel" pattern in Bubble Tea (you can't stop a tea.Cmd, so you discard its result on arrival instead).
- Pressing enter on a focused attribute pushes a child screen. Esc pops back with parent state intact (focus index, fetched detail, cursor) — that's free because screen.Stack keeps parent screens alive while a child is on top.
Enter has a single conceptual meaning across the whole screen — "open the focused selection" — with a different side effect per pane (load detail + shift focus right, or push child screen). Tab/shift-tab cycles focus explicitly.
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
}
func (*Screen) IsCapturingKeys ¶
IsCapturingKeys claims keys whenever the focused list is filter-typing. Detail isn't filterable, so only the cities filter matters.
Click to show internal directories.
Click to hide internal directories.