ui

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldLabel = iota
	FieldGroup
	FieldTags
	FieldHostname
	FieldPort // Moved Port up
	FieldUsername
	FieldAuthMethod
	FieldAuthDetails // Password or Key details
	FieldSubmit
	FieldCancel
	// Legacy constants for compatibility if needed, but we reordered
	FieldKeyOption = 99
	FieldKeyType   = 100
	FieldPastedKey = 101
)

FormField represents individual form fields

View Source
const (
	AuthPassword = iota
	AuthKeyPaste
	AuthKeyGen
)

Auth Methods

Variables

View Source
var (
	// Primary colors
	ColorPrimary   = lipgloss.Color("#7C3AED") // Purple
	ColorSecondary = lipgloss.Color("#06B6D4") // Cyan
	ColorAccent    = lipgloss.Color("#10B981") // Green
	ColorDanger    = lipgloss.Color("#EF4444") // Red
	ColorWarning   = lipgloss.Color("#F59E0B") // Amber

	// Neutral colors
	ColorText    = lipgloss.Color("#E5E7EB") // Light gray
	ColorTextDim = lipgloss.Color("#9CA3AF") // Medium gray
	ColorBorder  = lipgloss.Color("#4B5563") // Dark gray
	ColorBg      = lipgloss.Color("#1F2937") // Very dark gray
	ColorBgAlt   = lipgloss.Color("#111827") // Almost black
)

Color palette

Functions

This section is empty.

Types

type ModalFormData

type ModalFormData struct {
	Label        textinput.Model
	Group        textinput.Model
	Tags         textinput.Model
	GroupOptions []string
	GroupIndex   int
	Hostname     textinput.Model
	Username     textinput.Model
	Port         textinput.Model
	AuthMethod   int // 0=Password, 1=Key File, 2=Generate
	Password     textinput.Model
	KeyOption    string // Legacy
	KeyType      string // "ed25519", "rsa", "ecdsa"
	PastedKey    textarea.Model
	FocusedField int
	TitleSuffix  string // Debug or status info
}

ModalFormData holds the form state for add/edit modals

type Styles

type Styles struct {
	// Layout
	App         lipgloss.Style
	Header      lipgloss.Style
	Footer      lipgloss.Style
	Panel       lipgloss.Style
	PanelBorder lipgloss.Style

	// List
	ListItem         lipgloss.Style
	ListItemSelected lipgloss.Style
	ListHeader       lipgloss.Style

	// Details
	DetailLabel lipgloss.Style
	DetailValue lipgloss.Style
	DetailRow   lipgloss.Style

	// Status indicators
	StatusReady   lipgloss.Style
	StatusWarning lipgloss.Style
	StatusError   lipgloss.Style

	// Help/Keybindings
	HelpKey   lipgloss.Style
	HelpValue lipgloss.Style
	HelpSep   lipgloss.Style

	// Modal
	Modal        lipgloss.Style
	ModalTitle   lipgloss.Style
	ModalOverlay lipgloss.Style

	// Spotlight
	Spotlight         lipgloss.Style
	SpotlightInput    lipgloss.Style
	SpotlightItem     lipgloss.Style
	SpotlightSelected lipgloss.Style

	// Login
	LoginBox lipgloss.Style

	// Form
	FormLabel         lipgloss.Style
	FormInput         lipgloss.Style
	FormInputFocused  lipgloss.Style
	FormButton        lipgloss.Style
	FormButtonFocused lipgloss.Style

	// General
	Title    lipgloss.Style
	Subtitle lipgloss.Style
	Error    lipgloss.Style
	Success  lipgloss.Style
	Info     lipgloss.Style
	Warning  lipgloss.Style
}

Styles defines all UI styles

func NewStyles

func NewStyles() *Styles

NewStyles creates a new Styles instance with default styling

func (*Styles) RenderAddHostModal

func (s *Styles) RenderAddHostModal(width, height int, form *ModalFormData, isEdit bool) string

RenderAddHostModal renders the add/edit host modal

func (*Styles) RenderDeleteGroupModal added in v1.0.2

func (s *Styles) RenderDeleteGroupModal(width, height int, groupName string, hostCount int, deleteFocused bool) string

RenderDeleteGroupModal renders group delete confirmation.

func (*Styles) RenderDeleteModal

func (s *Styles) RenderDeleteModal(width, height int, hostname, username string, confirmed bool) string

RenderDeleteModal renders the delete confirmation modal

func (*Styles) RenderFooter

