Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LayoutConfig ¶ added in v1.19.1
type LayoutConfig struct {
// PaddingLeft is the space between the left edge of the sidebar and content.
// This replaces the external wrapper padding that was previously in chat.go.
PaddingLeft int
// PaddingRight is the space between the content and the right edge (when no scrollbar).
PaddingRight int
// ScrollbarGap is the space between content and the scrollbar when visible.
ScrollbarGap int
}
LayoutConfig defines the spacing and sizing parameters for the sidebar. All values are in terminal columns.
Layout diagram for vertical mode:
|<-- outerWidth (m.width) ----------------------->| |<-PL->|<-- contentWidth -->|<-SG->|<-SW->| | | Tab Title────────| | │ | | | Content here | | │ | | | | | │ |
PL = PaddingLeft, SG = ScrollbarGap, SW = scrollbar.Width
func DefaultLayoutConfig ¶ added in v1.19.1
func DefaultLayoutConfig() LayoutConfig
DefaultLayoutConfig returns the default sidebar layout configuration.
type Metrics ¶ added in v1.19.1
type Metrics struct {
// OuterWidth is the total width allocated to the sidebar.
OuterWidth int
// ContentWidth is the width available for actual content (tabs, text, etc.).
ContentWidth int
// ScrollbarVisible indicates whether the scrollbar will be rendered.
ScrollbarVisible bool
// contains filtered or unexported fields
}
Metrics holds the computed layout metrics for a given render pass.
func (Metrics) PaddingLeft ¶ added in v1.19.1
PaddingLeft returns the left padding from the config.
func (Metrics) PaddingRight ¶ added in v1.19.1
PaddingRight returns the right padding from the config.
func (Metrics) ScrollbarGap ¶ added in v1.19.1
ScrollbarGap returns the scrollbar gap from the config.
type Model ¶
type Model interface {
layout.Model
layout.Sizeable
layout.Positionable
SetTokenUsage(event *runtime.TokenUsageEvent)
SetTodos(result *tools.ToolCallResult) error
SetMode(mode Mode)
SetAgentInfo(agentName, model, description string)
SetTeamInfo(availableAgents []runtime.AgentDetails)
SetAgentSwitching(switching bool)
SetToolsetInfo(availableTools int, loading bool)
SetSessionStarred(starred bool)
GetSize() (width, height int)
LoadFromSession(sess *session.Session)
// HandleClick checks if click is on the star and returns true if handled
HandleClick(x, y int) bool
}
Model represents a sidebar component
type Option ¶ added in v1.19.1
type Option func(*model)
Option is a functional option for configuring the sidebar.
func WithLayoutConfig ¶ added in v1.19.1
func WithLayoutConfig(cfg LayoutConfig) Option
WithLayoutConfig sets a custom layout configuration.