chrome

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package chrome provides always-visible shell components for the workspace.

Index

Constants

View Source
const MetricsPanelHeight = 8

MetricsPanelHeight is the vertical space consumed by the metrics panel.

View Source
const ToastDuration = 3 * time.Second

ToastDuration is how long a toast remains visible.

Variables

This section is empty.

Functions

func SetTerminalTitle

func SetTerminalTitle(title string) tea.Cmd

SetTerminalTitle returns a Cmd that sets the terminal window/tab title using Bubble Tea's built-in OSC escape sequence support.

Types

type AccountEntry

type AccountEntry struct {
	ID   string
	Name string
}

AccountEntry holds a resolved account for display in the switcher.

type AccountSwitchCloseMsg

type AccountSwitchCloseMsg struct{}

AccountSwitchCloseMsg is sent when the switcher is dismissed without selecting.

type AccountSwitchedMsg

type AccountSwitchedMsg struct {
	AccountID   string
	AccountName string
}

AccountSwitchedMsg is sent when the user selects an account.

type AccountSwitcher

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

AccountSwitcher is an overlay that lists available Basecamp accounts and lets the user pick one. Structurally similar to the command palette.

func NewAccountSwitcher

func NewAccountSwitcher(styles *tui.Styles) AccountSwitcher

NewAccountSwitcher creates a new account switcher component.

func (*AccountSwitcher) Blur

func (a *AccountSwitcher) Blur()

Blur deactivates the switcher.

func (*AccountSwitcher) Focus

func (a *AccountSwitcher) Focus(accounts []AccountEntry) tea.Cmd

Focus activates the switcher with pre-loaded account data.

func (*AccountSwitcher) SetSize

func (a *AccountSwitcher) SetSize(width, height int)

SetSize sets the available dimensions for the overlay.

func (*AccountSwitcher) Update

func (a *AccountSwitcher) Update(msg tea.Msg) tea.Cmd

Update handles messages for the account switcher. Returns a tea.Cmd when the switcher produces an action or wants to close.

func (AccountSwitcher) View

func (a AccountSwitcher) View() string

View renders the account switcher overlay.

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

Breadcrumb renders a navigable scope trail.

func NewBreadcrumb

func NewBreadcrumb(styles *tui.Styles) Breadcrumb

NewBreadcrumb creates a new breadcrumb component.

func (b *Breadcrumb) AccountBadge() string

AccountBadge returns the current badge label (for testing).

func (b *Breadcrumb) BadgeGlobal() bool

BadgeGlobal returns whether the badge is in global mode (for testing).

func (b *Breadcrumb) BadgeIndex() int

BadgeIndex returns the badge index (for testing).

func (b Breadcrumb) Init() tea.Cmd

Init implements tea.Model.

func (b *Breadcrumb) SetAccountBadge(label string, global bool)

SetAccountBadge sets the account badge displayed before the breadcrumb trail. When global is true, the badge is rendered in a standout color to indicate the view aggregates across all accounts.

func (b *Breadcrumb) SetAccountBadgeIndexed(index int, name string)

SetAccountBadgeIndexed sets a scoped account badge with a numbered index. The index is rendered in Foreground and the name in Muted to visually connect to the account switcher's numbered shortcuts.

func (b *Breadcrumb) SetCrumbs(crumbs []string)

SetCrumbs updates the breadcrumb trail.

func (b *Breadcrumb) SetExperimental(v bool)

SetExperimental enables or disables the [experimental] badge.

func (b *Breadcrumb) SetWidth(w int)

SetWidth sets the available width.

func (b Breadcrumb) Update(msg tea.Msg) (Breadcrumb, tea.Cmd)

Update implements tea.Model.

func (b Breadcrumb) View() string

View renders the breadcrumb trail.

type Help

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

Help renders the full-screen keyboard shortcuts overlay.

func NewHelp

func NewHelp(styles *tui.Styles) Help

NewHelp creates a new help overlay component.

func (*Help) ResetScroll

func (h *Help) ResetScroll()

ResetScroll resets the scroll position to the top.

func (*Help) SetGlobalKeys

func (h *Help) SetGlobalKeys(keys [][]key.Binding)

SetGlobalKeys sets the global keybinding groups displayed in the overlay.

func (*Help) SetSize

func (h *Help) SetSize(width, height int)

SetSize sets the available dimensions for the overlay.

func (*Help) SetViewKeys

func (h *Help) SetViewKeys(keys [][]key.Binding)

SetViewKeys sets the view-specific keybinding groups.

func (*Help) SetViewTitle

func (h *Help) SetViewTitle(title string)

SetViewTitle sets the name of the current view's section header.

func (*Help) Update

func (h *Help) Update(msg tea.KeyMsg) (shouldClose bool, cmd tea.Cmd)

Update processes key events for the help overlay. It returns true when the overlay should be closed.

func (Help) View

func (h Help) View() string

View renders the help overlay.

type MetricsPanel

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

MetricsPanel renders a table of per-pool stats for observability.

func NewMetricsPanel

func NewMetricsPanel(styles *tui.Styles, statsFn func() []data.PoolStatus, apdexFn func() float64) MetricsPanel

NewMetricsPanel creates a metrics panel that reads live stats.

func (*MetricsPanel) SetWidth

func (m *MetricsPanel) SetWidth(w int)

SetWidth sets the available width.

func (MetricsPanel) View

func (m MetricsPanel) View() string

View renders the metrics panel.

type Palette

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

Palette is the command palette overlay — a text input with a filtered list of actions underneath. It is driven by the workspace and does not own the registry directly.

func NewPalette

func NewPalette(styles *tui.Styles) Palette

NewPalette creates a new command palette component.

func (*Palette) Blur

func (p *Palette) Blur()

Blur deactivates the text input.

