components

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RefreshColors

func RefreshColors()

RefreshColors recomputes every component's cached colours from the current theme palette. Call it after theme.Apply.

Types

type ChatLog

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

func NewChatLog

func NewChatLog() *ChatLog

func (*ChatLog) ClearDirty

func (cl *ChatLog) ClearDirty()

func (*ChatLog) ClearSelection

func (cl *ChatLog) ClearSelection()

func (*ChatLog) GetStyle

func (cl *ChatLog) GetStyle() layout.Style

func (*ChatLog) IsDirty

func (cl *ChatLog) IsDirty() bool

func (*ChatLog) Layout

func (cl *ChatLog) Layout(x, y, w, h int)

func (*ChatLog) MakeDirty

func (cl *ChatLog) MakeDirty()

func (*ChatLog) MaxScrollOffset

func (cl *ChatLog) MaxScrollOffset() int

func (*ChatLog) MouseDown

func (cl *ChatLog) MouseDown(x, y int) bool

func (*ChatLog) MouseDrag

func (cl *ChatLog) MouseDrag(x, y int)

func (*ChatLog) MouseUp

func (cl *ChatLog) MouseUp(x, y int) string

func (*ChatLog) Render

func (cl *ChatLog) Render(s *screen.Screen)

Render satisfies layout.Component; it delegates to the public Surface path so the chatlog renders identically whether driven by the internal layout engine or a public component over capabilities.Surface.

func (*ChatLog) RenderSurface

func (cl *ChatLog) RenderSurface(s capabilities.Surface)

RenderSurface draws the chatlog using only the public Surface primitives.

func (*ChatLog) Scroll

func (cl *ChatLog) Scroll(delta int) bool

Scroll adjusts the offset (distance from the bottom) by delta, clamped to the content height. It satisfies plums.Scrollable so a public component can own its own scroll state. Returns whether the offset changed.

func (*ChatLog) ScrollToBottom

func (cl *ChatLog) ScrollToBottom() bool

ScrollToBottom returns to the newest output (offset 0).

func (*ChatLog) SetAiOutput

func (cl *ChatLog) SetAiOutput(s string)

func (*ChatLog) SetBackground

func (cl *ChatLog) SetBackground(bg string)

SetBackground sets the pane background used when the chatlog is driven as a public component (which has no layout parent to inherit from).

func (*ChatLog) SetMaxScrollObserver

func (cl *ChatLog) SetMaxScrollObserver(fn func(int))

func (*ChatLog) SetMessages

func (cl *ChatLog) SetMessages(msgs []ChatMessage)

func (*ChatLog) SetParent

func (cl *ChatLog) SetParent(p layout.Component)

func (*ChatLog) SetScrollOffset

func (cl *ChatLog) SetScrollOffset(offset int)

func (*ChatLog) SetStreaming

func (cl *ChatLog) SetStreaming(v bool)

func (*ChatLog) SetStyle

func (cl *ChatLog) SetStyle(s layout.Style)

func (*ChatLog) SetThinkingVisibility

func (cl *ChatLog) SetThinkingVisibility(v ThinkingVisibility)

func (*ChatLog) SetToolCallVisibility

func (cl *ChatLog) SetToolCallVisibility(v ToolCallVisibility)

type ChatMessage

type ChatMessage struct {
	Role    string
	Content string
}

type Cursor

type Cursor struct {
	Pos CursorPos
	// contains filtered or unexported fields
}

type CursorPos

type CursorPos struct {
	Row int
	Col int
}

func (CursorPos) Equal

func (a CursorPos) Equal(b CursorPos) bool

func (CursorPos) Less

func (a CursorPos) Less(b CursorPos) bool

type DiffLog

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

func NewDiffLog

func NewDiffLog() *DiffLog

func (*DiffLog) ClearDirty

func (d *DiffLog) ClearDirty()

func (*DiffLog) ClearSelection

