ui

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Brand / Primary (Orange Scale - Dark to Bright)
	PlumMedium = lipgloss.Color("#A0522D") // Deep burnt orange for selected borders
	PlumBright = lipgloss.Color("#E67E22") // Rich orange for active elements, highlights
	PlumGlow   = lipgloss.Color("#FF8C42") // Bright orange for hover, glow states

	// Accent (Warm Peach)
	PeachSoft = lipgloss.Color("#FFAB91") // Notifications, discovery, headers

	// Semantic
	Success = lipgloss.Color("#10B981") // Teal-green complements orange
	Error   = lipgloss.Color("#EF4444") // Red for errors

	// Text Hierarchy (Warm-tinted)
	TextPrimary   = lipgloss.Color("#FFF5EE") // Warm white/seashell
	TextSecondary = lipgloss.Color("#D4C4B8") // Warm beige-gray for descriptions
	TextTertiary  = lipgloss.Color("#A89888") // Warm mid-gray for de-emphasized
	TextMuted     = lipgloss.Color("#6B5D54") // Warm dark gray for subtle text

	// UI Structure
	BorderSubtle = lipgloss.Color("#5C4033") // Warm brown for borders
)

Colors - Orange/Peach themed semantic palette

View Source
var (
	// App container
	AppStyle = lipgloss.NewStyle().
				Padding(1, 2)

	// Title
	TitleStyle = lipgloss.NewStyle().
				Foreground(PeachSoft).
				Bold(true).
				MarginBottom(1)

	// Update notification box with gradient border
	UpdateNotificationStyle = lipgloss.NewStyle().
							Border(lipgloss.RoundedBorder()).
							BorderForeground(PeachSoft).
							Foreground(PeachSoft).
							Bold(true).
							Padding(0, 1)

	// Search input
	SearchPromptStyle = lipgloss.NewStyle().
						Foreground(PlumBright).
						Bold(true)

	SearchInputStyle = lipgloss.NewStyle().
						Foreground(TextPrimary)

	// Plugin list item - installed
	InstalledIndicator = lipgloss.NewStyle().
						Foreground(Success).
						SetString("●")

	// Plugin list item - available
	AvailableIndicator = lipgloss.NewStyle().
						Foreground(TextTertiary).
						SetString("○")

	// Discover badge for plugins from uninstalled marketplaces
	DiscoverBadge = lipgloss.NewStyle().
					Foreground(PeachSoft).
					Bold(true).
					SetString("[Discover]")

	// Plugin name
	PluginNameStyle = lipgloss.NewStyle().
					Foreground(TextPrimary).
					Bold(true)

	// Plugin name when selected/highlighted
	PluginNameSelectedStyle = lipgloss.NewStyle().
							Foreground(PlumGlow).
							Bold(true)

	// Plugin marketplace tag
	MarketplaceStyle = lipgloss.NewStyle().
						Foreground(TextTertiary)

	// Plugin version
	VersionStyle = lipgloss.NewStyle().
					Foreground(TextMuted)

	// Plugin description
	DescriptionStyle = lipgloss.NewStyle().
						Foreground(TextSecondary)

	// Plugin card - normal state
	PluginCardStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(BorderSubtle).
					Padding(0, 1)

	// Plugin card - selected state
	PluginCardSelectedStyle = lipgloss.NewStyle().
							Border(lipgloss.RoundedBorder()).
							BorderForeground(PlumMedium).
							Padding(0, 1)

	// Status bar
	StatusBarStyle = lipgloss.NewStyle().
					Foreground(TextTertiary).
					MarginTop(1)

	// Dim separator for tabs/status bar
	DimSeparator = lipgloss.NewStyle().
					Foreground(TextMuted)

	// Help text
	HelpStyle = lipgloss.NewStyle().
				Foreground(TextMuted)

	// Detail view styles
	DetailBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(PlumBright).
					Padding(1, 2)

	DetailTitleStyle = lipgloss.NewStyle().
						Foreground(TextPrimary).
						Bold(true).
						MarginBottom(1)

	DetailLabelStyle = lipgloss.NewStyle().
						Foreground(TextTertiary).
						Width(12)

	DetailValueStyle = lipgloss.NewStyle().
						Foreground(TextPrimary)

	DetailDescStyle = lipgloss.NewStyle().
					Foreground(TextSecondary).
					MarginTop(1).
					MarginBottom(1)

	InstallCommandStyle = lipgloss.NewStyle().
						Foreground(Success).
						Background(TextMuted).
						Padding(0, 1)

	// Discover message style for marketplace install instructions
	DiscoverMessageStyle = lipgloss.NewStyle().
							Foreground(PeachSoft).
							Italic(true)

	KeyStyle = lipgloss.NewStyle().
				Foreground(PlumBright).
				Bold(true)

	// Badge styles
	InstalledBadge = lipgloss.NewStyle().
					Foreground(Success).
					Bold(true).
					SetString("[Installed]")

	AvailableBadge = lipgloss.NewStyle().
					Foreground(TextTertiary).
					SetString("[Available]")

	// Help view styles
	HelpSectionStyle = lipgloss.NewStyle().
						Foreground(PeachSoft).
						Bold(true)

	HelpTextStyle = lipgloss.NewStyle().
					Foreground(TextSecondary)

	// Animation highlight bars - sliding selection indicator
	HighlightBarFull = lipgloss.NewStyle().
						Foreground(PlumBright).
						Bold(true).
						SetString("▌ ")

	HighlightBarMedium = lipgloss.NewStyle().
						Foreground(PlumGlow).
						SetString("▌ ")

	HighlightBarLight = lipgloss.NewStyle().
						Foreground(TextTertiary).
						SetString("│ ")
)

