Documentation
¶
Index ¶
- Variables
- func FormatNumber(n int) string
- func LoadDataCmd(repoPaths []string) tea.Cmd
- func RenderFooter(repoCount, excludedCount, width int, version string) string
- func RenderHeader(width, repoCount, excludedCount int, version string) string
- func RenderHelpBar(ctx HelpContext) string
- func RenderImpactBar(added, removed, maxValue, barWidth int) string
- func RenderRepoCount(total, excluded int) string
- func RenderSectionHeader(label string, width int) string
- func RenderStatBoxes(commits, added, removed, aiCommits int) string
- func RenderTimePicker(activeIdx int) string
- func Truncate(s string, width int) string
- type AggregateView
- type DataLoadedMsg
- type HelpContext
- type Model
- type MonthActivity
- type OperativeView
- type TimePreset
- type ViewMode
Constants ¶
This section is empty.
Variables ¶
var ( // Primary neons ColorCyan = lipgloss.Color("#00FFFF") ColorMagenta = lipgloss.Color("#FF00FF") ColorGreen = lipgloss.Color("#00FF88") ColorAmber = lipgloss.Color("#FFB000") ColorRed = lipgloss.Color("#FF0040") // Banner vertical gradient (top → bottom) ColorBannerGrad = [7]lipgloss.Color{ "#00FFFF", "#00EEFF", "#00CCDD", "#00AACC", "#0088AA", "#006688", "#005577", } // Cyan shades for bars ColorCyanMid = lipgloss.Color("#00BBDD") ColorCyanDim = lipgloss.Color("#005577") // Magenta shades for bars ColorMagentaMid = lipgloss.Color("#CC00CC") ColorMagentaDim = lipgloss.Color("#660066") // Backgrounds & chrome ColorBg = lipgloss.Color("#050510") ColorDimCyan = lipgloss.Color("#005566") ColorDimWhite = lipgloss.Color("#555555") ColorBrightWht = lipgloss.Color("#E0E0E0") ColorRowEven = lipgloss.Color("#0A0A1A") ColorRowOdd = lipgloss.Color("#070714") ColorRowSelect = lipgloss.Color("#0C2030") // Rank podium ColorGold = lipgloss.Color("#FFD700") ColorSilver = lipgloss.Color("#C0C0C0") ColorBronze = lipgloss.Color("#CD7F32") )
var ( StyleApp = lipgloss.NewStyle().Background(ColorBg) // Header / title StyleTitle = lipgloss.NewStyle().Foreground(ColorCyan).Bold(true) StyleSubtitle = lipgloss.NewStyle().Foreground(ColorDimCyan) StyleClassification = lipgloss.NewStyle().Foreground(ColorMagenta).Bold(true) // Stat boxes — heavy border, more padding StyleStatBox = lipgloss.NewStyle(). Border(lipgloss.ThickBorder()). BorderForeground(ColorDimCyan). Padding(0, 3). Align(lipgloss.Center) StyleStatValue = lipgloss.NewStyle().Foreground(ColorCyan).Bold(true) StyleStatLabel = lipgloss.NewStyle().Foreground(ColorDimCyan) // Table header StyleTableHeader = lipgloss.NewStyle().Foreground(ColorCyan).Bold(true) StyleSectionLabel = lipgloss.NewStyle().Foreground(ColorDimCyan) // Row backgrounds StyleRowEven = lipgloss.NewStyle().Background(ColorRowEven) StyleRowOdd = lipgloss.NewStyle().Background(ColorRowOdd) StyleRowSelected = lipgloss.NewStyle().Background(ColorRowSelect).Bold(true).Foreground(ColorCyan) // Rank column StyleRank = lipgloss.NewStyle().Foreground(ColorDimCyan) StyleRankGold = lipgloss.NewStyle().Foreground(ColorGold).Bold(true) StyleRankSilver = lipgloss.NewStyle().Foreground(ColorSilver).Bold(true) StyleRankBronze = lipgloss.NewStyle().Foreground(ColorBronze).Bold(true) // Data cells StyleAuthor = lipgloss.NewStyle().Foreground(ColorBrightWht) StyleNumeric = lipgloss.NewStyle().Foreground(ColorGreen) // Impact bars StyleBarCyan = lipgloss.NewStyle().Foreground(ColorCyan) StyleBarCyanMid = lipgloss.NewStyle().Foreground(ColorCyanMid) StyleBarCyanDim = lipgloss.NewStyle().Foreground(ColorCyanDim) StyleBarMagenta = lipgloss.NewStyle().Foreground(ColorMagenta) StyleBarMagentaMid = lipgloss.NewStyle().Foreground(ColorMagentaMid) StyleBarMagentaDim = lipgloss.NewStyle().Foreground(ColorMagentaDim) // Time picker StyleTimePickerActive = lipgloss.NewStyle(). Foreground(ColorCyan). Bold(true) StyleTimePickerInactive = lipgloss.NewStyle(). Foreground(ColorDimWhite). Padding(0, 1) // Footer & help StyleHelpKey = lipgloss.NewStyle().Foreground(ColorCyan) StyleHelpDesc = lipgloss.NewStyle().Foreground(ColorDimWhite) // Reusable StyleDimWhite = lipgloss.NewStyle().Foreground(ColorDimWhite) StyleCyan = lipgloss.NewStyle().Foreground(ColorCyan) StyleMagenta = lipgloss.NewStyle().Foreground(ColorMagenta) StyleDimCyan = lipgloss.NewStyle().Foreground(ColorDimCyan) StyleCursor = lipgloss.NewStyle().Foreground(ColorCyan).Bold(true) StyleAmber = lipgloss.NewStyle().Foreground(ColorAmber) StyleGlitchLine = lipgloss.NewStyle().Foreground(ColorCyan) // Repo overlay tags (kept for compatibility) StyleRepoTag = lipgloss.NewStyle(). Foreground(ColorMagenta). Border(lipgloss.RoundedBorder()). BorderForeground(lipgloss.Color("#550055")). Padding(0, 1) StyleRepoTagActive = lipgloss.NewStyle(). Foreground(ColorMagenta). Border(lipgloss.RoundedBorder()). BorderForeground(ColorMagenta). Bold(true). Padding(0, 1) StyleTimePicker = lipgloss.NewStyle().Foreground(ColorDimWhite) )
var StyleGreen = lipgloss.NewStyle().Foreground(ColorGreen)
StyleGreen is used for status indicators.
var TimePresets = []TimePreset{ {Label: "1d", Duration: 24 * time.Hour}, {Label: "7d", Duration: 7 * 24 * time.Hour}, {Label: "14d", Duration: 14 * 24 * time.Hour}, {Label: "30d", Duration: 30 * 24 * time.Hour}, {Label: "90d", Duration: 90 * 24 * time.Hour}, {Label: "1y", Duration: 365 * 24 * time.Hour}, {Label: "ALL", Duration: 0}, }
Functions ¶
func FormatNumber ¶
FormatNumber formats an integer with thousand separators.
func LoadDataCmd ¶
LoadDataCmd returns a Cmd that concurrently collects commits from all repos.
func RenderFooter ¶
RenderFooter renders the repo count and timestamp status line. The timestamp right-aligns to the separator width (width - 4).
func RenderHeader ¶
RenderHeader renders the ASCII banner with a vertical color gradient, subtitle, classification stamp, and a heavy separator.
func RenderHelpBar ¶
func RenderHelpBar(ctx HelpContext) string
RenderHelpBar renders context-aware key binding hints with bracket styling.
func RenderImpactBar ¶
RenderImpactBar renders a gradient bar: solid core fading to ▓▒░ at the edge. Cyan for added, magenta for removed.
func RenderRepoCount ¶
RenderRepoCount renders the repo count indicator.
func RenderSectionHeader ¶
RenderSectionHeader renders a labeled separator line: ── LABEL ──────────
func RenderStatBoxes ¶
RenderStatBoxes renders heavy-bordered stat boxes for aggregate metrics.
func RenderTimePicker ¶
RenderTimePicker renders time presets with the active one styled differently.
Types ¶
type AggregateView ¶
type AggregateView struct{}
AggregateView renders the aggregate leaderboard table.
func (AggregateView) RenderTable ¶
func (v AggregateView) RenderTable(authors []stats.AuthorStats, selectedRow int, sortField stats.SortField, width int) string
RenderTable returns a styled leaderboard string for the given authors.
type DataLoadedMsg ¶
type DataLoadedMsg struct {
Records []git.CommitRecord
RepoNames []string
Err error
}
DataLoadedMsg is sent after background data collection completes. Exported so main.go can construct it.
type HelpContext ¶
type HelpContext struct {
View string // "aggregate", "operative"
}
HelpContext describes the current UI state for context-aware help.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root Bubble Tea model.
func NewModel ¶
func NewModel(repoPaths []string, initialSort stats.SortField, excluded map[string]bool, version string) Model
NewModel creates an initial Model ready to display the loading state.
type MonthActivity ¶
MonthActivity holds commit stats for a single month.
type OperativeView ¶
type OperativeView struct{}
OperativeView renders a contributor detail screen.
func (OperativeView) RenderOperativeDetail ¶
func (v OperativeView) RenderOperativeDetail( authorName string, authorStats *stats.AuthorStats, records []git.CommitRecord, width int, timeIdx int, repoCount int, excludedCount int, ) string
RenderOperativeDetail renders the full operative detail view.
type TimePreset ¶
TimePreset represents a time range filter option.