statusbar

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package statusbar renders the persistent top bar for the Tero app.

Index

Constants

View Source
const (
	TabWaste      = 0
	TabQuality    = 1
	TabCompliance = 2
	TabServices   = 3
	TabSync       = 4
)

Tab indices for the drawer.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model renders the app status bar.

func New

func New(theme styles.Theme, scope log.Scope, syncer powersync.Syncer, host string, env string) *Model

New creates a new statusbar.

func (*Model) CloseDrawer

func (m *Model) CloseDrawer()

CloseDrawer closes the drawer.

func (*Model) DrawerView

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

DrawerView renders the drawer overlay.

func (*Model) HandleEsc added in v1.15.0

func (m *Model) HandleEsc() bool

HandleEsc lets the active tab consume an esc press before the drawer closes. Returns true if the tab consumed the event (e.g. back from detail view).

func (*Model) HandleKeyPress added in v1.15.0

func (m *Model) HandleKeyPress(msg tea.KeyPressMsg) tea.Cmd

HandleKeyPress forwards key events to the active tab's key handler.

func (*Model) Height

func (m *Model) Height() int

Height returns the height of the statusbar.

func (*Model) Init

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

Init initializes child models.

func (*Model) IsDrawerOpen

func (m *Model) IsDrawerOpen() bool

IsDrawerOpen returns whether the drawer is open.

func (*Model) NextTab

func (m *Model) NextTab()

NextTab cycles to the next drawer tab.

func (*Model) SetContextPercent

func (m *Model) SetContextPercent(percent int)

SetContextPercent sets the context window usage percentage.

func (*Model) SetDB

func (m *Model) SetDB(db sqlite.DB) tea.Cmd

SetDB sets the database for status polling.

func (*Model) SetTitle

func (m *Model) SetTitle(title string)

SetTitle sets the conversation title.

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the statusbar width.

func (*Model) ShortHelp

func (m *Model) ShortHelp() []key.Binding

ShortHelp returns keybindings shown in the keybar when the drawer is open.

func (*Model) ToggleDrawer

func (m *Model) ToggleDrawer()

ToggleDrawer toggles the drawer open/closed. Opening is suppressed until at least one tab has data.

func (*Model) Update

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

Update handles messages.

func (*Model) View

func (m *Model) View() string

View renders the statusbar.

Directories

Path Synopsis
Package compliance renders the compliance indicator in the status bar.
Package compliance renders the compliance indicator in the status bar.
Package quality renders the quality indicator in the status bar.
Package quality renders the quality indicator in the status bar.
Package services renders the services health indicator in the status bar.
Package services renders the services health indicator in the status bar.
Package syncstatus renders sync connection status.
Package syncstatus renders sync connection status.
Package waste renders the waste indicator in the status bar.
Package waste renders the waste indicator in the status bar.

Jump to

Keyboard shortcuts

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