Styles

View Source
var FilterModeNames = []string{"All", "Discover", "Ready", "Installed"}

FilterModeNames for display

View Source
var MarketplaceSortModeNames = []string{"Plugins", "Stars", "Name", "Updated"}

MarketplaceSortModeNames for display

View Source
var TransitionStyleNames = []string{"Instant", "Zoom", "Slide V"}

TransitionStyleNames for display

Functions

This section is empty.

Types

type FilterMode

type FilterMode int

FilterMode represents which plugins to show

const (
	FilterAll       FilterMode = iota // Show all plugins (installed + ready + discoverable)
	FilterDiscover                    // Show only discoverable (from uninstalled marketplaces)
	FilterReady                       // Show only ready to install (marketplace installed, plugin not)
	FilterInstalled                   // Show only installed
)

type ListDisplayMode

type ListDisplayMode int

ListDisplayMode represents how plugin items are displayed

const (
	DisplayCard ListDisplayMode = iota // Card view with borders and description
	DisplaySlim                        // Slim one-line view
)

type MarketplaceItem added in v0.3.0

type MarketplaceItem struct {
	Name                 string                   // Internal name
	DisplayName          string                   // User-facing name
	Repo                 string                   // GitHub repo URL
	Description          string                   // One-line description
	Status               MarketplaceStatus        // Installation status
	InstalledPluginCount int                      // Plugins you have installed
	TotalPluginCount     int                      // Total plugins available
	GitHubStats          *marketplace.GitHubStats // GitHub repo stats (may be nil)
	StatsLoading         bool                     // True while fetching stats
	StatsError           error                    // Stats fetch error if any
}

MarketplaceItem represents a marketplace with enriched display data

func (MarketplaceItem) StatusBadge added in v0.3.0

func (m MarketplaceItem) StatusBadge() string

StatusBadge returns a display badge for marketplace status

type MarketplaceSortMode added in v0.3.0

type MarketplaceSortMode int

MarketplaceSortMode represents sorting options for marketplaces

const (
	SortByPluginCount MarketplaceSortMode = iota // Most plugins first
	SortByStars                                  // Most stars first
	SortByName                                   // Alphabetical
	SortByLastUpdated                            // Most recently updated first
)

type MarketplaceStatus added in v0.3.0

type MarketplaceStatus int

MarketplaceStatus represents the installation status of a marketplace

const (
	MarketplaceInstalled MarketplaceStatus = iota // Added to Claude Code
	MarketplaceCached                             // Fetched but not installed
	MarketplaceAvailable                          // In registry, not cached
	MarketplaceNew                                // Recently added to registry
)

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the main application model

func NewModel

func NewModel() Model

NewModel creates a new Model with initial state

func (Model) AnimatedCursorOffset

func (m Model) AnimatedCursorOffset() float64

AnimatedCursorOffset returns how far the animated cursor is from target (for glow effect)

func (*Model) ApplyMarketplaceSort added in v0.3.0

func (m *Model) ApplyMarketplaceSort()

ApplyMarketplaceSort sorts marketplace items based on current sort mode

func (Model) ContentWidth

func (m Model) ContentWidth() int

ContentWidth returns the effective content width (capped at max)

func (*Model) CycleTransitionStyle

func (m *Model) CycleTransitionStyle()

CycleTransitionStyle cycles to the next transition style

func (Model) DiscoverableCount

func (m Model) DiscoverableCount() int

DiscoverableCount returns count of discoverable plugins (from uninstalled marketplaces)

