ui

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ColorBg      = lipgloss.Color("#1a1b26") // Dark background
	ColorSurface = lipgloss.Color("#24283b") // Surface background
	ColorBorder  = lipgloss.Color("#414868") // Border color
	ColorText    = lipgloss.Color("#c0caf5") // Primary text
	ColorTextDim = lipgloss.Color("#565f89") // Dim text
	ColorAccent  = lipgloss.Color("#7aa2f7") // Accent blue
	ColorPurple  = lipgloss.Color("#bb9af7") // Purple
	ColorCyan    = lipgloss.Color("#7dcfff") // Cyan
	ColorGreen   = lipgloss.Color("#9ece6a") // Green
	ColorYellow  = lipgloss.Color("#e0af68") // Yellow
	ColorOrange  = lipgloss.Color("#ff9e64") // Orange
	ColorRed     = lipgloss.Color("#f7768e") // Red
	ColorComment = lipgloss.Color("#565f89") // Comment gray
)

Tokyo Night Color Palette

View Source
const (
	IconClaude = "🤖"
	IconGemini = "✨"
	IconAider  = "🔧"
	IconCodex  = "💻"
	IconShell  = "🐚"
)

Tool Icons

Variables

View Source
var (
	BaseStyle = lipgloss.NewStyle().
				Foreground(ColorText).
				Background(ColorBg)

	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(ColorAccent).
				Background(ColorSurface).
				Padding(0, 1)

	PanelStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(ColorBorder).
				Padding(0, 1)

	HighlightStyle = lipgloss.NewStyle().
					Foreground(ColorBg).
					Background(ColorAccent).
					Bold(true)

	DimStyle = lipgloss.NewStyle().
				Foreground(ColorComment)

	ErrorStyle = lipgloss.NewStyle().
				Foreground(ColorRed).
				Bold(true)

	SuccessStyle = lipgloss.NewStyle().
					Foreground(ColorGreen).
					Bold(true)

	WarningStyle = lipgloss.NewStyle().
					Foreground(ColorYellow).
					Bold(true)

	InfoStyle = lipgloss.NewStyle().
				Foreground(ColorCyan)
)

Base Styles

View Source
var (
	RunningStyle = lipgloss.NewStyle().
					Foreground(ColorGreen).
					Bold(true)

	WaitingStyle = lipgloss.NewStyle().
					Foreground(ColorYellow).
					Bold(true)

	IdleStyle = lipgloss.NewStyle().
				Foreground(ColorComment)

	ErrorIndicatorStyle = lipgloss.NewStyle().
						Foreground(ColorRed).
						Bold(true)
)

Status Indicator Styles

View Source
var (
	MenuBarStyle = lipgloss.NewStyle().
					Background(ColorSurface).
					Foreground(ColorText).
					Padding(0, 1)

	MenuKeyStyle = lipgloss.NewStyle().
					Foreground(ColorAccent).
					Bold(true)

	MenuDescStyle = lipgloss.NewStyle().
					Foreground(ColorText)

	MenuSeparatorStyle = lipgloss.NewStyle().
						Foreground(ColorBorder)
)

Menu Bar Styles

View Source
var (
	SearchBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(ColorAccent).
					Padding(0, 1).
					Foreground(ColorText)

	SearchPromptStyle = lipgloss.NewStyle().
						Foreground(ColorPurple).
						Bold(true)

	SearchMatchStyle = lipgloss.NewStyle().
						Background(ColorYellow).
						Foreground(ColorBg).
						Bold(true)
)

Search Styles

View Source
var (
	DialogBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(ColorPurple).
					Padding(1, 2).
					Background(ColorSurface)

	DialogTitleStyle = lipgloss.NewStyle().
						Foreground(ColorPurple).
						Bold(true).
						Align(lipgloss.Center)

	DialogButtonStyle = lipgloss.NewStyle().
						Foreground(ColorAccent).
						Background(ColorBorder).
						Padding(0, 2).
						MarginRight(1)

	DialogButtonActiveStyle = lipgloss.NewStyle().
							Foreground(ColorBg).
							Background(ColorAccent).
							Padding(0, 2).
							MarginRight(1).
							Bold(true)
)

Dialog Styles

