tui

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tui exposes the Tasks terminal UI as an embeddable Bubble Tea v2 component. Tasks continues to own configuration, persistence, rendering, and agent processes; a host owns placement, lifecycle, and any surrounding UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Key       string
	CommandID string
	Context   FocusContext
}

Binding is a default Bubble Tea key name mapped to a Tasks command.

func ExportBindings

func ExportBindings() []Binding

ExportBindings projects the single Tasks shortcut registry for host keymaps.

type Command

type Command struct {
	ID              string
	FooterLabel     string
	Description     string
	Context         FocusContext
	FooterPriority  int
	DefaultBindings []string
}

Command is Tasks-owned command metadata for host palettes and footers.

func ExportCommands

func ExportCommands() []Command

ExportCommands projects the same registry for host palettes and footers.

type ContextMetadata

type ContextMetadata struct {
	Name              FocusContext
	ConsumesTextInput bool
}

ContextMetadata describes a host key-routing context. Contexts backed by an input widget may contain only the global shortcut bindings.

func ExportContexts

func ExportContexts() []ContextMetadata

ExportContexts lists every stable Tasks host context, including input-only layers whose keystrokes are interpreted by their owning editor widget.

type EmbeddedOptions

type EmbeddedOptions struct {
	SessionNamespace string
	InitialView      View
	InitialContexts  []string
	SuppressFooter   bool
	SuppressQuit     bool
	Theme            ThemeOptions
	Environment      map[string]string
}

EmbeddedOptions configures a host-owned Tasks component. SessionNamespace is required so embedding can never overwrite the standalone tasks-tui session. Environment is primarily a deterministic/test seam; nil snapshots os.Environ.

type FocusContext

type FocusContext string

FocusContext names the interaction layer currently consuming keys.

const (
	FocusList                FocusContext = "tasks-list"
	FocusDetail              FocusContext = "tasks-detail"
	FocusTaskEdit            FocusContext = "tasks-task-edit"
	FocusModal               FocusContext = "tasks-modal"
	FocusModalFilter         FocusContext = "tasks-modal-filter"
	FocusForm                FocusContext = "tasks-form"
	FocusPicker              FocusContext = "tasks-picker"
	FocusContextPicker       FocusContext = "tasks-context-picker"
	FocusFilter              FocusContext = "tasks-filter"
	FocusPrompt              FocusContext = "tasks-prompt"
	FocusResponse            FocusContext = "tasks-response"
	FocusResponseDetail      FocusContext = "tasks-response-detail"
	FocusAgentActivity       FocusContext = "tasks-agent-activity"
	FocusAgentActivityFilter FocusContext = "tasks-agent-activity-filter"
)

type Model

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

Model is an embeddable Tasks TUI. It intentionally does not expose the internal model or store; hosts exchange only Bubble Tea messages and strings.

func NewEmbedded

func NewEmbedded(options EmbeddedOptions) (*Model, error)

NewEmbedded resolves the normal Tasks configuration and builds the same application, renderer, provider registry, and agent queue as tasks-tui.

func (*Model) ClearQuitRequest

func (m *Model) ClearQuitRequest()

ClearQuitRequest acknowledges a nested quit request without closing Tasks.

func (*Model) Close

func (m *Model) Close() error

Close saves the host-specific session and shuts down the Tasks agent queue. It is safe to call more than once.

func (*Model) CommandAvailable

func (m *Model) CommandAvailable(commandID string) (bool, error)

CommandAvailable evaluates one exported command against the model's current focus and live selection. It distinguishes conditional commands that share a default key.

func (*Model) ConsumesTextInput

func (m *Model) ConsumesTextInput() bool

ConsumesTextInput reports whether printable keys belong to Tasks input.

func (*Model) Contexts

func (m *Model) Contexts() []string

Contexts reports the current presentation-only context filters.

func (*Model) CurrentView

func (m *Model) CurrentView() View

CurrentView reports the active Tasks view.

func (*Model) FocusContext

func (m *Model) FocusContext() FocusContext

FocusContext is the stable Tasks interaction context for host key routing.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init starts the Tasks file-watch tick and loads the first read model.

func (*Model) Invoke

func (m *Model) Invoke(commandID string) (tea.Cmd, error)

Invoke executes one available exported command by stable ID, without replaying a possibly ambiguous default key.

func (*Model) QuitRequested

func (m *Model) QuitRequested() bool

QuitRequested reports a nested quit request for the host to handle.

func (*Model) Update

func (m *Model) Update(message tea.Msg) (*Model, tea.Cmd)

Update passes a Bubble Tea v2 message into Tasks. Nested quit never returns tea.Quit; use QuitRequested to observe a non-suppressed request.

func (*Model) View

func (m *Model) View(width, height int) string

View renders Tasks at the host's allotted size without alternate-screen or mouse-mode ownership leaking into the host.

func (*Model) Warnings

func (m *Model) Warnings() []string

Warnings returns non-fatal messages produced by normal Tasks configuration.

type ThemeOptions

type ThemeOptions struct {
	Name   string
	Colors map[string]string
}

ThemeOptions are Tasks semantic theme values, independent of any host UI.

type View

type View string

View is a stable Tasks view key used for initial presentation only.

const (
	ViewAgenda    View = "agenda"
	ViewNext      View = "next"
	ViewQuadrants View = "quadrants"
	ViewInbox     View = "inbox"
	ViewProjects  View = "projects"
	ViewOutline   View = "outline"
)

Jump to

Keyboard shortcuts

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