sidebar

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 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 MenuItem struct {
	ID       string
	Icon     string
	Label    string
	Disabled bool
}

MenuItem represents a single navigation entry in the sidebar.

type Model

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

Model is the Bubble Tea model for the cockpit sidebar.

func New

func New(items []MenuItem) Model

New creates a sidebar with the given menu items. Chat is active by default; the sidebar is visible by default.

func (Model) Init

func (m Model) Init() tea.Cmd

Init satisfies tea.Model. No initial command is needed.

func (*Model) SetActive

func (m *Model) SetActive(id string)

SetActive changes the highlighted menu item by ID and synchronizes the keyboard cursor so that Enter selects the same item that is visually active.

func (*Model) SetFocused

func (m *Model) SetFocused(f bool)

SetFocused controls whether the sidebar accepts key input.

func (*Model) SetHeight

func (m *Model) SetHeight(h int)

SetHeight stores the available height so View can fill to that size.

func (*Model) SetVisible

func (m *Model) SetVisible(v bool)

SetVisible shows or hides the sidebar.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update satisfies tea.Model. Handles mouse events unconditionally; keyboard events require focus.

func (Model) View

func (m Model) View() string

View renders the sidebar. Returns "" when not visible.

type PageSelectedMsg

type PageSelectedMsg struct {
	ID string
}

PageSelectedMsg is sent when the user selects a sidebar item.

Jump to

Keyboard shortcuts

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