feature

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHost added in v0.1.1

type BaseHost interface {
	TeaModel() tea.Model
	Styles() theme.Styles
	State() session.State
	LastState() session.State
	TransitionTo(session.State) bool
	SetFooterContext(string)
	Width() int
	Height() int
}

BaseHost defines common methods that almost all features need from the main Model.

type Deps

type Deps struct {
	CWD  string
	Home string
}

Deps provides shared dependencies for features.

type Feature

type Feature interface {
	// Name returns a human-readable label for debugging.
	Name() string

	// Active reports whether the feature should receive messages.
	Active() bool

	// Update handles a message. Returns (commands, consumed).
	// If consumed is true, the message won't be passed to other features or the base model.
	Update(msg tea.Msg) (tea.Cmd, bool)

	// View returns the rendered content for this feature.
	View(width, height int) string

	// Init returns the initial command when the feature activates.
	Init() tea.Cmd
}

Feature is a self-contained UI component that owns its own state and can consume messages before the base Model.

type Result

type Result struct {
	Tab  panel.Tab
	Name string // affected entity name for reselection
}

Result is returned by a feature when it completes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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