drilldown

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the drilldown demo's root screen.

Types

type Screen

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

func (*Screen) Help

func (s *Screen) Help() []key.Binding

func (*Screen) Init

func (s *Screen) Init() tea.Cmd

func (*Screen) IsCapturingKeys

func (s *Screen) IsCapturingKeys() bool

IsCapturingKeys claims keys whenever the focused list is filter-typing. Detail isn't filterable, so only the cities filter matters.

func (*Screen) Layout

func (s *Screen) Layout() layout.Node

func (*Screen) OnEnter

func (s *Screen) OnEnter(any) tea.Cmd

func (*Screen) SetTheme

func (s *Screen) SetTheme(t theme.Theme)

func (*Screen) Title

func (s *Screen) Title() string

func (*Screen) Update

func (s *Screen) Update(msg tea.Msg) (screen.Screen, tea.Cmd)

Jump to

Keyboard shortcuts

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