contextbar

package
v1.168.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package contextbar provides a thin progress indicator showing how full the LLM context window is as a single row of half-block characters (▄).

Index

Constants

View Source
const (
	Height = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model holds the state for the context-usage bar.

func New

func New(runtime *animation.Runtime) *Model

New creates a context bar owned by runtime.

func (*Model) Cancel

func (m *Model) Cancel()

Cancel stops any in-flight animation.

func (*Model) Filled

func (m *Model) Filled() bool

Filled reports whether the bar currently renders any fill.

func (*Model) Hold

func (m *Model) Hold()

Hold marks usage as pending while keeping the displayed fill as the next origin.

func (*Model) Label

func (m *Model) Label() string

Label is the currently displayed usage reading, tracking the animated fill.

func (*Model) SetContextUsage

func (m *Model) SetContextUsage(used, limit int64) tea.Cmd

SetContextUsage updates context-window utilisation with an animated transition. A zero limit has no reading and eases the fill to an empty track.

func (*Model) SetContextUsageDirect

func (m *Model) SetContextUsageDirect(used, limit int64)

SetContextUsageDirect initializes context-window utilisation without animation.

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the available rendering width.

func (*Model) Update

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

Update handles animation tick messages.

func (*Model) View

func (m *Model) View() string

View renders the bar as a single line of [blockFill] characters followed by a "Context xx%" label.

Jump to

Keyboard shortcuts

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