func (Model) DisplayModeName

func (m Model) DisplayModeName() string

DisplayModeName returns the current display mode name

func (Model) FilterModeName

func (m Model) FilterModeName() string

FilterModeName returns the current filter mode name

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) InstalledCount

func (m Model) InstalledCount() int

InstalledCount returns count of installed plugins

func (Model) IsAnimating

func (m Model) IsAnimating() bool

IsAnimating returns true if cursor animation is in progress

func (Model) IsViewTransitioning

func (m Model) IsViewTransitioning() bool

IsViewTransitioning returns true if a view transition is in progress

func (*Model) LoadMarketplaceItems added in v0.3.0

func (m *Model) LoadMarketplaceItems() error

LoadMarketplaceItems loads and processes all marketplaces with status and stats

func (*Model) NextFilter

func (m *Model) NextFilter()

NextFilter cycles to the next filter mode

func (*Model) NextMarketplaceSort added in v0.3.0

func (m *Model) NextMarketplaceSort()

NextMarketplaceSort cycles to next sort mode

func (*Model) PrevFilter

func (m *Model) PrevFilter()

PrevFilter cycles to the previous filter mode

func (*Model) PrevMarketplaceSort added in v0.3.0

func (m *Model) PrevMarketplaceSort()

PrevMarketplaceSort cycles to previous sort mode

func (Model) ReadyCount

func (m Model) ReadyCount() int

ReadyCount returns count of ready-to-install plugins (marketplace installed, plugin not)

func (Model) ScrollOffset

func (m Model) ScrollOffset() int

ScrollOffset returns the current scroll offset

func (Model) SelectedPlugin

func (m Model) SelectedPlugin() *plugin.Plugin

SelectedPlugin returns the currently selected plugin, if any

func (*Model) SetCursorTarget

func (m *Model) SetCursorTarget()

SetCursorTarget updates the animation target immediately (call on cursor change)

func (*Model) SnapCursorToTarget

func (m *Model) SnapCursorToTarget()

SnapCursorToTarget instantly moves cursor to target (no animation)

func (*Model) StartViewTransition

func (m *Model) StartViewTransition(newView ViewState, direction int)

StartViewTransition begins a transition to a new view

func (*Model) ToggleDisplayMode

func (m *Model) ToggleDisplayMode()

ToggleDisplayMode switches between card and slim view

func (Model) TotalPlugins

func (m Model) TotalPlugins() int

TotalPlugins returns total plugin count

func (Model) TransitionOffset

func (m Model) TransitionOffset() int

TransitionOffset returns the horizontal offset for rendering during transition Returns a value from 0 to windowWidth based on progress and direction

func (Model) TransitionStyleName

func (m Model) TransitionStyleName() string

TransitionStyleName returns the current transition style name

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model

func (*Model) UpdateCursorAnimation

func (m *Model) UpdateCursorAnimation()

UpdateCursorAnimation advances the spring animation one frame

func (*Model) UpdateMarketplaceScroll added in v0.3.0

func (m *Model) UpdateMarketplaceScroll()

UpdateMarketplaceScroll adjusts scroll offset for marketplace view

func (*Model) UpdateScroll

func (m *Model) UpdateScroll()

UpdateScroll adjusts scroll offset to keep cursor visible with buffer

func (*Model) UpdateViewTransition

func (m *Model) UpdateViewTransition()

UpdateViewTransition advances the view transition animation

func (Model) View

func (m Model) View() string

View renders the current view

func (Model) VisibleMarketplaceItems added in v0.3.0

func (m Model) VisibleMarketplaceItems() []MarketplaceItem

VisibleMarketplaceItems returns visible marketplace items based on scroll

func (Model) VisibleResults

func (m Model) VisibleResults() []search.RankedPlugin

VisibleResults returns the results that should be visible given the window size

type PopularMarketplace

type PopularMarketplace struct {
	Name        string
	DisplayName string
	Repo        string
	Description string
}

PopularMarketplace is re-exported to avoid import in function signature

type TransitionStyle

type TransitionStyle int

TransitionStyle represents the animation style for view transitions

const (
	TransitionInstant TransitionStyle = iota // No animation
	TransitionZoom                           // Center expand/contract
	TransitionSlideV                         // Vertical slide (push up/down)
)

type ViewState

type ViewState int

ViewState represents the current view

const (
	ViewList ViewState = iota
	ViewDetail
	ViewHelp
	ViewMarketplaceList   // Marketplace browser view
	ViewMarketplaceDetail // Marketplace detail view
)

Jump to

Keyboard shortcuts

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