sourcepicker

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Msg

type Msg interface {
	// contains filtered or unexported methods
}

Msg marks the picker's async messages so the parent model can route them with a single type-switch case.

type Picker

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

Picker is a tabbed, searchable modal for browsing external sources. Each tab corresponds to a registered source (PRs, issues, etc.) with lazy initialization and per-tab result caching.

func New

func New(tabSources []TabSource, initialTab, scope string, width, height int) Picker

New constructs a tabbed picker. initialTab selects the initially active tab by source ID; if not found the first tab is used.

func (Picker) Cancelled

func (p Picker) Cancelled() bool

Cancelled reports whether the user dismissed the picker.

func (*Picker) Init

func (p *Picker) Init() tea.Cmd

Init kicks off the initial tab: checks availability, initializes, and searches.

func (Picker) Selected

func (p Picker) Selected() (Result, bool)

Selected returns the highlighted item if the user pressed enter.

func (*Picker) SetSize

func (p *Picker) SetSize(width, height int)

SetSize updates rendering dimensions.

func (Picker) Update

func (p Picker) Update(msg tea.Msg) (Picker, tea.Cmd)

Update handles messages.

func (Picker) View

func (p Picker) View() string

type Result

type Result struct {
	Item      sources.Item
	SourceID  string
	Source    sources.Source
	Manifest  sources.Manifest
	Templates sources.TemplateConfig
}

Result is the item selected by the user, if any. Source and Manifest let the parent fetch the item's detail (capability-gated) before rendering session templates.

type SpinnerTickMsg

type SpinnerTickMsg = spinner.TickMsg

SpinnerTickMsg re-exports spinner.TickMsg so the parent can route it.

type TabSource

type TabSource struct {
	ID        string
	Source    sources.Source
	Manifest  sources.Manifest
	Templates sources.TemplateConfig
}

TabSource pairs a source with its configuration for one picker tab.

Jump to

Keyboard shortcuts

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