Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyTheme(t *Theme)
- func CurrentThemeIndex() int
- func FormatScrollIndicator(percent float64) string
- func FormatStatusIndicator(running bool) string
- func GetDirIcon(name string) string
- func GetFileIcon(ext string) string
- func GetGitStatusStyle(code rune) lipgloss.Style
- func GetPanelStyle(focused bool) lipgloss.Style
- func RenderPanelWithTitle(content string, opts PanelTitleOptions, width, height int, focused bool) string
- func RenderTitle(title string, focused bool) string
- func SetThemeIndex(index int) bool
- type ColorPalette
- type PanelTitleOptions
- type Theme
- type TitleSegmentInfo
Constants ¶
const ( IconDirCollapsed = "▸" IconDirExpanded = "▾" IconFile = "" IconFileModified = "●" IconFileBinary = "" )
Directory and tree icons
const ( TreeBranch = "├── " TreeLastBranch = "└── " TreeVertical = "│ " TreeSpace = " " )
Tree connector characters
const ( GitModified = "[M]" GitAdded = "[+]" GitDeleted = "[D]" GitUntracked = "[?]" GitConflict = "[!]" GitRenamed = "[R]" GitCopied = "[C]" )
Git status indicators
const ( GitBranchIcon = "" GitAhead = "↑" GitBehind = "↓" GitDirty = "*" )
Git branch icons
const ( StatusRunning = "●" StatusIdle = "○" )
Status indicators
const (
PanelDiamond = "◈"
)
Panel decorations
Variables ¶
var ( MagentaBlaze color.Color = lipgloss.Color("#FF00FF") // Primary accent CyberCyan color.Color = lipgloss.Color("#00FFFF") // Secondary accent HotPink color.Color = lipgloss.Color("#FF10F0") // Selections/Focus MatrixGreen color.Color = lipgloss.Color("#39FF14") // Git additions/success NeonRed color.Color = lipgloss.Color("#FF3131") // Git deletions/errors ElectricYellow color.Color = lipgloss.Color("#FFFF00") // Warnings/modified LaserPurple color.Color = lipgloss.Color("#7B68EE") // AI/special features )
Neon Core Colors - Primary accent colors for the cyberpunk theme
var ( VoidPurple color.Color = lipgloss.Color("#0D0221") // Primary background DeepSpace color.Color = lipgloss.Color("#1A0A2E") // Panel backgrounds Twilight color.Color = lipgloss.Color("#2D1B4E") // Active panel background Abyss color.Color = lipgloss.Color("#0A0A14") // Mini buffer background )
Background Colors - Dark backgrounds for the cyberpunk aesthetic
var ( PureWhite color.Color = lipgloss.Color("#FFFFFF") // Primary text Silver color.Color = lipgloss.Color("#E0E0E0") // Secondary text MutedLavender color.Color = lipgloss.Color("#888899") // Disabled/comments DimPurple color.Color = lipgloss.Color("#4A4A6A") // Line numbers )
Text Colors - Text hierarchy from bright to dim
var ( BgDiffAdded color.Color = lipgloss.Color("#0D2818") // Dark green tint BgDiffRemoved color.Color = lipgloss.Color("#2D0A0A") // Dark red tint BgDiffHunk color.Color = lipgloss.Color("#1A1A3E") // Hunk header background )
Diff Background Colors - Subtle tints for diff highlighting
var ( BgSelection = lipgloss.Color("#3D2D5E") // Selection background TextSelection = lipgloss.Color("#FFFFFF") // Selected text color )
Selection Colors - Text selection highlighting
var ( ColorPrimary color.Color = MagentaBlaze ColorSecondary color.Color = CyberCyan ColorFocus color.Color = HotPink ColorSuccess color.Color = MatrixGreen ColorError color.Color = NeonRed ColorWarning color.Color = ElectricYellow ColorAI color.Color = LaserPurple BgPrimary color.Color = VoidPurple BgPanel color.Color = DeepSpace BgPanelActive color.Color = Twilight BgMiniBuffer color.Color = Abyss TextPrimary color.Color = PureWhite TextSecondary color.Color = Silver TextMuted color.Color = MutedLavender TextDim color.Color = DimPurple )
Semantic Color Aliases - Use these in components for consistency
var ( // NeonBorder uses heavy lines for a bold look NeonBorder = lipgloss.Border{ Top: "━", Bottom: "━", Left: "┃", Right: "┃", TopLeft: "┏", TopRight: "┓", BottomLeft: "┗", BottomRight: "┛", } // GlowBorder uses rounded corners for a softer look GlowBorder = lipgloss.Border{ Top: "─", Bottom: "─", Left: "│", Right: "│", TopLeft: "╭", TopRight: "╮", BottomLeft: "╰", BottomRight: "╯", } // DoubleBorder for important content DoubleBorder = lipgloss.Border{ Top: "═", Bottom: "═", Left: "║", Right: "║", TopLeft: "╔", TopRight: "╗", BottomLeft: "╚", BottomRight: "╝", } )
Border definitions
var ( PanelInactive lipgloss.Style PanelActive lipgloss.Style PanelFocused lipgloss.Style )
Panel styles
var ( TextH1 lipgloss.Style TextH2 lipgloss.Style TextBody lipgloss.Style TextSecondaryStyle lipgloss.Style TextMutedStyle lipgloss.Style TextDimStyle lipgloss.Style )
Text styles - hierarchy from most to least prominent
var ( FileTreeDir lipgloss.Style FileTreeFile lipgloss.Style FileTreeSelected lipgloss.Style )
File tree styles
var ( GitStatusModified lipgloss.Style GitStatusAdded lipgloss.Style GitStatusDeleted lipgloss.Style GitStatusUntracked lipgloss.Style GitStatusConflict lipgloss.Style GitBranchStyle lipgloss.Style GitAheadStyle lipgloss.Style GitBehindStyle lipgloss.Style )
Git status styles
var ( DiffAddedStyle lipgloss.Style DiffRemovedStyle lipgloss.Style DiffContextStyle lipgloss.Style DiffHunkStyle lipgloss.Style DiffLineNumberStyle lipgloss.Style )
Diff styles
var ( StatusBarStyle lipgloss.Style StatusBarSection lipgloss.Style StatusBarHighlight lipgloss.Style )
Status bar styles
var DirIcons = map[string]string{
".git": "\ue702",
"node_modules": "\ue718",
"vendor": "\uf487",
"src": "\uf07c",
"pkg": "\uf487",
"cmd": "\uf120",
"internal": "\uf023",
"test": "\uf0c3",
"tests": "\uf0c3",
"docs": "\uf02d",
"doc": "\uf02d",
"build": "\uf085",
"dist": "\uf49e",
"bin": "\uf489",
"lib": "\uf02d",
"config": "\uf013",
".config": "\uf013",
".github": "\uf408",
".vscode": "\ue70c",
"api": "\uf1c0",
}
DirIcons maps directory names to Nerd Font icons
var FileIcons = map[string]string{
".go": "",
".mod": "",
".sum": "",
".js": "",
".ts": "",
".tsx": "",
".jsx": "",
".html": "",
".css": "",
".scss": "",
".vue": "",
".svelte": "",
".json": "",
".yaml": "",
".yml": "",
".toml": "",
".xml": "",
".md": "",
".mdx": "",
".txt": "",
".rst": "",
".env": "",
".gitignore": "",
".dockerignore": "",
".sh": "",
".bash": "",
".zsh": "",
".fish": "",
".py": "",
".pyi": "",
".pyc": "",
".rs": "",
".c": "",
".h": "",
".cpp": "",
".hpp": "",
".java": "",
".kt": "",
".rb": "",
".rake": "",
"Dockerfile": "",
".dockerfile": "",
".git": "",
".png": "",
".jpg": "",
".jpeg": "",
".gif": "",
".svg": "",
".ico": "",
".zip": "",
".tar": "",
".gz": "",
"": "",
}
FileIcons maps file extensions to Nerd Font icons
var SpinnerDots = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
Spinner frames for loading animations
var SpinnerPulse = []string{"░", "▒", "▓", "█", "▓", "▒"}
var SpinnerStyle lipgloss.Style
Spinner style
Functions ¶
func ApplyTheme ¶
func ApplyTheme(t *Theme)
ApplyTheme sets all the global color variables to match the theme.
func CurrentThemeIndex ¶
func CurrentThemeIndex() int
CurrentThemeIndex returns the index of the current theme.
func FormatScrollIndicator ¶
FormatScrollIndicator returns a formatted scroll percentage indicator. Returns empty string if percent is 100 (at bottom) or invalid.
func FormatStatusIndicator ¶
FormatStatusIndicator returns a running/idle status indicator.
func GetDirIcon ¶
GetDirIcon returns the appropriate icon for a directory name.
func GetFileIcon ¶
GetFileIcon returns the appropriate icon for a file extension.
func GetGitStatusStyle ¶
GetGitStatusStyle returns the style for a git status code.
func GetPanelStyle ¶
GetPanelStyle returns the appropriate panel style based on focus state.
func RenderPanelWithTitle ¶
func RenderPanelWithTitle(content string, opts PanelTitleOptions, width, height int, focused bool) string
RenderPanelWithTitle renders content in a panel with title embedded in the border.
func RenderTitle ¶
RenderTitle renders a panel title with decorations.
func SetThemeIndex ¶
SetThemeIndex sets the current theme by index and applies it. Returns false if index is out of bounds.
Types ¶
type ColorPalette ¶
type ColorPalette struct {
// Accent colors
Primary color.Color
Secondary color.Color
Focus color.Color
Success color.Color
Error color.Color
Warning color.Color
AI color.Color
// Background colors
BgPrimary color.Color
BgPanel color.Color
BgPanelActive color.Color
BgMiniBuffer color.Color
// Text colors
TextPrimary color.Color
TextSecondary color.Color
TextMuted color.Color
TextDim color.Color
}
ColorPalette holds all color definitions.
type PanelTitleOptions ¶
type PanelTitleOptions struct {
Title string // Main title text (e.g., "FILES", "Claude")
StatusRunning bool // Show running indicator (●) vs idle (○)
ShowStatus bool // Whether to show status at all
ScrollPercent float64 // Scroll position (0-100), negative to hide
BottomHints string // Key hints for bottom border (e.g., "↑↓:scroll q:quit")
// Dual-title support for content panel
// When SecondaryTitle is set, both titles are shown side-by-side
SecondaryTitle string // Second title (e.g., AI command name when viewing file)
SecondaryStatusRunning bool // Running indicator for secondary title
SecondaryShowStatus bool // Whether to show status for secondary title
SecondaryActive bool // Whether secondary title is the active view
PrimaryActive bool // Whether primary title is the active view
}
PanelTitleOptions configures what to show in panel borders.
type Theme ¶
type Theme struct {
// Name of the theme
Name string
// Color palette
Colors ColorPalette
// Whether to use Nerd Font icons
UseNerdFonts bool
}
Theme holds all visual configuration for the application.
func MidnightMiamiTheme ¶
func MidnightMiamiTheme() *Theme
MidnightMiamiTheme - Neon pink and cyan on deep purple
func VampireWeekendTheme ¶
func VampireWeekendTheme() *Theme
VampireWeekendTheme - Gothic but make it indie
func (*Theme) GetDirIcon ¶
GetDirIcon returns the icon for a directory, respecting the UseNerdFonts setting.
func (*Theme) GetFileIcon ¶
GetFileIcon returns the icon for a file, respecting the UseNerdFonts setting.
type TitleSegmentInfo ¶
type TitleSegmentInfo struct {
Title string // The title text
StartX int // X position where this segment starts (relative to panel)
EndX int // X position where this segment ends
IsActive bool // Whether this is the currently active source
}
TitleSegmentInfo holds pre-calculated information about a title segment for click region detection. Prepared for future split-panel support.
func CalculateTitleRegions ¶
func CalculateTitleRegions(opts PanelTitleOptions) (primary, secondary TitleSegmentInfo)
CalculateTitleRegions calculates the X regions for clickable titles in the header. Returns the regions for primary and secondary titles (if present). The regions are relative to the panel's X position.