Documentation
¶
Index ¶
- func CenterPosition(screenWidth, screenHeight, dialogWidth, dialogHeight int) (row, col int)
- func HandleConfirmKeys(msg tea.KeyPressMsg, keyMap ConfirmKeyMap, ...) (layout.Model, tea.Cmd, bool)
- func HandleQuit(msg tea.KeyPressMsg) tea.Cmd
- func RenderHelp(text string, contentWidth int) string
- func RenderOptions(text string, contentWidth int) string
- func RenderSeparator(contentWidth int) string
- func RenderTitle(title string, contentWidth int, style lipgloss.Style) string
- type BaseDialog
- func (b *BaseDialog) CenterDialog(renderedDialog string) (row, col int)
- func (b *BaseDialog) ComputeDialogWidth(percent, minWidth, maxWidth int) int
- func (b *BaseDialog) ContentWidth(dialogWidth, paddingX int) int
- func (b *BaseDialog) Height() int
- func (b *BaseDialog) SetSize(width, height int) tea.Cmd
- func (b *BaseDialog) Width() int
- type CloseAllDialogsMsg
- type CloseDialogMsg
- type CommandExecuteMsg
- type ConfirmKeyMap
- type Dialog
- func NewAttachmentPreviewDialog(preview editor.AttachmentPreview) Dialog
- func NewCommandPaletteDialog(categories []commands.Category) Dialog
- func NewExitConfirmationDialog() Dialog
- func NewMCPPromptInputDialog(promptName string, promptInfo mcptools.PromptInfo) Dialog
- func NewMaxIterationsDialog(maxIterations int, appInstance *app.App) Dialog
- func NewOAuthAuthorizationDialog(serverURL string, appInstance *app.App) Dialog
- func NewToolConfirmationDialog(msg *runtime.ToolCallConfirmationEvent, sessionState *service.SessionState) Dialog
- type ExitConfirmedMsg
- type MCPPromptInputDialog
- type Manager
- type OpenDialogMsg
- type RuntimeResumeMsg
- type ToolConfirmationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CenterPosition ¶ added in v1.16.0
CenterPosition calculates the centered position for a dialog given screen and dialog dimensions. Returns (row, col) suitable for use in Dialog.Position().
func HandleConfirmKeys ¶ added in v1.16.0
func HandleConfirmKeys(msg tea.KeyPressMsg, keyMap ConfirmKeyMap, onYes, onNo func() (layout.Model, tea.Cmd)) (layout.Model, tea.Cmd, bool)
HandleConfirmKeys handles Yes/No key presses for confirmation dialogs. Returns the command to execute and whether a key was matched.
func HandleQuit ¶ added in v1.16.0
func HandleQuit(msg tea.KeyPressMsg) tea.Cmd
HandleQuit checks for ctrl+c and returns tea.Quit if matched.
func RenderHelp ¶ added in v1.16.0
RenderHelp renders help text at the bottom of a dialog.
func RenderOptions ¶ added in v1.16.0
RenderOptions renders option buttons text centered.
func RenderSeparator ¶ added in v1.16.0
RenderSeparator renders a horizontal separator line.
Types ¶
type BaseDialog ¶ added in v1.16.0
type BaseDialog struct {
// contains filtered or unexported fields
}
BaseDialog provides common functionality for dialog implementations. It handles size management, position calculation, and common UI patterns.
func (*BaseDialog) CenterDialog ¶ added in v1.16.0
func (b *BaseDialog) CenterDialog(renderedDialog string) (row, col int)
CenterDialog returns the (row, col) position to center a rendered dialog.
func (*BaseDialog) ComputeDialogWidth ¶ added in v1.16.0
func (b *BaseDialog) ComputeDialogWidth(percent, minWidth, maxWidth int) int
ComputeDialogWidth calculates dialog width based on screen percentage with bounds.
func (*BaseDialog) ContentWidth ¶ added in v1.16.0
func (b *BaseDialog) ContentWidth(dialogWidth, paddingX int) int
ContentWidth calculates the inner content width given dialog width and padding.
func (*BaseDialog) Height ¶ added in v1.16.0
func (b *BaseDialog) Height() int
Height returns the current height.
func (*BaseDialog) SetSize ¶ added in v1.16.0
func (b *BaseDialog) SetSize(width, height int) tea.Cmd
SetSize updates the dialog dimensions.
func (*BaseDialog) Width ¶ added in v1.16.0
func (b *BaseDialog) Width() int
Width returns the current width.
type CloseAllDialogsMsg ¶ added in v1.5.14
type CloseAllDialogsMsg struct{}
CloseAllDialogsMsg is sent to close all dialogs in the stack
type CloseDialogMsg ¶
type CloseDialogMsg struct{}
CloseDialogMsg is sent to close the current (topmost) dialog
type CommandExecuteMsg ¶ added in v1.6.0
CommandExecuteMsg is sent when a command is selected
type ConfirmKeyMap ¶ added in v1.16.0
ConfirmKeyMap defines key bindings for confirmation dialogs (Yes/No).
func DefaultConfirmKeyMap ¶ added in v1.16.0
func DefaultConfirmKeyMap() ConfirmKeyMap
DefaultConfirmKeyMap returns the standard Yes/No key bindings.
type Dialog ¶
type Dialog interface {
layout.Model
Position() (int, int) // Returns (row, col) for dialog placement
}
Dialog defines the interface that all dialogs must implement
func NewAttachmentPreviewDialog ¶ added in v1.14.0
func NewAttachmentPreviewDialog(preview editor.AttachmentPreview) Dialog
NewAttachmentPreviewDialog returns a dialog that shows attachment content in a scrollable view.
func NewCommandPaletteDialog ¶ added in v1.6.0
NewCommandPaletteDialog creates a new command palette dialog
func NewExitConfirmationDialog ¶ added in v1.16.0
func NewExitConfirmationDialog() Dialog
NewExitConfirmationDialog creates a new exit confirmation dialog.
func NewMCPPromptInputDialog ¶ added in v1.9.25
func NewMCPPromptInputDialog(promptName string, promptInfo mcptools.PromptInfo) Dialog
NewMCPPromptInputDialog creates a new MCP prompt input dialog
func NewMaxIterationsDialog ¶ added in v1.3.6
NewMaxIterationsDialog creates a new max iterations confirmation dialog
func NewOAuthAuthorizationDialog ¶ added in v1.5.6
NewOAuthAuthorizationDialog creates a new OAuth authorization confirmation dialog
func NewToolConfirmationDialog ¶
func NewToolConfirmationDialog(msg *runtime.ToolCallConfirmationEvent, sessionState *service.SessionState) Dialog
NewToolConfirmationDialog creates a new tool confirmation dialog
type ExitConfirmedMsg ¶ added in v1.16.0
type ExitConfirmedMsg struct{}
ExitConfirmedMsg is sent when the user confirms they want to exit.
type MCPPromptInputDialog ¶ added in v1.9.25
type MCPPromptInputDialog struct {
BaseDialog
// contains filtered or unexported fields
}
MCPPromptInputDialog implements Dialog for collecting MCP prompt parameters
func (*MCPPromptInputDialog) Init ¶ added in v1.9.25
func (d *MCPPromptInputDialog) Init() tea.Cmd
Init initializes the MCP prompt input dialog
func (*MCPPromptInputDialog) Position ¶ added in v1.9.25
func (d *MCPPromptInputDialog) Position() (row, col int)
Position calculates the position to center the dialog
func (*MCPPromptInputDialog) Update ¶ added in v1.9.25
Update handles messages for the MCP prompt input dialog
func (*MCPPromptInputDialog) View ¶ added in v1.9.25
func (d *MCPPromptInputDialog) View() string
View renders the MCP prompt input dialog
type OpenDialogMsg ¶
type OpenDialogMsg struct {
Model Dialog
}
OpenDialogMsg is sent to open a new dialog
type RuntimeResumeMsg ¶ added in v1.9.7
type RuntimeResumeMsg struct {
Response runtime.ResumeType
}
type ToolConfirmationResponse ¶
type ToolConfirmationResponse struct {
Response string // "approve", "reject", or "approve-session"
}
ToolConfirmationResponse represents the user's response to tool confirmation