loading

package
v0.0.0-...-e04c4e5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package loading demonstrates pkg/pane's loading state across a list, a logview, and a tree. Each component starts in SetLoading(true); after a staggered delay, simulated "fetched" data arrives and the spinners are dismissed via SetLoading(false). Press r to refetch.

The screen also illustrates focus cycling across multiple interactive components: tab/shift-tab moves focus between list, logview, and tree. Key messages are routed only to the focused component, so "/" opens one search at a time and h/l scrolls only the focused pane. Spinner ticks and fetch results still fan out to all three so every spinner keeps animating regardless of focus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the loading-state demo 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 component is in a text-input state — that's where global keys like q/t would otherwise steal printables from the search box.

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