View Source
var (
	PreviewPanelStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(ColorBorder).
						Padding(1)

	PreviewTitleStyle = lipgloss.NewStyle().
						Foreground(ColorCyan).
						Bold(true).
						Underline(true)

	PreviewHeaderStyle = lipgloss.NewStyle().
						Foreground(ColorPurple).
						Bold(true)

	PreviewContentStyle = lipgloss.NewStyle().
						Foreground(ColorText)

	PreviewMetaStyle = lipgloss.NewStyle().
						Foreground(ColorComment).
						Italic(true)
)

Preview Pane Styles

View Source
var (
	ListItemStyle = lipgloss.NewStyle().
					Foreground(ColorText).
					PaddingLeft(2)

	ListItemSelectedStyle = lipgloss.NewStyle().
							Foreground(ColorBg).
							Background(ColorAccent).
							Bold(true).
							PaddingLeft(1)

	ListItemActiveStyle = lipgloss.NewStyle().
						Foreground(ColorAccent).
						Bold(true).
						PaddingLeft(2)
)

List Item Styles

View Source
var (
	TagStyle = lipgloss.NewStyle().
				Foreground(ColorBg).
				Background(ColorPurple).
				Padding(0, 1).
				MarginRight(1)

	TagActiveStyle = lipgloss.NewStyle().
					Foreground(ColorBg).
					Background(ColorGreen).
					Padding(0, 1).
					MarginRight(1)

	TagErrorStyle = lipgloss.NewStyle().
					Foreground(ColorBg).
					Background(ColorRed).
					Padding(0, 1).
					MarginRight(1)
)

Tag Styles

View Source
var (
	FolderStyle = lipgloss.NewStyle().
				Foreground(ColorAccent).
				Bold(true)

	FolderCollapsedStyle = lipgloss.NewStyle().
							Foreground(ColorComment)
)

Folder Styles

View Source
var (
	SessionItemStyle = lipgloss.NewStyle().
						Foreground(ColorText).
						PaddingLeft(2)

	SessionItemSelectedStyle = lipgloss.NewStyle().
								Foreground(ColorBg).
								Background(ColorAccent).
								Bold(true).
								PaddingLeft(0)
)

Session Item Styles

View Source
var (
	SubtitleStyle = lipgloss.NewStyle().
					Foreground(ColorComment).
					Italic(true)

	ColorError   = ColorRed
	ColorSuccess = ColorGreen
	ColorWarning = ColorYellow
	ColorPrimary = ColorAccent
)

Additional Styles

View Source
var LogoBorderStyle = lipgloss.NewStyle().Foreground(ColorBorder)

LogoBorderStyle for the grid lines

View Source
var LogoFrames = [][]string{
	{"●", "◐", "○"},
}

LogoFrames kept for backward compatibility (empty state default)

View Source
var (
	MenuStyle = lipgloss.NewStyle().
		Background(ColorSurface).
		Foreground(ColorText).
		Padding(0, 1)
)

Menu Styles

View Source
var (
	TimestampStyle = lipgloss.NewStyle().
		Foreground(ColorComment).
		Italic(true)
)

Timestamp Style

View Source
var Version = "0.0.0"

Version is set by main.go for update checking

Functions

func MenuKey(key, description string) string

MenuKey creates a formatted menu item with key and description

func RenderLogoCompact

func RenderLogoCompact(running, waiting, idle int) string

RenderLogoCompact renders the compact inline logo for the header Shows REAL status: running=●, waiting=◐, idle=○ Format: [●│◐│○]

func RenderLogoIndicator

func RenderLogoIndicator(indicator string) string

RenderLogoIndicator renders a single indicator with appropriate color

func RenderLogoLarge

func RenderLogoLarge(running, waiting, idle int) string

RenderLogoLarge renders the large logo for empty state Shows REAL status: running=●, waiting=◐, idle=○ Format:

┌──┬──┬──┐
│● │◐ │○ │
└──┴──┴──┘

func SetVersion added in v0.4.0

func SetVersion(v string)

SetVersion sets the current version for update checking

func StatusIndicator

func StatusIndicator(status string) string

StatusIndicator returns a styled status indicator

func ToolIcon

func ToolIcon(tool string) string

ToolIcon returns the icon for a given tool Checks user config for custom tools first, then falls back to built-ins

Types

type ConfirmDialog

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

ConfirmDialog handles confirmation for destructive actions

func NewConfirmDialog

func NewConfirmDialog() *ConfirmDialog

NewConfirmDialog creates a new confirmation dialog

