models

package
v0.3.30 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UIInitializing = iota
	UIInitialized
)

Possible UIState values.

View Source
const TextareaMaxHeight = 15

TextareaMaxHeight is the maximum height of the prompt textarea.

View Source
const TextareaMinHeight = 3

TextareaMinHeight is the minimum height of the prompt textarea.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter added in v0.3.28

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

Filter coalesces high-frequency terminal mouse input before it reaches the Bubble Tea update loop. It is safe for use with tea.WithFilter.

func NewFilter added in v0.3.28

func NewFilter() *Filter

NewFilter returns a Bubble Tea input filter that coalesces high-frequency terminal mouse input before it reaches the update queue.

func (*Filter) Filter added in v0.3.28

func (f *Filter) Filter(_ tea.Model, msg tea.Msg) tea.Msg

Filter is passed to tea.WithFilter and runs before Bubble Tea dispatches a message to the model. Returning nil drops noisy samples at the input boundary, which is early enough to keep later key presses from waiting behind a mouse flood in the update queue.

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

Header is the model for the header.

func NewHeader added in v0.3.28

func NewHeader(ui *defaults.UI) *Header

creates a new header model.

func (*Header) Draw added in v0.3.28

func (h *Header) Draw(
	scr uv.Screen,
	area uv.Rectangle,
	compact bool,
	detailsOpen bool,
	width int,
)

Draw draws the header for the given session.

type KeyMap added in v0.3.28

type KeyMap struct {
	Editor struct {
		SendMessage key.Binding
		OpenEditor  key.Binding
		Newline     key.Binding
		AddImage    key.Binding
		PasteImage  key.Binding
		MentionFile key.Binding
		Commands    key.Binding

		// Attachments key maps
		AttachmentDeleteMode key.Binding
		Escape               key.Binding
		DeleteAllAttachments key.Binding

		// History navigation
		HistoryPrev key.Binding
		HistoryNext key.Binding

		// CopySelection copies the current textarea selection to the
		// clipboard.
		CopySelection key.Binding

		// CutSelection copies the current textarea selection to the
		// clipboard and deletes it from the textarea.
		CutSelection key.Binding

		// SelectAll selects all text in the textarea.
		SelectAll key.Binding

		// PasteText pastes clipboard text into the textarea, as an
		// alternative to bracketed paste.
		PasteText key.Binding
	}

	Chat struct {
		NewSession     key.Binding
		AddAttachment  key.Binding
		Cancel         key.Binding
		Tab            key.Binding
		Details        key.Binding
		TogglePills    key.Binding
		ToggleSidebar  key.Binding
		PillLeft       key.Binding
		PillRight      key.Binding
		Down           key.Binding
		Up             key.Binding
		UpDown         key.Binding
		DownOneItem    key.Binding
		UpOneItem      key.Binding
		UpDownOneItem  key.Binding
		PageDown       key.Binding
		PageUp         key.Binding
		HalfPageDown   key.Binding
		HalfPageUp     key.Binding
		Home           key.Binding
		End            key.Binding
		EndFollow      key.Binding
		Copy           key.Binding
		ClearHighlight key.Binding
		Expand         key.Binding
		ScrollLeft     key.Binding
		ScrollRight    key.Binding
		FocusSidebar   key.Binding
		FocusChat      key.Binding
	}

	Initialize struct {
		Yes,
		No,
		Enter,
		Switch key.Binding
	}

	// Global key maps
	Quit       key.Binding
	Help       key.Binding
	Commands   key.Binding
	Models     key.Binding
	Suspend    key.Binding
	Sessions   key.Binding
	Tab        key.Binding
	ToggleYolo key.Binding
	ShiftTab   key.Binding
}

KeyMap holds the key bindings for the UI.

func DefaultKeyMap added in v0.3.28

func DefaultKeyMap() KeyMap

type Status added in v0.3.28

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

Status is the status bar and help model.

func NewStatus added in v0.3.28

func NewStatus(ui *defaults.UI, km help.KeyMap) *Status

NewStatus creates a new status bar and help model.

func (*Status) Clear added in v0.3.28

func (s *Status) Clear()

Clear clears the status info message.

func (*Status) Draw added in v0.3.28

func (s *Status) Draw(scr uv.Screen, area uv.Rectangle)

Draw draws the status bar onto the screen.

func (*Status) Set added in v0.3.28

func (s *Status) Set(msg status.InfoMsg)

Set sets the status info message.

func (*Status) SetHideHelp added in v0.3.28

func (s *Status) SetHideHelp(hideHelp bool)

SetHideHelp sets whether the app is on the onboarding flow.

func (*Status) SetWidth added in v0.3.28

func (s *Status) SetWidth(width int)

SetWidth sets the width of the status bar and help view.

func (*Status) ShowingAll added in v0.3.28

func (s *Status) ShowingAll() bool

ShowingAll returns whether the full help view is shown.

func (*Status) ToggleHelp added in v0.3.28

func (s *Status) ToggleHelp()

ToggleHelp toggles the full help view.

type UI added in v0.3.28

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

UI represents the main user interface model.

func NewUI added in v0.3.28

func NewUI(root *defaults.UI, sessionID string, sessionContinue bool) *UI

NewUI creates a new UI model with the given defaults.

func (*UI) Draw added in v0.3.28

func (m *UI) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw renders the UI model to the canvas.

func (*UI) FullHelp added in v0.3.28

func (m *UI) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*UI) Init added in v0.3.28

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

Init initializes the UI model.

func (*UI) ShortHelp added in v0.3.28

func (m *UI) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*UI) Update added in v0.3.28

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

Update handles incoming messages and updates the UI model.

func (*UI) View added in v0.3.28

func (m *UI) View() tea.View

View renders the UI model.

type UIState added in v0.3.28

type UIState uint8

UIState represents the state of the UI.

Jump to

Keyboard shortcuts

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