components

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationViewRenderer added in v0.27.0

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

ApplicationViewRenderer handles rendering of different application views

func NewApplicationViewRenderer added in v0.27.0

func NewApplicationViewRenderer(theme shared.Theme) *ApplicationViewRenderer

NewApplicationViewRenderer creates a new application view renderer

func (*ApplicationViewRenderer) RenderChatInterface added in v0.27.0

func (r *ApplicationViewRenderer) RenderChatInterface(
	data ChatInterfaceData,
	conversationView shared.ConversationRenderer,
	inputView shared.InputComponent,
	statusView shared.StatusComponent,
	helpBar shared.HelpBarComponent,
	approvalView shared.ApprovalComponent,
) string

RenderChatInterface renders the main chat interface

func (*ApplicationViewRenderer) RenderFileSelection added in v0.27.0

func (r *ApplicationViewRenderer) RenderFileSelection(
	data FileSelectionData,
	fileSelectionView *FileSelectionView,
) string

RenderFileSelection renders the file selection view

type ApprovalComponent added in v0.27.0

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

ApprovalComponent handles rendering of tool approval requests

func NewApprovalComponent added in v0.27.0

func NewApprovalComponent(theme shared.Theme) *ApprovalComponent

NewApprovalComponent creates a new approval component

func (*ApprovalComponent) Render added in v0.27.0

func (a *ApprovalComponent) Render(toolExecution *domain.ToolExecutionSession, selectedIndex int) string

Render renders the approval component for a given tool execution

func (*ApprovalComponent) SetHeight added in v0.27.0

func (a *ApprovalComponent) SetHeight(height int)

SetHeight sets the component height

func (*ApprovalComponent) SetWidth added in v0.27.0

func (a *ApprovalComponent) SetWidth(width int)

SetWidth sets the component width

type ChatInterfaceData added in v0.27.0

type ChatInterfaceData struct {
	Width, Height   int
	ToolExecution   *domain.ToolExecutionSession
	ApprovalUIState *domain.ApprovalUIState
	CurrentView     domain.ViewState
}

ChatInterfaceData holds the data needed to render the chat interface

type ConversationView

type ConversationView struct {
	Viewport viewport.Model
	// contains filtered or unexported fields
}

ConversationView handles the chat conversation display

func NewConversationView

func NewConversationView() *ConversationView

func (*ConversationView) CanScrollDown

func (cv *ConversationView) CanScrollDown() bool

func (*ConversationView) CanScrollUp

func (cv *ConversationView) CanScrollUp() bool

func (*ConversationView) GetScrollOffset

func (cv *ConversationView) GetScrollOffset() int

func (*ConversationView) Init

func (cv *ConversationView) Init() tea.Cmd

Bubble Tea interface

func (*ConversationView) IsToolResultExpanded

func (cv *ConversationView) IsToolResultExpanded(index int) bool

func (*ConversationView) Render

func (cv *ConversationView) Render() string

func (*ConversationView) SetConversation

func (cv *ConversationView) SetConversation(conversation []domain.ConversationEntry)

func (*ConversationView) SetHeight

func (cv *ConversationView) SetHeight(height int)

func (*ConversationView) SetWidth

func (cv *ConversationView) SetWidth(width int)

func (*ConversationView) ToggleAllToolResultsExpansion added in v0.26.0

func (cv *ConversationView) ToggleAllToolResultsExpansion()

func (*ConversationView) ToggleToolResultExpansion

func (cv *ConversationView) ToggleToolResultExpansion(index int)

func (*ConversationView) Update

func (cv *ConversationView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ConversationView) View

func (cv *ConversationView) View() string

type DiffRenderer added in v0.27.0

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

DiffRenderer handles rendering colored diffs for tool previews

func NewDiffRenderer added in v0.27.0

func NewDiffRenderer(theme shared.Theme) *DiffRenderer

NewDiffRenderer creates a new diff renderer

func (*DiffRenderer) RenderColoredDiff added in v0.27.0

func (r *DiffRenderer) RenderColoredDiff(oldContent, newContent string) string

RenderColoredDiff creates a colored diff view

func (*DiffRenderer) RenderEditToolArguments added in v0.27.0

func (r *DiffRenderer) RenderEditToolArguments(args map[string]any) string

RenderEditToolArguments renders Edit tool arguments with a colored diff preview

func (*DiffRenderer) RenderMultiEditToolArguments added in v0.27.0