func (*ConfirmDialog) GetConfirmType

func (c *ConfirmDialog) GetConfirmType() ConfirmType

GetConfirmType returns the type of confirmation

func (*ConfirmDialog) GetTargetID

func (c *ConfirmDialog) GetTargetID() string

GetTargetID returns the session ID or group path being confirmed

func (*ConfirmDialog) Hide

func (c *ConfirmDialog) Hide()

Hide hides the dialog

func (*ConfirmDialog) IsVisible

func (c *ConfirmDialog) IsVisible() bool

IsVisible returns whether the dialog is visible

func (*ConfirmDialog) SetSize

func (c *ConfirmDialog) SetSize(width, height int)

SetSize updates dialog dimensions

func (*ConfirmDialog) ShowDeleteGroup

func (c *ConfirmDialog) ShowDeleteGroup(groupPath, groupName string)

ShowDeleteGroup shows confirmation for group deletion

func (*ConfirmDialog) ShowDeleteSession

func (c *ConfirmDialog) ShowDeleteSession(sessionID, sessionName string)

ShowDeleteSession shows confirmation for session deletion

func (*ConfirmDialog) Update

func (c *ConfirmDialog) Update(msg tea.KeyMsg) (*ConfirmDialog, tea.Cmd)

Update handles key events

func (*ConfirmDialog) View

func (c *ConfirmDialog) View() string

View renders the confirmation dialog

type ConfirmType

type ConfirmType int

ConfirmType indicates what action is being confirmed

const (
	ConfirmDeleteSession ConfirmType = iota
	ConfirmDeleteGroup
)

type ForkDialog added in v0.4.1

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

ForkDialog handles the fork session dialog

func NewForkDialog added in v0.4.1

func NewForkDialog() *ForkDialog

NewForkDialog creates a new fork dialog

func (*ForkDialog) GetValues added in v0.4.1

func (d *ForkDialog) GetValues() (name, group string)

GetValues returns the current input values

func (*ForkDialog) Hide added in v0.4.1

func (d *ForkDialog) Hide()

Hide hides the dialog

func (*ForkDialog) IsVisible added in v0.4.1

func (d *ForkDialog) IsVisible() bool

IsVisible returns whether the dialog is visible

func (*ForkDialog) SetSize added in v0.4.1

func (d *ForkDialog) SetSize(width, height int)

SetSize sets the dialog dimensions

func (*ForkDialog) Show added in v0.4.1

func (d *ForkDialog) Show(originalName, projectPath, groupPath string)

Show displays the dialog with pre-filled values

func (*ForkDialog) Update added in v0.4.1

func (d *ForkDialog) Update(msg tea.Msg) (*ForkDialog, tea.Cmd)

Update handles input events

func (*ForkDialog) View added in v0.4.1

func (d *ForkDialog) View() string

View renders the dialog

type GroupDialog

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

GroupDialog handles group creation, renaming, and moving sessions

func NewGroupDialog

func NewGroupDialog() *GroupDialog

NewGroupDialog creates a new group dialog

func (*GroupDialog) GetGroupPath

func (g *GroupDialog) GetGroupPath() string

GetGroupPath returns the group path being edited (or parent path for subgroup creation)

func (*GroupDialog) GetParentPath

func (g *GroupDialog) GetParentPath() string

GetParentPath returns the parent path for subgroup creation

func (*GroupDialog) GetSelectedGroup

func (g *GroupDialog) GetSelectedGroup() string

GetSelectedGroup returns the selected group for move mode

func (*GroupDialog) GetSessionID

func (g *GroupDialog) GetSessionID() string

GetSessionID returns the session ID being renamed

func (*GroupDialog) GetValue

func (g *GroupDialog) GetValue() string

GetValue returns the input value

func (*GroupDialog) HasParent

func (g *GroupDialog) HasParent() bool

HasParent returns true if creating a subgroup under a parent

func (*GroupDialog) Hide

func (g *GroupDialog) Hide()

Hide hides the dialog

func (*GroupDialog) IsVisible

func (g *GroupDialog) IsVisible() bool

IsVisible returns whether the dialog is visible

func (*GroupDialog) Mode

func (g *GroupDialog) Mode() GroupDialogMode

Mode returns the current dialog mode

func (*GroupDialog) SetSize

func (g *GroupDialog) SetSize(width, height int)

SetSize sets the dialog size