func (d *DiffLog) ClearSelection()

func (*DiffLog) GetStyle

func (d *DiffLog) GetStyle() layout.Style

func (*DiffLog) IsDirty

func (d *DiffLog) IsDirty() bool

func (*DiffLog) Layout

func (d *DiffLog) Layout(x, y, w, h int)

func (*DiffLog) MakeDirty

func (d *DiffLog) MakeDirty()

func (*DiffLog) MaxScrollOffset

func (d *DiffLog) MaxScrollOffset() int

func (*DiffLog) MouseDown

func (d *DiffLog) MouseDown(x, y int) bool

func (*DiffLog) MouseDrag

func (d *DiffLog) MouseDrag(x, y int)

func (*DiffLog) MouseUp

func (d *DiffLog) MouseUp(x, y int) string

func (*DiffLog) Render

func (d *DiffLog) Render(scr *screen.Screen)

func (*DiffLog) SetContent

func (d *DiffLog) SetContent(content string)

func (*DiffLog) SetMaxScrollObserver

func (d *DiffLog) SetMaxScrollObserver(fn func(int))

func (*DiffLog) SetParent

func (d *DiffLog) SetParent(p layout.Component)

func (*DiffLog) SetScrollOffset

func (d *DiffLog) SetScrollOffset(offset int)

func (*DiffLog) SetStyle

func (d *DiffLog) SetStyle(st layout.Style)

type Div

type Div struct {
	W, H layout.Unit
	// contains filtered or unexported fields
}

func NewDiv

func NewDiv() *Div

func (*Div) AlignItems

func (d *Div) AlignItems(ai layout.AlignItems)

func (*Div) AppendChild

func (d *Div) AppendChild(children layout.Component)

func (*Div) ClearDirty

func (d *Div) ClearDirty()

func (*Div) GetStyle

func (d *Div) GetStyle() layout.Style

func (*Div) IsDirty

func (d *Div) IsDirty() bool

func (*Div) JustifyContent

func (d *Div) JustifyContent(jc layout.JustifyContent)

func (*Div) Layout

func (d *Div) Layout(x, y, w, h int)

func (*Div) MakeDirty

func (d *Div) MakeDirty()

func (*Div) Render

func (d *Div) Render(s *screen.Screen)

func (*Div) SetDirection

func (d *Div) SetDirection(dir layout.Direction)

func (*Div) SetPadding

func (d *Div) SetPadding(p layout.Padding)

func (*Div) SetParent

func (d *Div) SetParent(parent layout.Component)

func (*Div) SetSize

func (d *Div) SetSize(w, h layout.Unit)

func (*Div) SetStyle

func (d *Div) SetStyle(style layout.Style)

type Editor

type Editor struct {
	Content [][]rune
	Cursor  Cursor
	// contains filtered or unexported fields
}

func NewTextEditor

func NewTextEditor() *Editor

func (*Editor) ClearDirty

func (e *Editor) ClearDirty()

func (*Editor) ClearSelection

func (e *Editor) ClearSelection()

func (*Editor) CursorScreenPos

func (e *Editor) CursorScreenPos() (int, int)

func (*Editor) DeleteBackward

func (e *Editor) DeleteBackward()

func (*Editor) DeleteCurrentLine

func (e *Editor) DeleteCurrentLine()

func (*Editor) DeleteForward

func (e *Editor) DeleteForward()

func (*Editor) DeleteSelection

func (e *Editor) DeleteSelection()

func (*Editor) DeleteWordBackward

func (e *Editor) DeleteWordBackward()

func (*Editor) DeleteWordForward

func (e *Editor) DeleteWordForward()

func (*Editor) GetContent

func (e *Editor) GetContent() string

func (*Editor) GetStyle

func (e *Editor) GetStyle() layout.Style

func (*Editor) HasSelection

func (e *Editor) HasSelection() bool

func (*Editor) InsertNewline

