ui

package
v0.99.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateConversationHeight added in v0.18.1

func CalculateConversationHeight(totalHeight int) int

Layout calculation utilities

func CalculateInputHeight added in v0.18.1

func CalculateInputHeight(totalHeight int) int

func CalculateStatusHeight added in v0.18.1

func CalculateStatusHeight(totalHeight int) int

Types

type ApprovalComponent added in v0.27.0

type ApprovalComponent interface {
	SetWidth(width int)
	SetHeight(height int)
	Render(toolExecution *domain.ToolExecutionSession, selectedIndex int) string
}

ApprovalComponent interface for approval display

type AutocompleteComponent added in v0.76.5

type AutocompleteComponent interface {
	Update(inputText string, cursorPos int)
	HandleKey(key tea.KeyMsg) (bool, string)
	IsVisible() bool
	ShouldExecuteImmediately() bool
	SetWidth(width int)
	SetHeight(height int)
	Render() string
	GetSelectedShortcut() string
	Hide()
	RefreshToolsList()
	GetUsageHint() string
	ClearUsageHint()
}

AutocompleteComponent defines the interface for autocomplete functionality

type ConversationRenderer

type ConversationRenderer interface {
	SetConversation([]domain.ConversationEntry)
	GetScrollOffset() int
	CanScrollUp() bool
	CanScrollDown() bool
	ToggleToolResultExpansion(index int)
	ToggleAllToolResultsExpansion()
	IsToolResultExpanded(index int) bool
	ToggleAllThinkingExpansion()
	IsThinkingExpanded(index int) bool
	ToggleRawFormat()
	IsRawFormat() bool
	ResetUserScroll()
	SetWidth(width int)
	SetHeight(height int)
	Render() string
}

ConversationRenderer interface for conversation display

type DefaultTheme

type DefaultTheme struct{}

DefaultTheme provides a concrete implementation of the Theme interface

func NewDefaultTheme

func NewDefaultTheme() *DefaultTheme

func (*DefaultTheme) GetAccentColor

func (t *DefaultTheme) GetAccentColor() string

func (*DefaultTheme) GetAssistantColor

func (t *DefaultTheme) GetAssistantColor() string

func (*DefaultTheme) GetBorderColor

func (t *DefaultTheme) GetBorderColor() string

func (*DefaultTheme) GetDiffAddColor added in v0.24.0

func (t *DefaultTheme) GetDiffAddColor() string

func (*DefaultTheme) GetDiffRemoveColor added in v0.24.0

func (t *DefaultTheme) GetDiffRemoveColor() string

func (*DefaultTheme) GetDimColor

func (t *DefaultTheme) GetDimColor() string

func (*DefaultTheme) GetErrorColor

func (t *DefaultTheme) GetErrorColor() string

func (*DefaultTheme) GetStatusColor

func (t *DefaultTheme) GetStatusColor() string

func (*DefaultTheme) GetSuccessColor added in v0.56.0

func (t *DefaultTheme) GetSuccessColor() string

func (*DefaultTheme) GetUserColor

func (t *DefaultTheme) GetUserColor() string

type HelpBarComponent added in v0.15.0

type HelpBarComponent interface {
	SetShortcuts(shortcuts []KeyShortcut)
	IsEnabled() bool
	SetEnabled(enabled bool)
	SetWidth(width int)
	SetHeight(height int)
	Render() string
}

HelpBarComponent interface for help bar

type InputComponent

type InputComponent interface {
	GetInput() string
	ClearInput()
	SetPlaceholder(text string)
	GetCursor() int
	SetCursor(position int)
	SetText(text string)
	SetWidth(width int)
	SetHeight(height int)
	Render() string
	HandleKey(key tea.KeyMsg) (tea.Model, tea.Cmd)
	CanHandle(key tea.KeyMsg) bool
	NavigateHistoryUp()
	NavigateHistoryDown()
	AddImageAttachment(image domain.ImageAttachment)
	GetImageAttachments() []domain.ImageAttachment
	ClearImageAttachments()
	AddToHistory(text string) error
	SetUsageHint(hint string)
	GetUsageHint() string
}

InputComponent interface for input handling

type InputStatusBarComponent added in v0.76.2

type InputStatusBarComponent interface {
	SetWidth(width int)
	SetHeight(height int)
	SetInputText(text string)
	UpdateMCPStatus(status *domain.MCPServerStatus)
	Render() string
}

InputStatusBarComponent interface for input status bar

type KeyShortcut added in v0.15.0

type KeyShortcut struct {
	Key         string
	Description string
}

KeyShortcut represents a keyboard shortcut with description

type ScrollDirection

type ScrollDirection int

ScrollDirection represents different scroll directions

const (
	ScrollUp ScrollDirection = iota
	ScrollDown
	ScrollToTop
	ScrollToBottom
)

type SelectionComponent

type SelectionComponent interface {
	GetOptions() []string
	SetOptions(options []string)
	GetSelected() string
	GetSelectedIndex() int
	SetSelected(index int)
	IsSelected() bool
	IsCancelled() bool
	SetWidth(width int)
	SetHeight(height int)
	Render() string
}

SelectionComponent is specific to UI layer (not duplicated in shared)

type StatusComponent

type StatusComponent interface {
	ShowStatus(message string)
	ShowError(message string)
	ShowSpinner(message string)
	ClearStatus()
	IsShowingError() bool
	IsShowingSpinner() bool
	SetWidth(width int)
	SetHeight(height int)
	Render() string
	SaveCurrentState()
	RestoreSavedState() tea.Cmd
	HasSavedState() bool
}

StatusComponent interface for status display

type Theme

type Theme interface {
	GetUserColor() string
	GetAssistantColor() string
	GetErrorColor() string
	GetSuccessColor() string
	GetStatusColor() string
	GetAccentColor() string
	GetDimColor() string
	GetBorderColor() string
	GetDiffAddColor() string
	GetDiffRemoveColor() string
}

Theme interface for UI theming

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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