Documentation
¶
Index ¶
- Constants
- Variables
- func Center(width, height int, content string) string
- func Checkbox(checked bool) string
- func CreateMenuItem(icon, name, desc string, selected bool, width int) string
- func Divider(width int) string
- func FormatSize(size int64) string
- func GarbageTruckTick() tea.Cmd
- func GetQuickStats() (string, error)
- func GetRiskLabel(level scanner.RiskLevel) string
- func GetRiskStyle(level int) lipgloss.Style
- func Header(title, subtitle string) string
- func HelpBar(shortcuts []string) string
- func InitThemeManager()
- func ListItem(checkbox, name, size, extra string, selected bool, widths map[string]int) string
- func Logo() string
- func PageHeader(icon, title string, width int) string
- func ProgressBar(percent float64, width int, usedColor, freeColor lipgloss.Color) string
- func RecordSnapshot(total, used uint64, cleanedSize int64, trigger, details string) tea.Cmd
- func ScrollIndicator(offset, total, visible int) (above, below string)
- func StatsBar(stats []string) string
- func StatsLine(stats []string) string
- func StyledHelpBar(shortcuts []KeyHelp) string
- func TableHeader(columns []string, widths []int) string
- type App
- type AppUninstallerView
- type BackToMenuMsg
- type Box
- type BrowserDataView
- type DiskTrend
- type DuplicatesView
- type GarbageTruckAnimation
- type GarbageTruckTickMsg
- type KeyHelp
- type LargeFilesView
- type MainMenu
- type MenuItem
- type MenuSelectedMsg
- type RecordSnapshotMsg
- type SystemJunkViewEnhanced
- type Theme
- func (t *Theme) AccentColor() lipgloss.Color
- func (t *Theme) BorderColor() lipgloss.Color
- func (t *Theme) DangerColor() lipgloss.Color
- func (t *Theme) DimColor() lipgloss.Color
- func (t *Theme) ForegroundColor() lipgloss.Color
- func (t *Theme) GrayColor() lipgloss.Color
- func (t *Theme) LightGrayColor() lipgloss.Color
- func (t *Theme) PrimaryColor() lipgloss.Color
- func (t *Theme) SecondaryColor() lipgloss.Color
- func (t *Theme) SelectedBgColor() lipgloss.Color
- func (t *Theme) SelectedFgColor() lipgloss.Color
- func (t *Theme) SuccessColor() lipgloss.Color
- func (t *Theme) WarningColor() lipgloss.Color
- type ThemeChangedMsg
- type ThemeManager
- type ViewType
- type ZombieHunterView
Constants ¶
const ( ContentWidth = 72 HeaderHeight = 3 MaxListItems = 15 ColumnGap = 2 ColumnPadding = 1 )
Layout constants
const AppName = "Lume"
Application info
Variables ¶
var ( PrimaryColor = lipgloss.Color("#5fafff") // Bright blue SecondaryColor = lipgloss.Color("#5fd787") // Green AccentColor = lipgloss.Color("#d787ff") // Purple accent DangerColor = lipgloss.Color("#ff5f87") // Red WarningColor = lipgloss.Color("#ffd75f") // Yellow SuccessColor = lipgloss.Color("#5fd787") // Green GrayColor = lipgloss.Color("#6b7280") // Mid gray LightGrayColor = lipgloss.Color("#9ca3af") // Light gray DimColor = lipgloss.Color("#4e4e4e") // Very dim WhiteColor = lipgloss.Color("#e4e4e4") // Off-white BlackColor = lipgloss.Color("#000000") BgSelected = lipgloss.Color("#1c3a5f") // Selection bg )
Theme colors — cohesive modern palette
var ( TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(PrimaryColor) SubtitleStyle = lipgloss.NewStyle(). Foreground(LightGrayColor) HelpStyle = lipgloss.NewStyle(). Foreground(GrayColor) DimStyle = lipgloss.NewStyle(). Foreground(DimColor) AccentStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) WarningStyle = lipgloss.NewStyle(). Foreground(WarningColor). Bold(true) ErrorStyle = lipgloss.NewStyle(). Foreground(DangerColor). Bold(true) SuccessStyle = lipgloss.NewStyle(). Foreground(SecondaryColor). Bold(true) InfoBoxStyle = lipgloss.NewStyle(). Border(lipgloss.Border{ Top: "-", Bottom: "-", Left: "|", Right: "|", TopLeft: "+", TopRight: "+", BottomLeft: "+", BottomRight: "+", }). BorderForeground(GrayColor). Padding(0, 1) )
Base styles
var ( ScanItemStyle = lipgloss.NewStyle(). Padding(0, 0) SelectedScanItemStyle = lipgloss.NewStyle(). Background(BgSelected). Foreground(WhiteColor). Padding(0, 0). Bold(true) )
List styles
var ( RiskLowStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#5fd787")) RiskMediumStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#ffd75f")) RiskHighStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#ff5f87")) )
Risk level styles
var AppVersion = "v1.0.0"
AppVersion is the application version. Override at build time: go build -ldflags "-X github.com/Tyooughtul/lume/pkg/ui.AppVersion=vX.Y.Z"
var PresetThemes = map[string]Theme{
"modern": {
Name: "modern",
Description: "Modern Cyber (default)",
Primary: "#00d4ff",
Secondary: "#00ff88",
Accent: "#ff00ff",
Danger: "#ff3366",
Warning: "#ffcc00",
Success: "#00ff88",
Foreground: "#ffffff",
Gray: "#6b7280",
LightGray: "#9ca3af",
Dim: "#4e4e4e",
SelectedBg: "#0a3d62",
SelectedFg: "#ffffff",
Border: "#00d4ff",
},
"retro": {
Name: "retro",
Description: "Retro Terminal",
Primary: "#33ff33",
Secondary: "#00ff00",
Accent: "#ffff00",
Danger: "#ff3333",
Warning: "#ffaa00",
Success: "#33ff33",
Foreground: "#33ff33",
Gray: "#228822",
LightGray: "#44aa44",
Dim: "#115511",
SelectedBg: "#004400",
SelectedFg: "#33ff33",
Border: "#228822",
},
"amber": {
Name: "amber",
Description: "Amber Monitor",
Primary: "#ffb000",
Secondary: "#ffcc00",
Accent: "#ffdd44",
Danger: "#ff6600",
Warning: "#ffaa00",
Success: "#cc9900",
Foreground: "#ffb000",
Gray: "#996600",
LightGray: "#cc8800",
Dim: "#553300",
SelectedBg: "#442200",
SelectedFg: "#ffb000",
Border: "#996600",
},
"ocean": {
Name: "ocean",
Description: "Deep Ocean",
Primary: "#4fc3f7",
Secondary: "#80cbc4",
Accent: "#ff80ab",
Danger: "#ef5350",
Warning: "#ffca28",
Success: "#66bb6a",
Foreground: "#e3f2fd",
Gray: "#78909c",
LightGray: "#b0bec5",
Dim: "#37474f",
SelectedBg: "#1565c0",
SelectedFg: "#e3f2fd",
Border: "#4fc3f7",
},
"highcontrast": {
Name: "highcontrast",
Description: "High Contrast (Accessibility)",
Primary: "#ffffff",
Secondary: "#00ff00",
Accent: "#ffff00",
Danger: "#ff0000",
Warning: "#ffff00",
Success: "#00ff00",
Foreground: "#ffffff",
Gray: "#888888",
LightGray: "#cccccc",
Dim: "#666666",
SelectedBg: "#ffffff",
SelectedFg: "#000000",
Border: "#ffffff",
},
"dracula": {
Name: "dracula",
Description: "Dracula",
Primary: "#bd93f9",
Secondary: "#50fa7b",
Accent: "#ff79c6",
Danger: "#ff5555",
Warning: "#f1fa8c",
Success: "#50fa7b",
Foreground: "#f8f8f2",
Gray: "#6272a4",
LightGray: "#8be9fd",
Dim: "#44475a",
SelectedBg: "#44475a",
SelectedFg: "#f8f8f2",
Border: "#6272a4",
},
"solarized": {
Name: "solarized",
Description: "Solarized Dark",
Primary: "#268bd2",
Secondary: "#2aa198",
Accent: "#d33682",
Danger: "#dc322f",
Warning: "#b58900",
Success: "#859900",
Foreground: "#839496",
Gray: "#586e75",
LightGray: "#93a1a1",
Dim: "#073642",
SelectedBg: "#073642",
SelectedFg: "#eee8d5",
Border: "#586e75",
},
"monokai": {
Name: "monokai",
Description: "Monokai",
Primary: "#66d9ef",
Secondary: "#a6e22e",
Accent: "#f92672",
Danger: "#f92672",
Warning: "#e6db74",
Success: "#a6e22e",
Foreground: "#f8f8f2",
Gray: "#75715e",
LightGray: "#ae81ff",
Dim: "#49483e",
SelectedBg: "#49483e",
SelectedFg: "#f8f8f2",
Border: "#75715e",
},
}
PresetThemes contains all built-in themes
Functions ¶
func CreateMenuItem ¶
CreateMenuItem creates a menu item line
func GarbageTruckTick ¶ added in v1.0.3
GarbageTruckTick 返回垃圾车动画 tick 命令
func GetQuickStats ¶
func GetRiskLabel ¶ added in v1.0.1
GetRiskLabel returns a styled, fixed-width risk label. Padding is applied to the plain text BEFORE coloring, so that runewidth sees only ASCII and every line has the same visual width.
func GetRiskStyle ¶
GetRiskStyle returns style for a risk level
func InitThemeManager ¶ added in v1.0.1
func InitThemeManager()
InitThemeManager initializes the global theme manager
func PageHeader ¶
PageHeader renders a consistent page header with title and navigation hint
func ProgressBar ¶
ProgressBar renders a colored progress bar
func RecordSnapshot ¶
func ScrollIndicator ¶
ScrollIndicator returns scroll direction hints
func StyledHelpBar ¶
StyledHelpBar renders a help bar with highlighted keys
func TableHeader ¶
TableHeader creates a table header
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the main application model
type AppUninstallerView ¶
type AppUninstallerView struct {
// contains filtered or unexported fields
}
func NewAppUninstallerView ¶
func NewAppUninstallerView() *AppUninstallerView
func (*AppUninstallerView) Init ¶
func (m *AppUninstallerView) Init() tea.Cmd
func (AppUninstallerView) View ¶
func (m AppUninstallerView) View() string
type BackToMenuMsg ¶
type BackToMenuMsg struct{}
type BrowserDataView ¶
type BrowserDataView struct {
// contains filtered or unexported fields
}
func NewBrowserDataView ¶
func NewBrowserDataView() *BrowserDataView
func (*BrowserDataView) Init ¶
func (m *BrowserDataView) Init() tea.Cmd
func (BrowserDataView) View ¶
func (m BrowserDataView) View() string
type DiskTrend ¶
type DiskTrend struct {
// contains filtered or unexported fields
}
func NewDiskTrend ¶
func NewDiskTrend() *DiskTrend
type DuplicatesView ¶
type DuplicatesView struct {
// contains filtered or unexported fields
}
func NewDuplicatesView ¶
func NewDuplicatesView() *DuplicatesView
func (*DuplicatesView) Init ¶
func (m *DuplicatesView) Init() tea.Cmd
func (DuplicatesView) View ¶
func (m DuplicatesView) View() string
type GarbageTruckAnimation ¶ added in v1.0.3
type GarbageTruckAnimation struct {
// contains filtered or unexported fields
}
GarbageTruckAnimation garbage truck idle animation
func NewGarbageTruckAnimation ¶ added in v1.0.3
func NewGarbageTruckAnimation() *GarbageTruckAnimation
func (*GarbageTruckAnimation) Draw ¶ added in v1.0.3
func (g *GarbageTruckAnimation) Draw(width int) string
func (*GarbageTruckAnimation) Update ¶ added in v1.0.3
func (g *GarbageTruckAnimation) Update()
type GarbageTruckTickMsg ¶ added in v1.0.3
type GarbageTruckTickMsg struct{}
GarbageTruckTickMsg 垃圾车动画 tick
type LargeFilesView ¶
type LargeFilesView struct {
// contains filtered or unexported fields
}
func NewLargeFilesView ¶
func NewLargeFilesView() *LargeFilesView
func (*LargeFilesView) Init ¶
func (m *LargeFilesView) Init() tea.Cmd
func (LargeFilesView) View ¶
func (m LargeFilesView) View() string
type MainMenu ¶
type MainMenu struct {
ThemeNotif string // transient theme-switch notification
// contains filtered or unexported fields
}
func NewMainMenu ¶
func NewMainMenu() *MainMenu
type MenuSelectedMsg ¶
type MenuSelectedMsg struct {
View ViewType
}
type RecordSnapshotMsg ¶
type SystemJunkViewEnhanced ¶
type SystemJunkViewEnhanced struct {
// contains filtered or unexported fields
}
func NewSystemJunkViewEnhanced ¶
func NewSystemJunkViewEnhanced() *SystemJunkViewEnhanced
func (*SystemJunkViewEnhanced) Init ¶
func (m *SystemJunkViewEnhanced) Init() tea.Cmd
func (SystemJunkViewEnhanced) View ¶
func (m SystemJunkViewEnhanced) View() string
type Theme ¶ added in v1.0.1
type Theme struct {
Name string `json:"name"`
Description string `json:"description"`
// Core colors
Primary string `json:"primary"` // primary (titles, selected items)
Secondary string `json:"secondary"` // secondary (success, idle state)
Accent string `json:"accent"` // accent (special highlights)
Danger string `json:"danger"` // danger / alert
Warning string `json:"warning"` // warning / attention
Success string `json:"success"` // success / complete
// Neutral colors
Background string `json:"background"` // background
Foreground string `json:"foreground"` // foreground / text
Gray string `json:"gray"` // medium gray
LightGray string `json:"light_gray"` // light gray (secondary text)
Dim string `json:"dim"` // dim gray (dividers)
// Interactive states
SelectedBg string `json:"selected_bg"` // selected background
SelectedFg string `json:"selected_fg"` // selected foreground
Border string `json:"border"` // border color
}
Theme defines a complete color theme
func (*Theme) AccentColor ¶ added in v1.0.1
func (*Theme) BorderColor ¶ added in v1.0.1
func (*Theme) DangerColor ¶ added in v1.0.1
func (*Theme) ForegroundColor ¶ added in v1.0.1
func (*Theme) LightGrayColor ¶ added in v1.0.1
func (*Theme) PrimaryColor ¶ added in v1.0.1
Lipgloss colors
func (*Theme) SecondaryColor ¶ added in v1.0.1
func (*Theme) SelectedBgColor ¶ added in v1.0.1
func (*Theme) SelectedFgColor ¶ added in v1.0.1
func (*Theme) SuccessColor ¶ added in v1.0.1
func (*Theme) WarningColor ¶ added in v1.0.1
type ThemeChangedMsg ¶ added in v1.0.1
type ThemeChangedMsg struct{}
ThemeChangedMsg is sent when the theme changes
type ThemeManager ¶ added in v1.0.1
ThemeManager manages theme configuration
var GlobalThemeManager *ThemeManager
Global theme manager instance
func NewThemeManager ¶ added in v1.0.1
func NewThemeManager() *ThemeManager
NewThemeManager creates a theme manager
func (*ThemeManager) GetThemeNames ¶ added in v1.0.1
func (tm *ThemeManager) GetThemeNames() []string
GetThemeNames returns all available theme names (sorted for stable switch order)
func (*ThemeManager) NextTheme ¶ added in v1.0.1
func (tm *ThemeManager) NextTheme() string
NextTheme cycles to the next theme
func (*ThemeManager) SetTheme ¶ added in v1.0.1
func (tm *ThemeManager) SetTheme(name string) error
SetTheme switches to the specified theme
type ZombieHunterView ¶ added in v1.0.2
type ZombieHunterView struct {
// contains filtered or unexported fields
}
ZombieHunterView shows file access heatmap
func NewZombieHunterView ¶ added in v1.0.2
func NewZombieHunterView() *ZombieHunterView
func (*ZombieHunterView) Init ¶ added in v1.0.2
func (m *ZombieHunterView) Init() tea.Cmd
func (*ZombieHunterView) View ¶ added in v1.0.2
func (m *ZombieHunterView) View() string