messagelist

package
v1.22.3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model displays the conversation history and manages rounds. Scroll, focus, and hit-test math is delegated to a viewport.Model.

Methods are split across files by responsibility:

  • messagelist.go struct, constructor, accessors, layout helpers
  • update.go message dispatch
  • render.go View, block rendering, gaps, dividers
  • mouse.go click routing, text selection
  • rounds.go round lifecycle, block collection

func New

func New(
	theme styles.Theme,
	db sqlite.DB,
	chatClient chatclient.Client,
	toolRegistry *tools.Registry,
	scope log.Scope,
) *Model

New creates a new message list.

func (*Model) CancelActiveRound

func (m *Model) CancelActiveRound()

CancelActiveRound cancels the last round if it is still active.

func (*Model) Focused

func (m *Model) Focused() bool

Focused returns whether the message list is focused.

func (*Model) HasActiveRound

func (m *Model) HasActiveRound() bool

HasActiveRound returns true if the last round is still active.

func (*Model) HasTurn added in v1.22.3

func (m *Model) HasTurn(turnID domain.MessageID) bool

HasTurn returns true when any round owns the given turn/user-message ID.

func (*Model) LastRound added in v1.14.0

func (m *Model) LastRound() *round.Model

LastRound returns the last round or nil.

func (*Model) Len

func (m *Model) Len() int

Len returns the number of rounds.

func (*Model) RemoveLastRound added in v1.11.0

func (m *Model) RemoveLastRound()

RemoveLastRound removes the last round and rebuilds blocks.

func (*Model) SetFocused

func (m *Model) SetFocused(focused bool)

SetFocused sets focus state.

func (*Model) SetOrigin

func (m *Model) SetOrigin(x, y int)

SetOrigin sets the terminal-absolute position of this component's top-left corner. Called by the parent during layout so mouse coordinates can be translated.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the dimensions.

func (*Model) StartTurn

func (m *Model) StartTurn(
	conversationID domain.ConversationID,
	accountID domain.AccountID,
	userMessageID domain.MessageID,
	input msgs.UserSubmittedInput,
	messages []domain.Message,
	context []domain.ContextEntity,
) tea.Cmd

StartTurn creates a new round and begins streaming.

func (*Model) Update

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

Update handles messages.

func (*Model) View

func (m *Model) View() string

View renders the visible portion of the message list.

Directories

Path Synopsis
Package block defines the shared interface for all visual blocks in the message list viewport.
Package block defines the shared interface for all visual blocks in the message list viewport.
Package messagelisttest provides test helpers for the messagelist package.
Package messagelisttest provides test helpers for the messagelist package.
turn/assistant/blocks/tools/action
Package action provides a generic tool UI model for simple tools that accumulate input, execute, and show status — with no custom body.
Package action provides a generic tool UI model for simple tools that accumulate input, execute, and show status — with no custom body.
turn/assistant/blocks/tools/show
Package show renders entity cards inside tool chrome.
Package show renders entity cards inside tool chrome.

Jump to

Keyboard shortcuts

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