func (r *DiffRenderer) RenderMultiEditToolArguments(args map[string]any) string

RenderMultiEditToolArguments renders MultiEdit tool arguments with a colored diff preview

type FileSelectionAction added in v0.27.0

type FileSelectionAction int

FileSelectionAction represents the type of action taken in file selection

const (
	FileSelectionActionNone FileSelectionAction = iota
	FileSelectionActionSelect
	FileSelectionActionCancel
)

type FileSelectionData added in v0.27.0

type FileSelectionData struct {
	Width         int
	Files         []string
	SearchQuery   string
	SelectedIndex int
}

FileSelectionData holds the data needed to render the file selection view

type FileSelectionHandler added in v0.27.0

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

FileSelectionHandler handles file selection logic and state management

func NewFileSelectionHandler added in v0.27.0

func NewFileSelectionHandler(theme shared.Theme) *FileSelectionHandler

NewFileSelectionHandler creates a new file selection handler

func (*FileSelectionHandler) CreateStatusMessage added in v0.27.0

func (h *FileSelectionHandler) CreateStatusMessage(action FileSelectionAction, selectedFile string) tea.Cmd

CreateStatusMessage creates appropriate status messages for file selection actions

func (*FileSelectionHandler) HandleKeyEvent added in v0.27.0

func (h *FileSelectionHandler) HandleKeyEvent(
	keyMsg tea.KeyMsg,
	files []string,
	searchQuery string,
	selectedIndex int,
) (newSearchQuery string, newSelectedIndex int, action FileSelectionAction, selectedFile string)

HandleKeyEvent processes key events for file selection

func (*FileSelectionHandler) RenderFileSelection added in v0.27.0

func (h *FileSelectionHandler) RenderFileSelection(data FileSelectionData) string

RenderFileSelection renders the file selection view

func (*FileSelectionHandler) UpdateInputWithSelectedFile added in v0.27.0

func (h *FileSelectionHandler) UpdateInputWithSelectedFile(currentInput string, cursor int, selectedFile string) (newInput string, newCursor int)

UpdateInputWithSelectedFile updates input text with the selected file

type FileSelectionView added in v0.27.0

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

func NewFileSelectionView added in v0.27.0

func NewFileSelectionView(theme shared.Theme) *FileSelectionView

func (*FileSelectionView) RenderView added in v0.27.0

func (f *FileSelectionView) RenderView(allFiles []string, searchQuery string, selectedIndex int) string

func (*FileSelectionView) SetWidth added in v0.27.0

func (f *FileSelectionView) SetWidth(width int)

type HelpBar

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

HelpBar displays keyboard shortcuts at the bottom of the screen

func NewHelpBar

func NewHelpBar() *HelpBar

func (*HelpBar) Init

func (hb *HelpBar) Init() tea.Cmd

Bubble Tea interface

func (*HelpBar) IsEnabled

func (hb *HelpBar) IsEnabled() bool

func (*HelpBar) Render

func (hb *HelpBar) Render() string

func (*HelpBar) SetEnabled

func (hb *HelpBar) SetEnabled(enabled bool)

func (*HelpBar) SetHeight

func (hb *HelpBar) SetHeight(height int)

func (*HelpBar) SetShortcuts

func (hb *HelpBar) SetShortcuts(shortcuts []shared.KeyShortcut)

func (*HelpBar) SetWidth

func (hb *HelpBar) SetWidth(width int)

func (*HelpBar) Update

func (hb *HelpBar) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*HelpBar) View

func (hb *HelpBar) View() string

type InputView

type InputView struct {
	Autocomplete shared.AutocompleteInterface
	// contains filtered or unexported fields
}

InputView handles user input with history and autocomplete

func NewInputView

func NewInputView(modelService domain.ModelService) *InputView

func (*InputView) AddToHistory added in v0.27.0

func (iv *InputView) AddToHistory(text string) error

AddToHistory adds the current input to the history

func (*InputView) CanHandle

func (iv *InputView) CanHandle(key tea.KeyMsg) bool

func (*InputView) ClearInput

func (iv *InputView) ClearInput()

func (*InputView) GetCursor

func (iv *InputView) GetCursor() int

func (*InputView) GetInput

func (iv *InputView) GetInput() string

func (*InputView) HandleKey

func (iv *InputView) HandleKey(key tea.KeyMsg) (tea.Model, tea.Cmd)

func (*InputView) Init

func (iv *InputView) Init() tea.Cmd

Bubble Tea interface

