theme

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IconDirCollapsed = "▸"
	IconDirExpanded  = "▾"
	IconFile         = ""
	IconFileModified = "●"
	IconFileBinary   = ""
)

Directory and tree icons

View Source
const (
	TreeBranch     = "├── "
	TreeLastBranch = "└── "
	TreeVertical   = "│   "
	TreeSpace      = "    "
)

Tree connector characters

View Source
const (
	GitModified  = "[M]"
	GitAdded     = "[+]"
	GitDeleted   = "[D]"
	GitUntracked = "[?]"
	GitConflict  = "[!]"
	GitRenamed   = "[R]"
	GitCopied    = "[C]"
)

Git status indicators

View Source
const (
	GitBranchIcon = ""
	GitAhead      = "↑"
	GitBehind     = "↓"
	GitDirty      = "*"
)

Git branch icons

View Source
const (
	StatusRunning = "●"
	StatusIdle    = "○"
)

Status indicators

View Source
const (
	PanelDiamond = "◈"
)

Panel decorations

Variables

View Source
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

View Source
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

View Source
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

View Source
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

View Source
var (
	BgSelection   = lipgloss.Color("#3D2D5E") // Selection background
	TextSelection = lipgloss.Color("#FFFFFF") // Selected text color
)

Selection Colors - Text selection highlighting

View Source
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

View Source
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

View Source
var (
	PanelInactive lipgloss.Style
	PanelActive   lipgloss.Style
	PanelFocused  lipgloss.Style
)

Panel styles

View Source
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

View Source
var (
	FileTreeDir      lipgloss.Style
	FileTreeFile     lipgloss.Style
	FileTreeSelected lipgloss.Style
)

File tree styles

View Source
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

View Source
var (
	DiffAddedStyle      lipgloss.Style
	DiffRemovedStyle    lipgloss.Style
	DiffContextStyle    lipgloss.Style
	DiffHunkStyle       lipgloss.Style
	DiffLineNumberStyle lipgloss.Style
)

Diff styles

View Source
var (
	StatusBarStyle     lipgloss.Style
	StatusBarSection   lipgloss.Style
	StatusBarHighlight lipgloss.Style
)

Status bar styles

View Source
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

View Source
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

View Source
var SpinnerDots = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}

Spinner frames for loading animations

View Source
var SpinnerPulse = []string{"░", "▒", "▓", "█", "▓", "▒"}
View Source
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

func FormatScrollIndicator(percent float64) string

FormatScrollIndicator returns a formatted scroll percentage indicator. Returns empty string if percent is 100 (at bottom) or invalid.

func FormatStatusIndicator

func FormatStatusIndicator(running bool) string

FormatStatusIndicator returns a running/idle status indicator.

func GetDirIcon

func GetDirIcon(name string) string

GetDirIcon returns the appropriate icon for a directory name.

func GetFileIcon

func GetFileIcon(ext string) string

GetFileIcon returns the appropriate icon for a file extension.

func GetGitStatusStyle

func GetGitStatusStyle(code rune) lipgloss.Style

GetGitStatusStyle returns the style for a git status code.

func GetPanelStyle

func GetPanelStyle(focused bool) lipgloss.Style

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

func RenderTitle(title string, focused bool) string

RenderTitle renders a panel title with decorations.

func SetThemeIndex

func SetThemeIndex(index int) bool

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 AllThemes

func AllThemes() []*Theme

AllThemes returns all available themes.

func CurrentTheme

func CurrentTheme() *Theme

CurrentTheme returns the currently active theme.

func DefaultTheme

func DefaultTheme() *Theme

DefaultTheme returns the default cyberpunk theme.

func FeralJungleTheme

func FeralJungleTheme() *Theme

FeralJungleTheme - Deep in the rainforest

func LobsterBoyTheme

func LobsterBoyTheme() *Theme

LobsterBoyTheme - Fresh from the seafood shack

func MidnightMiamiTheme

func MidnightMiamiTheme() *Theme

MidnightMiamiTheme - Neon pink and cyan on deep purple

func NextTheme

func NextTheme() *Theme

NextTheme cycles to the next theme and applies it.

func PinaColadaTheme

func PinaColadaTheme() *Theme

PinaColadaTheme - Tropical sunset vibes

func VampireWeekendTheme

func VampireWeekendTheme() *Theme

VampireWeekendTheme - Gothic but make it indie

func (*Theme) GetDirIcon

func (t *Theme) GetDirIcon(name string, expanded bool) string

GetDirIcon returns the icon for a directory, respecting the UseNerdFonts setting.

func (*Theme) GetFileIcon

func (t *Theme) GetFileIcon(ext string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL