Documentation
¶
Index ¶
- Variables
- func NewFileCardRow(cards ...*FileCard) string
- type CodeBlock
- func (cb *CodeBlock) Blur()
- func (cb *CodeBlock) Collapse()
- func (cb *CodeBlock) Expand()
- func (cb *CodeBlock) Focus()
- func (cb *CodeBlock) Focused() bool
- func (cb *CodeBlock) GetSelectionManager() *selection.SelectionManager
- func (cb *CodeBlock) Init() tea.Cmd
- func (cb *CodeBlock) IsExpanded() bool
- func (cb *CodeBlock) Toggle()
- func (cb *CodeBlock) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (cb *CodeBlock) View() string
- type CodeBlockOption
- func WithCode(code string) CodeBlockOption
- func WithCodeBlockDesignTokens(dt *design.DesignTokens) CodeBlockOption
- func WithCodeBlockFilename(filename string) CodeBlockOption
- func WithCodeBlockLanguage(lang SyntaxLanguage) CodeBlockOption
- func WithCodeBlockMouseSelection(enabled bool) CodeBlockOption
- func WithCodeFilename(name string) CodeBlockOption
- func WithCodeLines(lines []string) CodeBlockOption
- func WithCodeMaxLines(max int) CodeBlockOption
- func WithCodeOperation(op string) CodeBlockOption
- func WithCodeSummary(summary string) CodeBlockOption
- func WithExpanded(expanded bool) CodeBlockOption
- func WithLanguage(lang string) CodeBlockOption
- func WithPreviewLines(n int) CodeBlockOption
- func WithStartLine(line int) CodeBlockOption
- type DiffBlock
- func (db *DiffBlock) Blur()
- func (db *DiffBlock) Collapse()
- func (db *DiffBlock) Expand()
- func (db *DiffBlock) Focus()
- func (db *DiffBlock) Focused() bool
- func (db *DiffBlock) GetSelectionManager() *selection.SelectionManager
- func (db *DiffBlock) Init() tea.Cmd
- func (db *DiffBlock) IsExpanded() bool
- func (db *DiffBlock) Toggle()
- func (db *DiffBlock) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (db *DiffBlock) View() string
- type DiffBlockOption
- func WithDiffBlockDesignTokens(dt *design.DesignTokens) DiffBlockOption
- func WithDiffBlockFilename(name string) DiffBlockOption
- func WithDiffBlockLanguage(lang SyntaxLanguage) DiffBlockOption
- func WithDiffBlockMouseSelection(enabled bool) DiffBlockOption
- func WithDiffContext(n int) DiffBlockOption
- func WithDiffExpanded(expanded bool) DiffBlockOption
- func WithDiffFilename(name string) DiffBlockOption
- func WithDiffLines(lines []DiffLine) DiffBlockOption
- func WithDiffMaxLines(max int) DiffBlockOption
- func WithDiffOperation(op string) DiffBlockOption
- func WithDiffSummary(summary string) DiffBlockOption
- type DiffLine
- type DiffType
- type ErrorFrame
- func (e *ErrorFrame) Blur()
- func (e *ErrorFrame) Focus()
- func (e *ErrorFrame) Focused() bool
- func (e *ErrorFrame) Init() tea.Cmd
- func (e *ErrorFrame) SetMessage(s string)
- func (e *ErrorFrame) SetTitle(s string)
- func (e *ErrorFrame) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (e *ErrorFrame) View() string
- type ErrorFrameOption
- type FileCard
- func (c *FileCard) Blur()
- func (c *FileCard) Focus()
- func (c *FileCard) Focused() bool
- func (c *FileCard) Init() tea.Cmd
- func (c *FileCard) SetAdditions(n int)
- func (c *FileCard) SetDeletions(n int)
- func (c *FileCard) SetFilename(s string)
- func (c *FileCard) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (c *FileCard) View() string
- type FileCardOption
- type Highlighter
- type IconSet
- type StatCard
- func (s *StatCard) Blur()
- func (s *StatCard) Deselect()
- func (s *StatCard) Focus()
- func (s *StatCard) Focused() bool
- func (s *StatCard) Init() tea.Cmd
- func (s *StatCard) IsSelected() bool
- func (s *StatCard) Select()
- func (s *StatCard) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (s *StatCard) View() string
- type StatCardOption
- func WithChange(change int, changePct float64) StatCardOption
- func WithColor(color string) StatCardOption
- func WithSubtitle(subtitle string) StatCardOption
- func WithTitle(title string) StatCardOption
- func WithTrend(trend []float64) StatCardOption
- func WithTrendColor(color string) StatCardOption
- func WithValue(value string) StatCardOption
- type SyntaxLanguage
- type Toast
- func (t *Toast) Blur()
- func (t *Toast) Count() int
- func (t *Toast) Dismiss(id string)
- func (t *Toast) DismissAll()
- func (t *Toast) Focus()
- func (t *Toast) Focused() bool
- func (t *Toast) Init() tea.Cmd
- func (t *Toast) Push(message string, level ToastLevel) string
- func (t *Toast) PushWithDuration(message string, level ToastLevel, d time.Duration) string
- func (t *Toast) Update(msg tea.Msg) (tui.Component, tea.Cmd)
- func (t *Toast) View() string
- type ToastItem
- type ToastLevel
- type ToastOption
Constants ¶
This section is empty.
Variables ¶
var ( // IconSetSymbols - Unicode symbols. IconSetSymbols = IconSet{ Running: "⏺", Success: "✓", Error: "✗", Warning: "⚠", Info: "ℹ", None: "⏺", } )
Functions ¶
func NewFileCardRow ¶
NewFileCardRow renders multiple cards inline with a one-space gap.
Types ¶
type CodeBlock ¶
type CodeBlock struct {
// contains filtered or unexported fields
}
CodeBlock displays source code with line numbers, syntax highlighting, and collapse/expand behavior.
func NewCodeBlock ¶
func NewCodeBlock(opts ...CodeBlockOption) *CodeBlock
func (*CodeBlock) GetSelectionManager ¶
func (cb *CodeBlock) GetSelectionManager() *selection.SelectionManager
GetSelectionManager returns the selection manager for this code block.
func (*CodeBlock) IsExpanded ¶
type CodeBlockOption ¶
type CodeBlockOption func(*CodeBlock)
CodeBlockOption configures a CodeBlock.
func WithCode ¶
func WithCode(code string) CodeBlockOption
func WithCodeBlockDesignTokens ¶ added in v2.11.0
func WithCodeBlockDesignTokens(dt *design.DesignTokens) CodeBlockOption
WithCodeBlockDesignTokens applies design system tokens to the code block.
func WithCodeBlockFilename ¶ added in v2.1.0
func WithCodeBlockFilename(filename string) CodeBlockOption
func WithCodeBlockLanguage ¶ added in v2.1.0
func WithCodeBlockLanguage(lang SyntaxLanguage) CodeBlockOption
func WithCodeBlockMouseSelection ¶
func WithCodeBlockMouseSelection(enabled bool) CodeBlockOption
func WithCodeFilename ¶
func WithCodeFilename(name string) CodeBlockOption
func WithCodeLines ¶
func WithCodeLines(lines []string) CodeBlockOption
func WithCodeMaxLines ¶
func WithCodeMaxLines(max int) CodeBlockOption
func WithCodeOperation ¶
func WithCodeOperation(op string) CodeBlockOption
func WithCodeSummary ¶
func WithCodeSummary(summary string) CodeBlockOption
func WithExpanded ¶
func WithExpanded(expanded bool) CodeBlockOption
func WithLanguage ¶
func WithLanguage(lang string) CodeBlockOption
func WithPreviewLines ¶
func WithPreviewLines(n int) CodeBlockOption
func WithStartLine ¶
func WithStartLine(line int) CodeBlockOption
type DiffBlock ¶
type DiffBlock struct {
// contains filtered or unexported fields
}
DiffBlock displays code changes with +/- indicators.
func NewDiffBlock ¶
func NewDiffBlock(opts ...DiffBlockOption) *DiffBlock
func NewDiffBlockFromStrings ¶
func NewDiffBlockFromStrings(old, new string, opts ...DiffBlockOption) *DiffBlock
func (*DiffBlock) GetSelectionManager ¶
func (db *DiffBlock) GetSelectionManager() *selection.SelectionManager
func (*DiffBlock) IsExpanded ¶
type DiffBlockOption ¶
type DiffBlockOption func(*DiffBlock)
func WithDiffBlockDesignTokens ¶ added in v2.11.0
func WithDiffBlockDesignTokens(dt *design.DesignTokens) DiffBlockOption
WithDiffBlockDesignTokens applies design system tokens to the diff block.
func WithDiffBlockFilename ¶ added in v2.3.0
func WithDiffBlockFilename(name string) DiffBlockOption
func WithDiffBlockLanguage ¶ added in v2.3.0
func WithDiffBlockLanguage(lang SyntaxLanguage) DiffBlockOption
func WithDiffBlockMouseSelection ¶
func WithDiffBlockMouseSelection(enabled bool) DiffBlockOption
func WithDiffContext ¶
func WithDiffContext(n int) DiffBlockOption
func WithDiffExpanded ¶
func WithDiffExpanded(expanded bool) DiffBlockOption
func WithDiffFilename ¶
func WithDiffFilename(name string) DiffBlockOption
func WithDiffLines ¶
func WithDiffLines(lines []DiffLine) DiffBlockOption
func WithDiffMaxLines ¶
func WithDiffMaxLines(max int) DiffBlockOption
func WithDiffOperation ¶
func WithDiffOperation(op string) DiffBlockOption
func WithDiffSummary ¶
func WithDiffSummary(summary string) DiffBlockOption
type ErrorFrame ¶
type ErrorFrame struct {
// contains filtered or unexported fields
}
ErrorFrame displays a bordered error box with a title and message body.
func NewErrorFrame ¶
func NewErrorFrame(title, message string, opts ...ErrorFrameOption) *ErrorFrame
NewErrorFrame creates a new ErrorFrame component.
func (*ErrorFrame) Focused ¶
func (e *ErrorFrame) Focused() bool
Focused returns whether the component is focused.
func (*ErrorFrame) SetMessage ¶
func (e *ErrorFrame) SetMessage(s string)
SetMessage updates the frame message.
func (*ErrorFrame) SetTitle ¶
func (e *ErrorFrame) SetTitle(s string)
SetTitle updates the frame title.
type ErrorFrameOption ¶
type ErrorFrameOption func(*ErrorFrame)
ErrorFrameOption configures an ErrorFrame.
func WithErrorFrameDesignTokens ¶
func WithErrorFrameDesignTokens(tokens *design.DesignTokens) ErrorFrameOption
WithErrorFrameDesignTokens applies design tokens to the error frame.
func WithErrorFrameTheme ¶
func WithErrorFrameTheme(theme string) ErrorFrameOption
WithErrorFrameTheme applies a named design-system theme.
func WithErrorFrameWidth ¶
func WithErrorFrameWidth(width int) ErrorFrameOption
WithErrorFrameWidth sets a fixed content width for the error frame. If width is 0, the frame auto-sizes to content.
type FileCard ¶
type FileCard struct {
// contains filtered or unexported fields
}
FileCard displays a compact filename badge with diff stats.
func NewFileCard ¶
func NewFileCard(filename string, additions, deletions int, opts ...FileCardOption) *FileCard
NewFileCard creates a new file card.
func (*FileCard) SetAdditions ¶
SetAdditions updates the added-line count.
func (*FileCard) SetDeletions ¶
SetDeletions updates the removed-line count.
func (*FileCard) SetFilename ¶
SetFilename updates the filename.
type FileCardOption ¶
type FileCardOption func(*FileCard)
FileCardOption configures a FileCard.
func WithFileCardDesignTokens ¶
func WithFileCardDesignTokens(tokens *design.DesignTokens) FileCardOption
WithFileCardDesignTokens applies design-system tokens to a file card.
func WithFileCardTheme ¶
func WithFileCardTheme(theme string) FileCardOption
WithFileCardTheme applies a named design-system theme.
type Highlighter ¶ added in v2.1.0
type Highlighter struct {
// contains filtered or unexported fields
}
Highlighter is a simple regex-based syntax highlighter for terminal output.
func NewHighlighter ¶ added in v2.1.0
func NewHighlighter(lang SyntaxLanguage) *Highlighter
NewHighlighter creates a language-specific regex highlighter.
func (*Highlighter) HighlightLine ¶ added in v2.1.0
func (h *Highlighter) HighlightLine(line string) string
HighlightLine applies syntax highlighting to a single line.
func (*Highlighter) HighlightLines ¶ added in v2.1.0
func (h *Highlighter) HighlightLines(lines []string) []string
HighlightLines highlights multiple lines.
type IconSet ¶
type IconSet struct {
Running string
Success string
Error string
Warning string
Info string
None string
}
IconSet defines icons for different statuses.
type StatCard ¶
type StatCard struct {
// contains filtered or unexported fields
}
StatCard displays a single metric with title, value, change indicator, and optional sparkline trend visualization.
func NewStatCard ¶
func NewStatCard(opts ...StatCardOption) *StatCard
NewStatCard creates a new stat card with the given configuration options.
func (*StatCard) Focus ¶
func (s *StatCard) Focus()
Focus is called when this component receives focus.
func (*StatCard) IsSelected ¶
IsSelected returns whether this card is selected.
func (*StatCard) Select ¶
func (s *StatCard) Select()
Select marks the card as selected (for drill-down).
type StatCardOption ¶
type StatCardOption func(*StatCard)
StatCardOption configures a StatCard.
func WithChange ¶
func WithChange(change int, changePct float64) StatCardOption
WithChange sets the change value and percentage.
func WithSubtitle ¶
func WithSubtitle(subtitle string) StatCardOption
WithSubtitle sets the subtitle/description.
func WithTrend ¶
func WithTrend(trend []float64) StatCardOption
WithTrend sets the sparkline trend data.
func WithTrendColor ¶
func WithTrendColor(color string) StatCardOption
WithTrendColor sets the trend line color.
func WithValue ¶
func WithValue(value string) StatCardOption
WithValue sets the main value to display.
type SyntaxLanguage ¶ added in v2.1.0
type SyntaxLanguage string
SyntaxLanguage identifies the source language used for highlighting.
const ( SyntaxLanguageGo SyntaxLanguage = "Go" SyntaxLanguageJavaScript SyntaxLanguage = "JavaScript" SyntaxLanguageTypeScript SyntaxLanguage = "TypeScript" SyntaxLanguagePython SyntaxLanguage = "Python" SyntaxLanguageRust SyntaxLanguage = "Rust" SyntaxLanguageSQL SyntaxLanguage = "SQL" SyntaxLanguageShell SyntaxLanguage = "Shell" SyntaxLanguageJSON SyntaxLanguage = "JSON" SyntaxLanguageYAML SyntaxLanguage = "YAML" SyntaxLanguageMarkdown SyntaxLanguage = "Markdown" SyntaxLanguagePlain SyntaxLanguage = "Plain" )
func DetectLanguage ¶ added in v2.1.0
func DetectLanguage(filename string) SyntaxLanguage
DetectLanguage detects language based on a filename extension.
type Toast ¶
type Toast struct {
// contains filtered or unexported fields
}
Toast displays stacked notifications with auto-dismiss behavior.
func (*Toast) Push ¶
func (t *Toast) Push(message string, level ToastLevel) string
Push adds a toast with the default duration and returns its ID.
func (*Toast) PushWithDuration ¶
PushWithDuration adds a toast with a custom duration and returns its ID.
type ToastItem ¶
type ToastItem struct {
ID string
Message string
Level ToastLevel
CreatedAt time.Time
Duration time.Duration
Dismissed bool
}
ToastItem represents a single toast notification item.
type ToastLevel ¶
type ToastLevel int
ToastLevel is the severity level for a toast notification.
const ( ToastInfo ToastLevel = iota ToastSuccess ToastWarning ToastError )
type ToastOption ¶
type ToastOption func(*Toast)
ToastOption configures a Toast.
func WithDefaultDuration ¶
func WithDefaultDuration(d time.Duration) ToastOption
WithDefaultDuration sets the default auto-dismiss duration.
func WithMaxVisible ¶
func WithMaxVisible(n int) ToastOption
WithMaxVisible sets how many toasts are rendered at once.
func WithToastDesignTokens ¶
func WithToastDesignTokens(tokens *design.DesignTokens) ToastOption
WithToastDesignTokens applies design-system colors to toast rendering.
func WithToastIconSet ¶
func WithToastIconSet(iconSet IconSet) ToastOption
WithToastIconSet sets the icon set used by toasts.
func WithToastTheme ¶
func WithToastTheme(theme string) ToastOption
WithToastTheme applies a named design-system theme.