func (*GroupDialog) Show

func (g *GroupDialog) Show()

Show shows the dialog in create mode (root level group)

func (*GroupDialog) ShowCreateSubgroup

func (g *GroupDialog) ShowCreateSubgroup(parentPath, parentName string)

ShowCreateSubgroup shows the dialog for creating a subgroup under a parent

func (*GroupDialog) ShowMove

func (g *GroupDialog) ShowMove(groups []string)

ShowMove shows the dialog for moving a session to a group

func (*GroupDialog) ShowRename

func (g *GroupDialog) ShowRename(currentPath, currentName string)

ShowRename shows the dialog in rename mode

func (*GroupDialog) ShowRenameSession

func (g *GroupDialog) ShowRenameSession(sessionID, currentName string)

ShowRenameSession shows the dialog for renaming a session

func (*GroupDialog) Update

func (g *GroupDialog) Update(msg tea.KeyMsg) (*GroupDialog, tea.Cmd)

Update handles input

func (*GroupDialog) Validate

func (g *GroupDialog) Validate() string

Validate checks if the dialog values are valid and returns an error message if not

func (*GroupDialog) View

func (g *GroupDialog) View() string

View renders the dialog

type GroupDialogMode

type GroupDialogMode int

GroupDialogMode represents the dialog mode

const (
	GroupDialogCreate GroupDialogMode = iota
	GroupDialogRename
	GroupDialogMove
	GroupDialogRenameSession
)

type HelpOverlay added in v0.3.0

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

HelpOverlay shows keyboard shortcuts in a modal

func NewHelpOverlay added in v0.3.0

func NewHelpOverlay() *HelpOverlay

NewHelpOverlay creates a new help overlay

func (*HelpOverlay) Hide added in v0.3.0

func (h *HelpOverlay) Hide()

Hide hides the help overlay

func (*HelpOverlay) IsVisible added in v0.3.0

func (h *HelpOverlay) IsVisible() bool

IsVisible returns whether the help overlay is visible

func (*HelpOverlay) SetSize added in v0.3.0

func (h *HelpOverlay) SetSize(width, height int)

SetSize sets the dimensions for centering

func (*HelpOverlay) Show added in v0.3.0

func (h *HelpOverlay) Show()

Show makes the help overlay visible

func (*HelpOverlay) Update added in v0.3.0

func (h *HelpOverlay) Update(msg tea.Msg) (*HelpOverlay, tea.Cmd)

Update handles messages for the help overlay

func (*HelpOverlay) View added in v0.3.0

func (h *HelpOverlay) View() string

View renders the help overlay

type Home

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

Home is the main application model

func NewHome

func NewHome() *Home

NewHome creates a new home model with the default profile

func NewHomeWithProfile added in v0.3.0

func NewHomeWithProfile(profile string) *Home

NewHomeWithProfile creates a new home model with the specified profile

func (*Home) Init

func (h *Home) Init() tea.Cmd

Init initializes the model

func (*Home) Update

func (h *Home) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*Home) View

func (h *Home) View() string

View renders the UI

type List

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

List manages session list display

func NewList

func NewList() *List

NewList creates a new list

func (*List) Cursor

func (l *List) Cursor() int

Cursor returns current cursor position

func (*List) Len

func (l *List) Len() int

Len returns number of items

func (*List) MoveDown

func (l *List) MoveDown()

MoveDown moves cursor down

func (*List) MoveUp

func (l *List) MoveUp()

MoveUp moves cursor up

func (*List) Selected

func (l *List) Selected() *session.Instance

Selected returns the currently selected item

func (*List) SetItems

func (l *List) SetItems(items []*session.Instance)

SetItems sets the list items

func (*List) SetSize

func (l *List) SetSize(width, height int)

SetSize sets the list dimensions

func (*List) ToggleFolder

func (l *List) ToggleFolder(name string)

ToggleFolder toggles the current folder

func (*List) View

func (l *List) View() string

View renders the list

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

Menu shows bottom menu bar

func NewMenu

func NewMenu() *Menu

NewMenu creates a new menu

func (m *Menu) SetWidth(width int)

SetWidth sets menu width

func (m *Menu) View() string

View renders the menu

type NewDialog

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

NewDialog represents the new session creation dialog

func NewNewDialog

func NewNewDialog() *NewDialog

NewNewDialog creates a new NewDialog instance

