defaults

package
v0.3.34 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReadyPlaceholders = Randomizer{
	"Ready!",
	"Ready...",
	"Ready?",
	"Ready for instructions",
}

ReadyPlaceholders is a randomizer for ready placeholders.

View Source
var WorkingPlaceholders = Randomizer{
	"Working!",
	"Working...",
	"Brrrrr...",
	"Prrrrrrrr...",
	"Processing...",
	"Thinking...",
}

WorkingPlaceholders is a randomizer for working placeholders.

Functions

func BottomLeftRect

func BottomLeftRect(area uv.Rectangle, width, height int) uv.Rectangle

BottomLeftRect returns a new [Rectangle] positioned at the bottom-left within the given area with the specified width and height.

func Button

func Button(t *styles.Styles, opts ButtonOpts) string

Button creates a button with an underlined character and selection state.

func CenterRect

func CenterRect(area uv.Rectangle, width, height int) uv.Rectangle

CenterRect returns a new [Rectangle] centered within the given area with the specified width and height.

func DialogTitle

func DialogTitle(t *styles.Styles, title string, width int, fromColor, toColor color.Color) string

DialogTitle renders a dialog title with a decorative line filling the remaining width. When the title alone exceeds the available width it is truncated with an ellipsis so it never wraps.

func HitButtonIndex

func HitButtonIndex(c *lipgloss.Compositor, x, y int) int

HitButtonIndex checks a compositor for a button hit and returns the button index, or -1 if no button was hit.

func JoinScrollbar

func JoinScrollbar(t *styles.Styles, view string, height, contentSize, viewportSize, offset int) string

JoinScrollbar joins a view with a scrollbar if needed.

func Scrollbar

func Scrollbar(s *styles.Styles, height, contentSize, viewportSize, offset int) string

Scrollbar renders a vertical scrollbar based on content and viewport size. Returns an empty string if content fits within viewport (no scrolling needed).

Types

type ButtonOpts

type ButtonOpts struct {
	// Text is the button label
	Text string
	// UnderlineIndex is the 0-based index of the character to underline (-1 for none)
	UnderlineIndex int
	// Selected indicates whether this button is currently selected
	Selected bool
	// Hovered indicates whether the mouse is hovering over the button
	Hovered bool
	// Inactive marks a button inside a prompt that is not in the active
	// pane. It renders lighter than the plain blurred style so the
	// choices stay legible while the chat has focus.
	Inactive bool
	// Padding inner horizontal padding defaults to 2 if this is 0
	Padding int
}

ButtonOpts defines the configuration for a single button.

type CoalescedWheelMsg

type CoalescedWheelMsg struct {
	Mouse  tea.Mouse
	DeltaX float64
	DeltaY float64
}

CoalescedWheelMsg is emitted by the input filter after collapsing many terminal wheel samples into one message. DeltaX and DeltaY carry the summed scroll magnitude so handlers can scroll proportionally.

type Randomizer

type Randomizer []string

Randomizer is an interface for generating random strings.

func (Randomizer) Random

func (r Randomizer) Random() string

Random returns a random string from the randomizer.

type UI

type UI struct {
	// Styles holds the theme styles for the UI.
	Styles *styles.Styles
	// Workspace holds the workspace configuration for the UI.
	Workspace workspaces.Workspace
}

UI returns the default UI configurations.

func DefaultUI

func DefaultUI(workspace workspaces.Workspace) *UI

DefaultUI returns the default UI configurations using the theme from config (or the default Charmtone theme if unset).

Jump to

Keyboard shortcuts

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