header

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderHeight        = 6
	HeaderColumnSpacing = 2  // spaces between action columns in ContextHelp
	StatsWidth          = 30 // fixed width for stats section
	ChartWidth          = 14 // fixed width for burndown chart
	LogoWidth           = 25 // fixed width for logo
	MinContextWidth     = 40 // minimum width for context help to remain readable
	ChartSpacing        = 10 // spacing between context help and chart when both visible
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartWidget

type ChartWidget struct {
	*barchart.BarChart
}

ChartWidget displays the burndown chart

func NewChartWidgetSimple

func NewChartWidgetSimple() *ChartWidget

NewChartWidgetSimple creates a new burndown chart widget without initial data

func (*ChartWidget) Primitive

func (cw *ChartWidget) Primitive() tview.Primitive

Primitive returns the underlying tview primitive

func (*ChartWidget) UpdateBurndown

func (cw *ChartWidget) UpdateBurndown(points []store.BurndownPoint)

UpdateBurndown updates the chart with new burndown data

type ColorScheme

type ColorScheme struct {
	KeyColor   string
	LabelColor string
}

ColorScheme defines color pairs for different action categories

type ContextHelpWidget

type ContextHelpWidget struct {
	*tview.TextView
	// contains filtered or unexported fields
}

ContextHelpWidget displays keyboard shortcuts in a three-section grid layout

func NewContextHelpWidget

func NewContextHelpWidget() *ContextHelpWidget

NewContextHelpWidget creates a new context help display widget

func (*ContextHelpWidget) GetWidth

func (chw *ContextHelpWidget) GetWidth() int

GetWidth returns the current calculated width of the content

func (*ContextHelpWidget) Primitive

func (chw *ContextHelpWidget) Primitive() tview.Primitive

Primitive returns the underlying tview primitive

func (*ContextHelpWidget) SetActions

func (chw *ContextHelpWidget) SetActions(registry *controller.ActionRegistry) int

SetActions updates the display with the given action registry (backward compatible) Returns the calculated visible width of the rendered content

func (*ContextHelpWidget) SetActionsFromModel

func (chw *ContextHelpWidget) SetActionsFromModel(viewActions, pluginActions []model.HeaderAction) int

SetActionsFromModel updates the display with actions from model.HeaderAction This is the new model-based interface for the refactored architecture.

type HeaderWidget

type HeaderWidget struct {
	*tview.Flex
	// contains filtered or unexported fields
}

HeaderWidget displays stats, available actions and burndown chart

func NewHeaderWidget

func NewHeaderWidget(headerConfig *model.HeaderConfig) *HeaderWidget

NewHeaderWidget creates a header widget that observes HeaderConfig for all state

func (*HeaderWidget) Cleanup

func (h *HeaderWidget) Cleanup()

Cleanup removes the listener from HeaderConfig

func (*HeaderWidget) Draw

func (h *HeaderWidget) Draw(screen tcell.Screen)

Draw overrides to implement responsive layout

type SetActionsParams

type SetActionsParams struct {
	ViewActions   []model.HeaderAction // view-specific actions (from HeaderConfig)
	PluginActions []model.HeaderAction // plugin navigation actions (from HeaderConfig)
}

SetActionsParams holds parameters for SetActionsWithPlugins

type StatCollector

type StatCollector interface {
	// AddStat registers or updates a stat. Lower priority values display higher.
	// Returns false if the stat limit (6) is reached and key doesn't exist.
	AddStat(key, value string, priority int) bool

	// RemoveStat removes a stat by key. Returns true if stat existed.
	RemoveStat(key string) bool

	// GetStat retrieves current value for a stat. Returns empty string if not found.
	GetStat(key string) string
}

StatCollector allows components to register and manage dynamic stats displayed in the header's stats widget.

type StatsWidget

type StatsWidget struct {
	*tview.TextView
	// contains filtered or unexported fields
}

StatsWidget displays application statistics dynamically

func NewStatsWidget

func NewStatsWidget() *StatsWidget

NewStatsWidget creates a new stats display widget

func (*StatsWidget) AddStat

func (sw *StatsWidget) AddStat(key, value string, priority int) bool

AddStat registers or updates a stat. Lower priority values display higher. Returns false if the stat limit (6) is reached and key doesn't exist.

func (*StatsWidget) GetKeys

func (sw *StatsWidget) GetKeys() []string

GetKeys returns all current stat keys

func (*StatsWidget) GetStat

func (sw *StatsWidget) GetStat(key string) string

GetStat retrieves current value for a stat. Returns empty string if not found.

func (*StatsWidget) Primitive

func (sw *StatsWidget) Primitive() tview.Primitive

Primitive returns the underlying tview primitive

func (*StatsWidget) RemoveStat

func (sw *StatsWidget) RemoveStat(key string) bool

RemoveStat removes a stat by key. Returns true if stat existed.

Jump to

Keyboard shortcuts

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