sidebar

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 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)

	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 {
	Entries []vfiles.FileEntry

	Height  int
	Width   int
	Section Section
	// 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) LoadEntries

func (s *Model) LoadEntries()

LoadEntries refreshes the file list for the current section.

func (Model) SelectedPath

func (s Model) SelectedPath() string

SelectedPath returns the file path of the currently highlighted entry.

func (Model) Update

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

func (Model) View

func (s Model) View(focused bool) string

type Section

type Section int

Section identifies which file category the sidebar is showing.

const (
	SectionNotes Section = iota
	SectionJournals
	SectionTemplates
)

Sidebar file category sections.

Jump to

Keyboard shortcuts

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