func (*NewDialog) GetSelectedGroup

func (d *NewDialog) GetSelectedGroup() string

GetSelectedGroup returns the parent group path

func (*NewDialog) GetValues

func (d *NewDialog) GetValues() (name, path, command string)

GetValues returns the current dialog values with expanded paths

func (*NewDialog) Hide

func (d *NewDialog) Hide()

Hide hides the dialog

func (*NewDialog) IsVisible

func (d *NewDialog) IsVisible() bool

IsVisible returns whether the dialog is visible

func (*NewDialog) SetDefaultTool added in v0.4.3

func (d *NewDialog) SetDefaultTool(tool string)

SetDefaultTool sets the pre-selected command based on tool name Call this before Show/ShowInGroup to apply user's preferred default

func (*NewDialog) SetPathSuggestions

func (d *NewDialog) SetPathSuggestions(paths []string)

SetPathSuggestions sets the available path suggestions for autocomplete

func (*NewDialog) SetSize

func (d *NewDialog) SetSize(width, height int)

SetSize sets the dialog dimensions

func (*NewDialog) Show

func (d *NewDialog) Show()

Show makes the dialog visible (uses default group)

func (*NewDialog) ShowInGroup

func (d *NewDialog) ShowInGroup(groupPath, groupName string)

ShowInGroup shows the dialog with a pre-selected parent group

func (*NewDialog) Update

func (d *NewDialog) Update(msg tea.Msg) (*NewDialog, tea.Cmd)

Update handles key messages

func (*NewDialog) Validate

func (d *NewDialog) Validate() string

Validate checks if the dialog values are valid and returns an error message if not

func (*NewDialog) View

func (d *NewDialog) View() string

View renders the dialog

type Preview

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

Preview shows session terminal content

func NewPreview

func NewPreview() *Preview

NewPreview creates a new preview pane

func (*Preview) SetContent

func (p *Preview) SetContent(content, title string)

SetContent sets the preview content

func (*Preview) SetSize

func (p *Preview) SetSize(width, height int)

SetSize sets preview dimensions

func (*Preview) View

func (p *Preview) View() string

View renders the preview

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

Search represents the search overlay component

func NewSearch

func NewSearch() *Search

NewSearch creates a new search overlay

func (*Search) Hide

func (s *Search) Hide()

Hide hides the search overlay

func (*Search) IsVisible

func (s *Search) IsVisible() bool

IsVisible returns whether the search overlay is visible

func (*Search) Selected

func (s *Search) Selected() *session.Instance

Selected returns the currently selected item

func (*Search) SetItems

func (s *Search) SetItems(items []*session.Instance)

SetItems sets the full list of items to search through

func (*Search) SetSize

func (s *Search) SetSize(width, height int)

SetSize sets the dimensions of the search overlay

func (*Search) Show

func (s *Search) Show()

Show makes the search overlay visible

func (*Search) Update

func (s *Search) Update(msg tea.Msg) (*Search, tea.Cmd)

Update handles messages for the search overlay Returns the updated Search and any command to execute

func (*Search) View

func (s *Search) View() string

View renders the search overlay

type Tree

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

Tree manages folder structure

func NewTree

func NewTree() *Tree

NewTree creates a new tree

func (*Tree) AddFolder

func (t *Tree) AddFolder(name string)

AddFolder adds a folder to the tree

func (*Tree) Clear

func (t *Tree) Clear()

Clear removes all folders

func (*Tree) GetFolder

func (t *Tree) GetFolder(name string) *TreeFolder

GetFolder returns a folder by name

func (*Tree) GetFolders

func (t *Tree) GetFolders() []string

GetFolders returns all folder names in order

func (*Tree) IsFolderExpanded

func (t *Tree) IsFolderExpanded(name string) bool

IsFolderExpanded returns whether a folder is expanded

func (*Tree) SetFolderCount

func (t *Tree) SetFolderCount(name string, count int)

SetFolderCount sets the session count for a folder

func (*Tree) ToggleFolder

func (t *Tree) ToggleFolder(name string)

ToggleFolder toggles folder expansion

func (*Tree) View

func (t *Tree) View(selectedFolder string) string

View renders the tree (just folders, not sessions)

type TreeFolder

type TreeFolder struct {
	Name     string
	Expanded bool
	Count    int
}

TreeFolder represents a folder in the tree

Jump to

Keyboard shortcuts

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