func (e *Editor) InsertNewline()

func (*Editor) InsertRune

func (e *Editor) InsertRune(r rune)

func (*Editor) InsertString

func (e *Editor) InsertString(s string)

func (*Editor) IsDirty

func (e *Editor) IsDirty() bool

func (*Editor) IsMultiline

func (e *Editor) IsMultiline() bool

func (*Editor) IsPoint

func (e *Editor) IsPoint(x, y int) bool

func (*Editor) LastCursorUpdate

func (e *Editor) LastCursorUpdate(nextRow []rune) uint

func (*Editor) Layout

func (e *Editor) Layout(x, y, w, h int)

func (*Editor) MakeDirty

func (e *Editor) MakeDirty()

func (*Editor) MouseDown

func (e *Editor) MouseDown(x, y int) bool

func (*Editor) MouseDrag

func (e *Editor) MouseDrag(x, y int) bool

func (*Editor) MouseUp

func (e *Editor) MouseUp(x, y int) bool

func (*Editor) MoveCursorDown

func (e *Editor) MoveCursorDown()

func (*Editor) MoveCursorEnd

func (e *Editor) MoveCursorEnd()

func (*Editor) MoveCursorHome

func (e *Editor) MoveCursorHome()

func (*Editor) MoveCursorLeft

func (e *Editor) MoveCursorLeft()

func (*Editor) MoveCursorRight

func (e *Editor) MoveCursorRight()

func (*Editor) MoveCursorUp

func (e *Editor) MoveCursorUp()

func (*Editor) MoveWordLeft

func (e *Editor) MoveWordLeft()

func (*Editor) MoveWordRight

func (e *Editor) MoveWordRight()

func (*Editor) Render

func (e *Editor) Render(s *screen.Screen)

func (*Editor) RevealCursor

func (e *Editor) RevealCursor()

func (*Editor) Scroll

func (e *Editor) Scroll(delta int) bool

func (*Editor) ScrollBottom

func (e *Editor) ScrollBottom() bool

func (*Editor) ScrollPage

func (e *Editor) ScrollPage(direction int) bool

func (*Editor) ScrollTop

func (e *Editor) ScrollTop() bool

func (*Editor) SelectAll

func (e *Editor) SelectAll()

func (*Editor) SelectDown

func (e *Editor) SelectDown()

func (*Editor) SelectEnd

func (e *Editor) SelectEnd()

func (*Editor) SelectHome

func (e *Editor) SelectHome()

func (*Editor) SelectLeft

func (e *Editor) SelectLeft()

func (*Editor) SelectRight

func (e *Editor) SelectRight()

func (*Editor) SelectUp

func (e *Editor) SelectUp()

func (*Editor) SelectWordLeft

func (e *Editor) SelectWordLeft()

func (*Editor) SelectWordRight

func (e *Editor) SelectWordRight()

func (*Editor) SelectedText

func (e *Editor) SelectedText() string

func (*Editor) SetContent

func (e *Editor) SetContent(s string)

func (*Editor) SetMultiline

func (e *Editor) SetMultiline(v bool)

func (*Editor) SetParent

func (e *Editor) SetParent(p layout.Component)

func (*Editor) SetStyle

func (e *Editor) SetStyle(s layout.Style)

func (*Editor) Undo

func (e *Editor) Undo() bool

type InfoTab

type InfoTab struct {
	Label  string
	Active bool
}

type InfoTabs

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

func NewInfoTabs

func NewInfoTabs() *InfoTabs

func (*InfoTabs) ClearDirty

func (t *InfoTabs) ClearDirty()

func (*InfoTabs) GetStyle

func (t *InfoTabs) GetStyle() layout.Style

func (*InfoTabs) IsDirty

func (t *InfoTabs) IsDirty() bool

func (*InfoTabs) Layout

func (t *InfoTabs) Layout(x, y, w, h int)

