ui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliasSaver

type AliasSaver interface {
	Load() (map[string]string, error)
	Set(name, path string)
	Save() error
}

AliasSaver abstracts alias persistence for the file browser.

type BrowserAliasSaveErrMsg

type BrowserAliasSaveErrMsg struct {
	Err error
}

BrowserAliasSaveErrMsg is emitted when alias saving fails.

type BrowserAliasSavedMsg

type BrowserAliasSavedMsg struct {
	Name string
	Path string
}

BrowserAliasSavedMsg is emitted when an alias has been saved from the file browser.

type BrowserCancelMsg

type BrowserCancelMsg struct{}

BrowserCancelMsg is emitted when the user cancels the file browser with Esc (no filter active).

type BrowserDirSelectErrMsg

type BrowserDirSelectErrMsg struct {
	Path string
	Err  error
}

BrowserDirSelectErrMsg is emitted when a directory selection fails (e.g., directory no longer exists).

type BrowserDirSelectedMsg

type BrowserDirSelectedMsg struct {
	Path string
}

BrowserDirSelectedMsg is emitted when the user selects the current directory via Space or Enter on the "." entry.

type DirLister

type DirLister interface {
	ListDirectories(path string, showHidden bool) ([]browser.DirEntry, error)
}

DirLister abstracts directory listing for testability.

type FileBrowserModel

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

FileBrowserModel is the Bubble Tea model for the file browser view.

func NewFileBrowser

func NewFileBrowser(startPath string, lister DirLister) FileBrowserModel

NewFileBrowser creates a FileBrowserModel starting at the given path.

func NewFileBrowserWithAlias

func NewFileBrowserWithAlias(startPath string, lister DirLister, checker PathChecker, aliasStore AliasSaver, resolveGit GitRootResolver) FileBrowserModel

NewFileBrowserWithAlias creates a FileBrowserModel with alias and git root resolution support.

func NewFileBrowserWithChecker

func NewFileBrowserWithChecker(startPath string, lister DirLister, checker PathChecker) FileBrowserModel

NewFileBrowserWithChecker creates a FileBrowserModel with a custom path checker for testability.

func (FileBrowserModel) Init

func (m FileBrowserModel) Init() tea.Cmd

Init satisfies the tea.Model interface.

func (FileBrowserModel) Update

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

Update handles messages and key input for the file browser.

func (FileBrowserModel) View

func (m FileBrowserModel) View() string

View renders the file browser.

type GitRootResolver

type GitRootResolver func(dir string) (string, error)

GitRootResolver resolves a directory to its git repository root. Returns the original directory if not in a git repo.

type PathChecker

type PathChecker func(path string) error

PathChecker verifies a directory path exists on disk.

Jump to

Keyboard shortcuts

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