func (*Palette) Focus

func (p *Palette) Focus() tea.Cmd

Focus activates the text input and resets state for a fresh open.

func (*Palette) SetActions

func (p *Palette) SetActions(names []string, descriptions []string, categories []string, executors []func() tea.Cmd)

SetActions replaces the full action list (already scope-filtered by the workspace).

func (*Palette) SetSize

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

SetSize sets the available dimensions for the overlay.

func (*Palette) Update

func (p *Palette) Update(msg tea.Msg) tea.Cmd

Update handles key messages while the palette is active. Returns a tea.Cmd if the palette produces an action or wants to close.

func (Palette) View

func (p Palette) View() string

View renders the command palette overlay.

type PaletteCloseMsg

type PaletteCloseMsg struct{}

PaletteCloseMsg is sent when the palette wants to close itself.

type PaletteExecMsg

type PaletteExecMsg struct {
	Cmd tea.Cmd
}

PaletteExecMsg carries the command returned by the selected action.

type PoolMetricsSummary

type PoolMetricsSummary struct {
	ActivePools int
	P50Latency  time.Duration
	ErrorRate   float64
}

PoolMetricsSummary is the status bar's view of pool health.

type QuickJump

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

QuickJump is an overlay for jumping to projects and recent items.

func NewQuickJump

func NewQuickJump(styles *tui.Styles) QuickJump

NewQuickJump creates a new quick-jump overlay component.

func (*QuickJump) Blur

func (q *QuickJump) Blur()

Blur deactivates the text input.

func (*QuickJump) Focus

func (q *QuickJump) Focus(src QuickJumpSource) tea.Cmd

Focus activates the text input and populates items from the given source.

func (*QuickJump) SetSize

func (q *QuickJump) SetSize(width, height int)

SetSize sets the available dimensions for the overlay.

func (*QuickJump) Update

func (q *QuickJump) Update(msg tea.Msg) tea.Cmd

Update handles key messages while the quick-jump is active.

func (QuickJump) View

func (q QuickJump) View() string

View renders the quick-jump overlay.

type QuickJumpCloseMsg

type QuickJumpCloseMsg struct{}

QuickJumpCloseMsg is sent when the quick-jump overlay is dismissed.

type QuickJumpExecMsg

type QuickJumpExecMsg struct {
	Cmd tea.Cmd
}

QuickJumpExecMsg carries the navigation command from the selected item.

type QuickJumpSource

type QuickJumpSource struct {
	RecentProjects   []recents.Item
	RecentRecordings []recents.Item
	Projects         []data.ProjectInfo
	AccountID        string
	// NavigateProject is called with (projectID, accountID) to produce a nav command.
	NavigateProject func(projectID int64, accountID string) tea.Cmd
	// NavigateRecording is called with (recordingID, projectID, accountID) to produce a nav command.
	NavigateRecording func(recordingID, projectID int64, accountID string) tea.Cmd
	// NavigateTool is called with (toolName, toolID, projectID, accountID) to produce a nav command.
	NavigateTool func(toolName string, toolID, projectID int64, accountID string) tea.Cmd
}

QuickJumpSource provides the data needed to populate the quick-jump list. This avoids importing workspace/data and recents directly, breaking the dependency direction.

type StatusBar

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

StatusBar renders the bottom status bar with key hints and status info.

func NewStatusBar

func NewStatusBar(styles *tui.Styles) StatusBar

NewStatusBar creates a new status bar.

func (*StatusBar) ClearStatus

func (s *StatusBar) ClearStatus()

ClearStatus clears the status message.

func (*StatusBar) HasPersistentError

func (s *StatusBar) HasPersistentError() bool

HasPersistentError returns whether an error is being displayed.

func (StatusBar) Init

func (s StatusBar) Init() tea.Cmd

Init implements tea.Model.

func (*StatusBar) SetAccount

func (s *StatusBar) SetAccount(name string)

SetAccount sets the displayed account name.

func (*StatusBar) SetGlobalHints

func (s *StatusBar) SetGlobalHints(hints []key.Binding)

SetGlobalHints sets the always-visible global key hints shown on the right.

func (*StatusBar) SetKeyHints

func (s *StatusBar) SetKeyHints(hints []key.Binding)

SetKeyHints sets the key bindings shown as hints.

func (*StatusBar) SetMetrics

func (s *StatusBar) SetMetrics(summary *PoolMetricsSummary)

SetMetrics updates the pool health metrics display.

func (*StatusBar) SetStatus

func (s *StatusBar) SetStatus(text string, isError bool)

SetStatus sets a temporary status message.

func (*StatusBar) SetWidth

func (s *StatusBar) SetWidth(w int)

SetWidth sets the available width.

func (*StatusBar) StatusGen

func (s *StatusBar) StatusGen() uint64

StatusGen returns the current status generation counter.

func (StatusBar) Update

func (s StatusBar) Update(msg tea.Msg) (StatusBar, tea.Cmd)

Update implements tea.Model.

func (StatusBar) View

func (s StatusBar) View() string

View renders the status bar.

type Toast

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

Toast renders ephemeral confirmation messages.

func NewToast

func NewToast(styles *tui.Styles) Toast

NewToast creates a new toast component.

func (*Toast) SetWidth

func (t *Toast) SetWidth(w int)

SetWidth sets the available width.

func (*Toast) Show

func (t *Toast) Show(message string, isError bool) tea.Cmd

Show displays a toast message.

func (*Toast) Update

func (t *Toast) Update(msg tea.Msg) tea.Cmd

Update handles toast tick messages.

func (Toast) View

func (t Toast) View() string

View renders the toast.

func (*Toast) Visible

func (t *Toast) Visible() bool

Visible returns whether the toast is currently displayed.

Jump to

Keyboard shortcuts

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