func (*InfoTabs) MakeDirty

func (t *InfoTabs) MakeDirty()

func (*InfoTabs) Render

func (t *InfoTabs) Render(scr *screen.Screen)

func (*InfoTabs) SetParent

func (t *InfoTabs) SetParent(p layout.Component)

func (*InfoTabs) SetStyle

func (t *InfoTabs) SetStyle(st layout.Style)

func (*InfoTabs) SetTabs

func (t *InfoTabs) SetTabs(tabs []InfoTab)

type InputBox

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

func NewInputBox

func NewInputBox(ed *Editor) *InputBox

func (*InputBox) ClearDirty

func (b *InputBox) ClearDirty()

func (*InputBox) GetStyle

func (b *InputBox) GetStyle() layout.Style

func (*InputBox) IsDirty

func (b *InputBox) IsDirty() bool

func (*InputBox) Layout

func (b *InputBox) Layout(x, y, w, h int)

func (*InputBox) MakeDirty

func (b *InputBox) MakeDirty()

func (*InputBox) Render

func (b *InputBox) Render(s *screen.Screen)

func (*InputBox) SetParent

func (b *InputBox) SetParent(p layout.Component)

func (*InputBox) SetStatus

func (b *InputBox) SetStatus(s string)

func (*InputBox) SetStatusSegments

func (b *InputBox) SetStatusSegments(segs []StatusSegment)

func (*InputBox) SetStyle

func (b *InputBox) SetStyle(s layout.Style)
type Popup struct {
	// contains filtered or unexported fields
}

func NewPopup

func NewPopup() *Popup

func (*Popup) ClearDirty

func (p *Popup) ClearDirty()

func (*Popup) GetStyle

func (p *Popup) GetStyle() layout.Style

func (*Popup) IsDirty

func (p *Popup) IsDirty() bool

func (*Popup) Layout

func (p *Popup) Layout(x, y, w, h int)

func (*Popup) MakeDirty

func (p *Popup) MakeDirty()

func (*Popup) Render

func (p *Popup) Render(s *screen.Screen)

func (*Popup) SetItems

func (p *Popup) SetItems(items []PopupItem, active int)

func (*Popup) SetPanel

func (p *Popup) SetPanel(panel bool)

func (*Popup) SetParent

func (p *Popup) SetParent(parent layout.Component)

func (*Popup) SetQuery

func (p *Popup) SetQuery(query string)

func (*Popup) SetTitle

func (p *Popup) SetTitle(title string)

type PopupItem

type PopupItem struct {
	Title    string
	Detail   string
	Disabled bool
}

type Separator

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

func NewSeparator

func NewSeparator() *Separator

func (*Separator) ClearDirty

func (s *Separator) ClearDirty()

func (*Separator) GetStyle

func (s *Separator) GetStyle() layout.Style

func (*Separator) IsDirty

func (s *Separator) IsDirty() bool

func (*Separator) Layout

func (s *Separator) Layout(x, y, w, h int)

func (*Separator) MakeDirty

func (s *Separator) MakeDirty()

func (*Separator) Render

func (s *Separator) Render(scr *screen.Screen)

func (*Separator) SetParent

func (s *Separator) SetParent(p layout.Component)

func (*Separator) SetStatus

func (s *Separator) SetStatus(serverStarting, serverReady, aiThinking bool)

func (*Separator) SetStyle

func (s *Separator) SetStyle(st layout.Style)

type SessionItem

type SessionItem struct {
	ID        string
	Title     string
	Directory string
	Updated   int64
	Current   bool
}

type SessionMouseAction

type SessionMouseAction int
const (
	SessionMouseNone SessionMouseAction = iota
	SessionMouseNew
	SessionMouseSelect
)

type Sessions

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

func NewSessions

func NewSessions(orientation SessionsOrientation) *Sessions

func (*Sessions) ClearDirty

func (s *Sessions) ClearDirty()

