Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HitTest ¶
type HitTest struct {
AgentName string // populated when At() returns TargetSidebarAgent
// 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 ¶
func NewHitTest(page *chatPage) *HitTest
NewHitTest creates a hit tester for the given chat page.
func (*HitTest) At ¶
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 MouseTarget ¶
type MouseTarget int
MouseTarget represents what the mouse is interacting with.
const ( TargetNone MouseTarget = iota TargetSidebarToggle TargetSidebarResizeHandle TargetSidebarStar TargetSidebarTitle TargetSidebarWorkingDir TargetSidebarAgent TargetSidebarContent TargetMessages )
type Page ¶
type Page interface {
layout.Model
layout.Sizeable
layout.Help
CompactSession(additionalPrompt string) tea.Cmd
// 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
// IsInlineEditing returns true if a past user message is being edited inline
IsInlineEditing() bool
// IsSelecting returns true while a text-selection drag is active in the messages panel
IsSelecting() 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)
// SetLayoutSettings applies layout customization (sidebar position,
// section spacing, and section visibility) and relayouts the page.
SetLayoutSettings(settings msgtypes.LayoutSettings) tea.Cmd
// SetSendMode sets what happens to messages sent while the agent is
// working: steer into the ongoing stream or queue until the turn ends.
SetSendMode(mode msgtypes.SendMode)
// SetRoutingID records the tab identity used to address this page's
// one-shot UI timers back to it (messages.RoutedMsg.SessionID). The
// appModel keys its chat pages — and the supervisor its event routing —
// by this ID, which is the tab's initial session ID and may diverge from
// the current app.Session().ID after a session restore or in-place
// replace.
SetRoutingID(id string)
// TakeRoutedTimers returns and clears the routed one-shot timer commands
// armed by the most recent Update. The active page's Update already
// returns them inside its regular command; the appModel calls this for
// background pages — whose regular commands are discarded — so
// presentation deadlines keep running while a tab is hidden.
TakeRoutedTimers() tea.Cmd
}
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(ctx context.Context, a *app.App, sessionState *service.SessionState, opts ...PageOption) Page
New creates a new chat page
type PageOption ¶ added in v1.41.0
type PageOption func(*chatPage)
PageOption configures a chat page.
func WithCommandParser ¶ added in v1.44.0
func WithCommandParser(p *commands.Parser) PageOption
WithCommandParser injects a command parser for handling slash commands in the editor.
func WithHideSidebar ¶ added in v1.69.0
func WithHideSidebar() PageOption
WithHideSidebar hides the sidebar without enabling lean mode. The sidebar cannot be re-shown via the TUI.
func WithLayoutSettings ¶ added in v1.102.0
func WithLayoutSettings(settings msgtypes.LayoutSettings) PageOption
WithLayoutSettings applies initial layout customization (sidebar position, section spacing, and section visibility).
func WithLeanMode ¶ added in v1.41.0
func WithLeanMode() PageOption
WithLeanMode creates a lean chat page with no sidebar.
func WithSendMode ¶ added in v1.104.0
func WithSendMode(mode msgtypes.SendMode) PageOption
WithSendMode sets the initial behavior of messages sent while the agent is working: steer into the ongoing stream or queue until the turn ends.
type SidebarSettings ¶
SidebarSettings holds the sidebar display settings that should persist across session changes.