ui

package
v0.0.0-...-ece5662 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package ui implements UI related functionality and design

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	Up: key.NewBinding(
		key.WithKeys("k", "up"),
		key.WithHelp("↑/k", "up"),
	),
	Down: key.NewBinding(
		key.WithKeys("j", "down"),
		key.WithHelp("↓/j", "down"),
	),
	Select: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "select"),
	),
	Back: key.NewBinding(
		key.WithKeys("esc", "backspace"),
		key.WithHelp("esc", "back"),
	),
	Tab: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("tab", "switch focus"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "ctrl+c"),
		key.WithHelp("q", "quit"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "toggle help"),
	),
	PlayPause: key.NewBinding(
		key.WithKeys("space"),
		key.WithHelp("space", "play/pause"),
	),
	Next: key.NewBinding(
		key.WithKeys("n"),
		key.WithHelp("n", "next"),
	),
	Prev: key.NewBinding(
		key.WithKeys("p"),
		key.WithHelp("p", "previous"),
	),
	VolUp: key.NewBinding(
		key.WithKeys("+", "="),
		key.WithHelp("+", "volume up"),
	),
	VolDown: key.NewBinding(
		key.WithKeys("-"),
		key.WithHelp("-", "volume down"),
	),
	Mute: key.NewBinding(
		key.WithKeys("m"),
		key.WithHelp("m", "toggle mute"),
	),
}

Functions

This section is empty.

Types

type FocusArea

type FocusArea int

FocusArea represents which panel has focus

const (
	FocusSidebar FocusArea = iota
	FocusDetail
)

type KeyMap

type KeyMap struct {
	Up        key.Binding
	Down      key.Binding
	Select    key.Binding
	Back      key.Binding
	Tab       key.Binding
	Quit      key.Binding
	Help      key.Binding
	PlayPause key.Binding
	Next      key.Binding
	Prev      key.Binding
	VolUp     key.Binding
	VolDown   key.Binding
	Mute      key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to show in the mini help view

type Model

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

func New

func New(client *api.Client) (Model, error)

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

View renders the entire application UI

type NavState struct {
	View      ViewType
	ID        string
	Title     string
	ListIndex int
}

NavState represents a single state in the navigation stack

type SongSelectedMsg

type SongSelectedMsg struct {
	Song  api.Song
	Index int
	Queue []api.Song // All songs in the current view
}

SongSelectedMsg is sent when a song is selected for playback

type ViewType

type ViewType int

ViewType represents the current navigation view

const (
	ViewArtists ViewType = iota
	ViewAlbums
	ViewSongs
)

Directories

Path Synopsis
Package detail implements the main widow showing track details
Package detail implements the main widow showing track details
Package playerbar implements the UI for the player details
Package playerbar implements the UI for the player details
Package sidebar implements the sidebar widget
Package sidebar implements the sidebar widget
Package styles implements the lipgloss styles for the approach
Package styles implements the lipgloss styles for the approach

Jump to

Keyboard shortcuts

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