func (*Sessions) Contains

func (s *Sessions) Contains(x, y int) bool

func (*Sessions) GetStyle

func (s *Sessions) GetStyle() layout.Style

func (*Sessions) IsDirty

func (s *Sessions) IsDirty() bool

func (*Sessions) Layout

func (s *Sessions) Layout(x, y, w, h int)

func (*Sessions) MakeDirty

func (s *Sessions) MakeDirty()

func (*Sessions) MouseDown

func (s *Sessions) MouseDown(x, y int) (SessionMouseAction, string, bool)

func (*Sessions) Render

func (s *Sessions) Render(scr *screen.Screen)

func (*Sessions) Scroll

func (s *Sessions) Scroll(delta int) bool

func (*Sessions) SetItems

func (s *Sessions) SetItems(items []SessionItem)

func (*Sessions) SetOrientation

func (s *Sessions) SetOrientation(orientation SessionsOrientation)

func (*Sessions) SetParent

func (s *Sessions) SetParent(p layout.Component)

func (*Sessions) SetStyle

func (s *Sessions) SetStyle(st layout.Style)

type SessionsOrientation

type SessionsOrientation int
const (
	SessionsVertical SessionsOrientation = iota
	SessionsHorizontal
)

type StatusBar

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

func NewStatusBar

func NewStatusBar() *StatusBar

func (*StatusBar) ClearDirty

func (s *StatusBar) ClearDirty()

func (*StatusBar) GetStyle

func (s *StatusBar) GetStyle() layout.Style

func (*StatusBar) IsDirty

func (s *StatusBar) IsDirty() bool

func (*StatusBar) Layout

func (s *StatusBar) Layout(x, y, w, h int)

func (*StatusBar) MakeDirty

func (s *StatusBar) MakeDirty()

func (*StatusBar) Render

func (s *StatusBar) Render(scr *screen.Screen)

func (*StatusBar) SetMode

func (s *StatusBar) SetMode(mode string)

func (*StatusBar) SetModel

func (s *StatusBar) SetModel(providerID, modelID string)

func (*StatusBar) SetParent

func (s *StatusBar) SetParent(p layout.Component)

func (*StatusBar) SetSession

func (s *StatusBar) SetSession(title string)

func (*StatusBar) SetShowSession

func (s *StatusBar) SetShowSession(v bool)

func (*StatusBar) SetStatus

func (s *StatusBar) SetStatus(serverStarting, serverReady, aiThinking bool)

func (*StatusBar) SetStyle

func (s *StatusBar) SetStyle(st layout.Style)

type StatusSegment

type StatusSegment struct {
	Text string
	Fg   string
}

StatusSegment is one coloured fragment of the status line shown above the input panel. An empty Fg falls back to the default faint status colour.

type Text

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

func NewText

func NewText() *Text

func (*Text) ClearDirty

func (t *Text) ClearDirty()

func (*Text) GetStyle

func (t *Text) GetStyle() layout.Style

func (*Text) IsDirty

func (t *Text) IsDirty() bool

func (*Text) Layout

func (t *Text) Layout(x, y, w, h int)

func (*Text) MakeDirty

func (t *Text) MakeDirty()

func (*Text) Render

func (t *Text) Render(s *screen.Screen)

func (*Text) SetContent

func (t *Text) SetContent(c string)

func (*Text) SetParent

func (t *Text) SetParent(p layout.Component)

type ThinkingVisibility

type ThinkingVisibility int
const (
	ThinkingVisibilityFull ThinkingVisibility = iota
	ThinkingVisibilityTitle
	ThinkingVisibilityHidden
)

type ToolCallVisibility

type ToolCallVisibility int
const (
	ToolCallVisibilityFull ToolCallVisibility = iota
	ToolCallVisibilityCollapse
	ToolCallVisibilityHidden
)

Jump to

Keyboard shortcuts

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