chat

package
v1.23.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCoords added in v1.20.1

func ExtractCoords(msg tea.Msg) (x, y int, ok bool)

ExtractCoords extracts x, y coordinates from a mouse message.

Types

type HitTest added in v1.20.1

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

HitTest determines what UI element is at the given coordinates. This centralizes all hit-testing logic in one place, making it easier to understand the clickable regions and their priorities.

func NewHitTest added in v1.20.1

func NewHitTest(page *chatPage) *HitTest

NewHitTest creates a hit tester for the given chat page.

func (*HitTest) At added in v1.20.1

func (h *HitTest) At(x, y int) MouseTarget

At determines what target is at the given coordinates. It checks regions in priority order (most specific first).

type KeyMap

type KeyMap struct {
	Cancel          key.Binding
	ToggleSplitDiff key.Binding
	ToggleSidebar   key.Binding
}

KeyMap defines key bindings for the chat page

type MouseTarget added in v1.20.1

type MouseTarget int

MouseTarget represents what the mouse is interacting with.

const (
	TargetNone MouseTarget = iota
	TargetSidebarToggle
	TargetSidebarResizeHandle
	TargetSidebarStar
	TargetSidebarTitle
	TargetSidebarContent
	TargetMessages
)

type Page

type Page interface {
	layout.Model
	layout.Sizeable
	layout.Help
	CompactSession(additionalPrompt string) tea.Cmd
	Cleanup()
	// SetSessionStarred updates the sidebar star indicator
	SetSessionStarred(starred bool)
	// SetTitleRegenerating sets the title regenerating state on the sidebar
	SetTitleRegenerating(regenerating bool) tea.Cmd
	// ScrollToBottom scrolls the messages viewport to the bottom if auto-scroll is active.
	ScrollToBottom() tea.Cmd
	// IsWorking returns whether the agent is currently working
	IsWorking() bool
	// QueueLength returns the number of queued messages
	QueueLength() int
	// FocusMessages gives focus to the messages panel for keyboard scrolling
	FocusMessages() tea.Cmd
	// FocusMessageAt gives focus and selects the message at the given screen coordinates
	FocusMessageAt(x, y int) tea.Cmd
	// BlurMessages removes focus from the messages panel
	BlurMessages()
	// GetSidebarSettings returns the current sidebar display settings
	GetSidebarSettings() SidebarSettings
	// SetSidebarSettings applies sidebar display settings
	SetSidebarSettings(settings SidebarSettings)
}

Page represents the main chat content area (messages + sidebar). The editor and resize handle are owned by the parent (tui.Model).

func New

func New(a *app.App, sessionState *service.SessionState) Page

New creates a new chat page

type SidebarSettings added in v1.20.6

type SidebarSettings struct {
	Collapsed      bool
	PreferredWidth int
}

SidebarSettings holds the sidebar display settings that should persist across session changes.

Jump to

Keyboard shortcuts

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