components

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDishSpecsContent

func BuildDishSpecsContent(spec model.DishSpecification) string

BuildDishSpecsContent builds the dish specification modal content.

func BuildHelpContent

func BuildHelpContent(version, githubURL string) string

BuildHelpContent builds the help/about modal content.

func BuildJSONContent

func BuildJSONContent(dish model.Dish) string

BuildJSONContent formats a dish as indented JSON for the preview modal.

func RenderAntennaInfo

func RenderAntennaInfo(dish model.Dish, width int) string

func RenderDownSignal

func RenderDownSignal(signals []model.DownSignal, selectedIdx int, width int, sparkline string) string

func RenderTarget

func RenderTarget(targets []model.Target, selectedIdx int, width int, distanceUnit string) string

func RenderUpSignal

func RenderUpSignal(signals []model.UpSignal, selectedIdx int, width int, sparkline string) string

Types

type CompactRow

type CompactRow struct {
	Station     string
	Dish        string
	Target      string
	UpSignals   int
	DownSignals int
	Activity    string
}

type CompactTable

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

func NewCompactTable

func NewCompactTable() CompactTable

func (CompactTable) GetVisibleContent

func (c CompactTable) GetVisibleContent() string

func (*CompactTable) RefreshStyles

func (c *CompactTable) RefreshStyles()

func (*CompactTable) SetRows

func (c *CompactTable) SetRows(rows []CompactRow)

func (*CompactTable) SetSize

func (c *CompactTable) SetSize(w, h int)

func (*CompactTable) SetSortLabel

func (c *CompactTable) SetSortLabel(label string)

func (*CompactTable) Update

func (c *CompactTable) Update(msg tea.Msg) tea.Cmd

func (CompactTable) View

func (c CompactTable) View() string

type DishDelegate

type DishDelegate struct{}

DishDelegate renders each dish list item.

func (DishDelegate) Height

func (d DishDelegate) Height() int

func (DishDelegate) Render

func (d DishDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

func (DishDelegate) Spacing

func (d DishDelegate) Spacing() int

func (DishDelegate) Update

func (d DishDelegate) Update(_ tea.Msg, _ *list.Model) tea.Cmd

type DishItem

type DishItem struct {
	Dish       model.Dish
	Bookmarked bool
}

DishItem implements list.Item for a dish entry.

func (DishItem) Description

func (d DishItem) Description() string

func (DishItem) FilterValue

func (d DishItem) FilterValue() string

func (DishItem) Title

func (d DishItem) Title() string

type DishList

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

DishList wraps a bubbles/list.Model for dish navigation.

func NewDishList

func NewDishList() DishList

func (*DishList) Index

func (d *DishList) Index() int

func (*DishList) Select

func (d *DishList) Select(index int)

func (*DishList) SetItems

func (d *DishList) SetItems(dishes []model.Dish, bookmarks map[string]bool)

func (*DishList) SetSize

func (d *DishList) SetSize(w, h int)

func (*DishList) Update

func (d *DishList) Update(msg tea.Msg) tea.Cmd

func (DishList) View

func (d DishList) View(width, height int, selectedIdx, total int) string

func (*DishList) VisibleOffset added in v0.1.1

func (d *DishList) VisibleOffset() int

VisibleOffset returns the index of the first visible item in the list.

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

func NewModal

func NewModal() Modal

func (*Modal) SetContent

func (m *Modal) SetContent(title, content string)

func (*Modal) SetSize

func (m *Modal) SetSize(w, h int)

func (*Modal) Update

func (m *Modal) Update(msg tea.Msg) tea.Cmd

func (Modal) View

func (m Modal) View() string

type ModalType

type ModalType int
const (
	ModalNone ModalType = iota
	ModalHelp
	ModalJSONPreview
	ModalDishSpecs
)

type StationBar

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

func NewStationBar

func NewStationBar() StationBar

func (*StationBar) SetWidth

func (s *StationBar) SetWidth(w int)

func (StationBar) View

func (s StationBar) View(stations []model.Station, selectedIdx int) string

type StatusBar

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

func NewStatusBar

func NewStatusBar() StatusBar

func (*StatusBar) SetWidth

func (s *StatusBar) SetWidth(w int)

func (StatusBar) View

func (s StatusBar) View(p StatusBarParams) string

type StatusBarParams

type StatusBarParams struct {
	DefaultStatus   bool
	HasTargets      bool
	HasUpSignals    bool
	HasDownSignals  bool
	HasAntennaSpec  bool
	LastUpdated     string
	LastError       string
	ConnStatus      string
	SignalChanges   []string
	RefreshInterval string
	StatusMessage   string
	DistanceUnit    string
}

Jump to

Keyboard shortcuts

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