func (*InputView) IsAutocompleteVisible added in v0.27.0

func (iv *InputView) IsAutocompleteVisible() bool

IsAutocompleteVisible returns whether autocomplete is currently visible

func (*InputView) NavigateHistoryDown added in v0.27.0

func (iv *InputView) NavigateHistoryDown()

NavigateHistoryDown moves down in history (to newer messages) - public method for interface

func (*InputView) NavigateHistoryUp added in v0.27.0

func (iv *InputView) NavigateHistoryUp()

NavigateHistoryUp moves up in history (to older messages) - public method for interface

func (*InputView) Render

func (iv *InputView) Render() string

func (*InputView) SetCursor

func (iv *InputView) SetCursor(position int)

func (*InputView) SetHeight

func (iv *InputView) SetHeight(height int)

func (*InputView) SetPlaceholder

func (iv *InputView) SetPlaceholder(text string)

func (*InputView) SetText

func (iv *InputView) SetText(text string)

func (*InputView) SetWidth

func (iv *InputView) SetWidth(width int)

func (*InputView) Update

func (iv *InputView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*InputView) View

func (iv *InputView) View() string

type ModelSelectorImpl added in v0.27.0

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

ModelSelectorImpl implements model selection UI

func NewModelSelector added in v0.27.0

func NewModelSelector(models []string, modelService domain.ModelService, theme shared.Theme) *ModelSelectorImpl

NewModelSelector creates a new model selector

func (*ModelSelectorImpl) GetSelected added in v0.27.0

func (m *ModelSelectorImpl) GetSelected() string

GetSelected returns the selected model

func (*ModelSelectorImpl) Init added in v0.27.0

func (m *ModelSelectorImpl) Init() tea.Cmd

func (*ModelSelectorImpl) IsCancelled added in v0.27.0

func (m *ModelSelectorImpl) IsCancelled() bool

IsCancelled returns true if selection was cancelled

func (*ModelSelectorImpl) IsSelected added in v0.27.0

func (m *ModelSelectorImpl) IsSelected() bool

IsSelected returns true if a model was selected

func (*ModelSelectorImpl) SetHeight added in v0.27.0

func (m *ModelSelectorImpl) SetHeight(height int)

SetHeight sets the height of the model selector

func (*ModelSelectorImpl) SetWidth added in v0.27.0

func (m *ModelSelectorImpl) SetWidth(width int)

SetWidth sets the width of the model selector

func (*ModelSelectorImpl) Update added in v0.27.0

func (m *ModelSelectorImpl) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*ModelSelectorImpl) View added in v0.27.0

func (m *ModelSelectorImpl) View() string

type StatusView

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

StatusView handles status messages, errors, and loading spinners

func NewStatusView

func NewStatusView() *StatusView

func (*StatusView) ClearStatus

func (sv *StatusView) ClearStatus()

func (*StatusView) Init

func (sv *StatusView) Init() tea.Cmd

Bubble Tea interface

func (*StatusView) IsShowingError

func (sv *StatusView) IsShowingError() bool

func (*StatusView) IsShowingSpinner

func (sv *StatusView) IsShowingSpinner() bool

func (*StatusView) Render

func (sv *StatusView) Render() string

func (*StatusView) SetHeight

func (sv *StatusView) SetHeight(height int)

func (*StatusView) SetTokenUsage

func (sv *StatusView) SetTokenUsage(usage string)

func (*StatusView) SetWidth

func (sv *StatusView) SetWidth(width int)

func (*StatusView) ShowError

func (sv *StatusView) ShowError(message string)

func (*StatusView) ShowSpinner

func (sv *StatusView) ShowSpinner(message string)

func (*StatusView) ShowSpinnerWithType added in v0.27.0

func (sv *StatusView) ShowSpinnerWithType(message string, statusType shared.StatusType, progress *shared.StatusProgress)

func (*StatusView) ShowStatus

func (sv *StatusView) ShowStatus(message string)

func (*StatusView) ShowStatusWithType added in v0.27.0

func (sv *StatusView) ShowStatusWithType(message string, statusType shared.StatusType, progress *shared.StatusProgress)

func (*StatusView) Update

func (sv *StatusView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*StatusView) UpdateSpinnerMessage added in v0.27.0

func (sv *StatusView) UpdateSpinnerMessage(message string, statusType shared.StatusType)

func (*StatusView) View

func (sv *StatusView) View() string

Jump to

Keyboard shortcuts

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