components

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIPanel

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

AIPanel renders a floating overlay panel with AI-generated content.

func NewAIPanel

func NewAIPanel() AIPanel

NewAIPanel creates a new hidden AI panel.

func (AIPanel) AppendContent

func (p AIPanel) AppendContent(chunk string) AIPanel

AppendContent adds streaming content to the panel.

func (AIPanel) Hide

func (p AIPanel) Hide() AIPanel

Hide dismisses the panel.

func (AIPanel) IsVisible

func (p AIPanel) IsVisible() bool

IsVisible reports whether the panel is showing.

func (AIPanel) Render

func (p AIPanel) Render(width, height int) string

Render returns the panel as a styled overlay string.

func (AIPanel) ScrollDown

func (p AIPanel) ScrollDown() AIPanel

ScrollDown scrolls the panel content down.

func (AIPanel) ScrollUp

func (p AIPanel) ScrollUp() AIPanel

ScrollUp scrolls the panel content up.

func (AIPanel) SetDone

func (p AIPanel) SetDone() AIPanel

SetDone marks streaming as complete.

func (AIPanel) SetError

func (p AIPanel) SetError(err string) AIPanel

SetError sets an error message.

func (AIPanel) SetSize

func (p AIPanel) SetSize(width, height int) AIPanel

SetSize updates the panel dimensions.

func (AIPanel) Show

func (p AIPanel) Show(title string) AIPanel

Show makes the panel visible with initial loading state.

type CommandBar

type CommandBar struct{}

CommandBar renders a bordered command input box for `:` command mode.

func NewCommandBar

func NewCommandBar() CommandBar

NewCommandBar creates a new command bar component.

func (CommandBar) Render

func (c CommandBar) Render(input string, matches []string, width int) string

Render returns the bordered command bar with input and optional autocomplete matches.

type ContentBorder

type ContentBorder struct{}

ContentBorder renders content in a rounded border box with a title and optional item count embedded in the top border line.

func NewContentBorder

func NewContentBorder() ContentBorder

NewContentBorder creates a new content border component.

func (ContentBorder) Render

func (c ContentBorder) Render(content, title string, filtered, total, pinned, cursor, navigable, width, height int) string

Render wraps content in a bordered box with title in the top border. If filtered != total, shows "(filtered/total)". If equal and > 0, shows "(total)". If pinned > 0, appends a pin icon with count. If navigable > 0, appends "cursor/navigable" position counter. Width is the outer box width. Height is the outer box height (including borders).

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

Header renders a 3-line info block with project, chdir, workspace on the left, and an ASCII logo on the right.

func NewHeader

func NewHeader(dir, workspace string) Header

NewHeader creates a header.

func (Header) Render

func (h Header) Render(width int) string

Render produces the 3-line header at the given width.

func (Header) WithChdir added in v1.5.0

func (h Header) WithChdir(chdir string) Header

WithChdir returns a copy with the active chdir set.

func (Header) WithLockInfo added in v1.5.0

func (h Header) WithLockInfo(lock *sdk.StateLock) Header

WithLockInfo returns a copy with the lock indicator set (nil to clear).

func (Header) WithPinnedCount

func (h Header) WithPinnedCount(count int) Header

WithPinnedCount returns a copy with the pinned targets count.

func (Header) WithStale added in v1.5.0

func (h Header) WithStale(stale bool) Header

WithStale returns a copy with the stale indicator set.

func (Header) WithWorkspace added in v1.5.0

func (h Header) WithWorkspace(ws string) Header

WithWorkspace returns a copy with the workspace updated.

type StatusBar

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

func NewStatusBar

func NewStatusBar() StatusBar

func (StatusBar) Render

func (s StatusBar) Render(width int) string

func (StatusBar) RenderHints

func (s StatusBar) RenderHints(hints []sdk.KeyHint, width int) string

RenderHints formats a slice of KeyHint into a styled status bar string.

func (StatusBar) WithBinaryName

func (s StatusBar) WithBinaryName(name string) StatusBar

WithBinaryName returns a StatusBar that displays the binary name right-aligned.

func (StatusBar) WithShortcuts

func (s StatusBar) WithShortcuts(shortcuts string) StatusBar

WithShortcuts returns a StatusBar that displays the given shortcut hints.

Jump to

Keyboard shortcuts

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