func (s *Styles) RenderFooter(width int, err error) string

RenderFooter renders the footer with keybindings

func (*Styles) RenderFooterWithSync

func (s *Styles) RenderFooterWithSync(width int, err error, syncStatus string, syncActivity *SyncActivity) string

RenderFooterWithSync renders the footer with keybindings and optional sync status

func (*Styles) RenderGroupInputModal added in v1.0.2

func (s *Styles) RenderGroupInputModal(width, height int, title string, input textinput.Model, submitLabel string, focus int) string

RenderGroupInputModal renders a simple text-input modal for creating/renaming groups. focus: 0=input, 1=submit, 2=cancel

func (*Styles) RenderHeader

func (s *Styles) RenderHeader(width int, searchQuery string, isSearching bool) string

RenderHeader renders the header bar

func (*Styles) RenderHelpView

func (s *Styles) RenderHelpView(width, height int) string

RenderHelpView renders the help screen

func (*Styles) RenderHostDetails

func (s *Styles) RenderHostDetails(hostsInterface []interface{}, selectedIdx int, width int, height int) string

RenderHostDetails renders the right panel with selected host details

func (*Styles) RenderHostList

func (s *Styles) RenderHostList(hostsInterface []interface{}, selectedIdx int, width int, height int) string

RenderHostList renders the left panel with the list of hosts

func (*Styles) RenderListView

func (s *Styles) RenderListView(width, height int, hostsInterface interface{}, selectedIdx int, searchQuery string, isSearching bool, err error) string

RenderListView renders the main two-panel layout

func (*Styles) RenderListViewWithSync

func (s *Styles) RenderListViewWithSync(width, height int, hostsInterface interface{}, selectedIdx int, searchQuery string, isSearching bool, err error, syncStatus string, syncActivity *SyncActivity) string

RenderListViewWithSync renders the main two-panel layout with sync status

func (*Styles) RenderLoginView

func (s *Styles) RenderLoginView(width, height int, input textinput.Model, err error) string

RenderLoginView renders the master password login screen

func (*Styles) RenderQuitModal

func (s *Styles) RenderQuitModal(width, height int, mounts []string, focus int) string

RenderQuitModal renders a quit confirmation modal when mounts are active. focus: 0=Unmount&Quit, 1=Leave Mounted&Quit, 2=Cancel

func (*Styles) RenderSettingsView

func (s *Styles) RenderSettingsView(width, height int, cfg config.Config, updateState UpdateSettingsState, selectedIdx int, editing bool, input textinput.Model, err error) string

func (*Styles) RenderSetupView

func (s *Styles) RenderSetupView(width, height int, passwordInput, confirmInput textinput.Model, focus int, err error) string

RenderSetupView renders the first-run password setup screen

func (*Styles) RenderSpotlight

func (s *Styles) RenderSpotlight(width, height int, input textinput.Model, results []interface{}, selectedIdx int, armedSFTP bool, armedMount bool, armedUnmount bool) string

RenderSpotlight renders the Raycast-like search overlay

func (*Styles) RenderTokenManagerView added in v1.0.5

func (s *Styles) RenderTokenManagerView(width, height int, tokens []TokenManagerTokenRow, hosts []TokenManagerHostRow, tokenIdx int, hostIdx int, createNameMode bool, createScopeMode bool, selectedHostIDs map[int]bool, nameInput textinput.Model, revealOpen bool, revealValue string, revealCopied bool, err error) string

func (*Styles) RenderView

func (s *Styles) RenderView(viewMode string, width, height int, hosts interface{}, selectedIdx int, searchQuery string, isSearching bool, err error) string

RenderView renders the main view based on the current view mode

type SyncActivity added in v1.0.3

type SyncActivity struct {
	Active   bool
	Frame    int
	Progress float64
	Stage    string
}

type TokenManagerHostRow added in v1.0.5

type TokenManagerHostRow struct {
	HostID  int
	Label   string
	Detail  string
	HasAuth bool
}

type TokenManagerTokenRow added in v1.0.5

type TokenManagerTokenRow struct {
	TokenID  string
	Name     string
	Hosts    int
	LastUsed string
	Status   string
	Synced   bool
}

type UpdateSettingsState added in v1.0.4

type UpdateSettingsState struct {
	ChannelLabel   string
	VersionLabel   string
	PathHealth     string
	Checking       bool
	Applying       bool
	CanApply       bool
	CanFixPath     bool
	PlatformHint   string
	LastCheckedAgo string
}

Jump to

Keyboard shortcuts

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