sidebar

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sidebar is the file-browser sidebar TUI component.

Index

Constants

This section is empty.

Variables

View Source
var (
	ActiveBorderStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(lipgloss.Color("62"))

	InactiveBorderStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(lipgloss.Color("240"))

	SelectedItemStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("62")).
						Bold(true)

	RootNodeStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("252")).
					Bold(true)

	DirNodeStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("252"))

	NormalItemStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("252"))
)

Sidebar lipgloss styles, updated by ApplyTheme.

Functions

func ApplyTheme

func ApplyTheme(accent, text, dim lipgloss.Color)

ApplyTheme updates sidebar style vars from theme colors.

Types

type Model

type Model struct {
	Height int
	Width  int
	// contains filtered or unexported fields
}

Model is the sidebar component.

func New

func New(cfg *config.Config) Model

New creates a new sidebar model from a config.

func (*Model) FocusPath added in v0.9.0

func (s *Model) FocusPath(path string)

FocusPath expands all ancestor dirs of path, rebuilds, and moves cursor to path.

func (*Model) Refresh added in v0.9.0

func (s *Model) Refresh()

Refresh re-reads directories from disk and rebuilds the visible list.

func (Model) SelectedPath

func (s Model) SelectedPath() string

SelectedPath returns the file path of the highlighted entry, or "" if it's a dir.

func (Model) Update

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

Update handles key messages for sidebar navigation.

func (Model) View

func (s Model) View(focused bool) string

View renders the sidebar.

Jump to

Keyboard shortcuts

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