browser

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMap

type KeyMap struct {
	Up      key.Binding
	Down    key.Binding
	Enter   key.Binding
	Back    key.Binding
	Open    key.Binding
	Close   key.Binding
	Preview key.Binding
	Quit    key.Binding
}

KeyMap defines the key bindings for the browser.

type Model

type Model struct {
	Focused bool
	Label   string // e.g. "S3" or "Local"
	ID      int    // panel identifier (0=left, 1=right)
	// contains filtered or unexported fields
}

Model is the browser panel model.

func New

func New(b backend.Backend, initialPath string, t theme.Theme) Model

New creates a new browser panel.

func (Model) Backend

func (m Model) Backend() backend.Backend

Backend returns the panel's backend.

func (*Model) ClearSelection

func (m *Model) ClearSelection()

ClearSelection clears all selected entries.

func (Model) CursorEntry

func (m Model) CursorEntry() (backend.FileEntry, bool)

CursorEntry returns the entry under the cursor, if any.

func (Model) CursorInfo

func (m Model) CursorInfo() string

CursorInfo returns cursor position info like "3 of 42".

func (Model) Init

func (m Model) Init() tea.Cmd

Init starts the initial directory listing.

func (Model) IsCapturingInput

func (m Model) IsCapturingInput() bool

IsCapturingInput reports whether the panel is in a text-input mode (searching or renaming) and should receive all keystrokes exclusively.

func (Model) LastError

func (m Model) LastError() error

LastError returns the most recent panel error, if any.

func (Model) Path

func (m Model) Path() string

Path returns the current directory path.

func (Model) PreviewContent

func (m Model) PreviewContent() string

PreviewContent returns the raw content of the previewed file.

func (Model) PreviewName

func (m Model) PreviewName() string

PreviewName returns the name of the file being previewed.

func (Model) PreviewScroll

func (m Model) PreviewScroll() int

PreviewScroll returns the current scroll offset in the preview.

func (Model) Previewing

func (m Model) Previewing() bool

View renders the browser panel. Previewing returns true when the preview overlay is active.

func (Model) Refresh

func (m Model) Refresh() tea.Cmd

Refresh re-lists the current directory.

func (Model) SelectedEntries

func (m Model) SelectedEntries() []backend.FileEntry

SelectedEntries returns the list of selected file entries.

func (*Model) SetShowHidden

func (m *Model) SetShowHidden(v bool)

SetShowHidden controls whether dotfiles are shown.

func (*Model) SetSize

func (m *Model) SetSize(w, h int)

SetSize updates the panel dimensions.

func (*Model) SetSortAsc

func (m *Model) SetSortAsc(asc bool)

SetSortAsc sets the sort direction.

func (*Model) SetSortBy

func (m *Model) SetSortBy(s string)

SetSortBy sets the sort field ("name", "size", "date").

func (*Model) SetTheme

func (m *Model) SetTheme(t theme.Theme)

SetTheme updates the panel theme.

func (Model) StatusLine

func (m Model) StatusLine() string

StatusLine renders the sort/filter status shown below the panel border.

func (Model) Title

func (m Model) Title() string

Title returns the panel title string (e.g. "S3://path") without panel number.

func (Model) Update

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

Update handles messages.

func (Model) View

func (m Model) View() string

func (Model) ViewPreview

func (m Model) ViewPreview(w, h int) string

ViewPreview renders the preview overlay at the given width and height.

Jump to

Keyboard shortcuts

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