filebrowser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionsDialog

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

ActionsDialog lets the user pick an action to perform on a file or folder.

func NewActionsDialog

func NewActionsDialog(api *pcloud.API, entry msgs.Entry, width, height int) ActionsDialog

NewActionsDialog creates an action picker for the given entry. Folder-specific actions are shown when entry.IsFolder is true. width and height are the current terminal dimensions, passed through to sub-dialogs (e.g. the preview dialog) that need them at construction time.

func (ActionsDialog) Init

func (m ActionsDialog) Init() tea.Cmd

func (ActionsDialog) Update

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

func (ActionsDialog) View

func (m ActionsDialog) View() tea.View

type DeleteDialog

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

DeleteDialog asks for confirmation before deleting a file.

func NewDeleteDialog

func NewDeleteDialog(api *pcloud.API, entry msgs.Entry) DeleteDialog

NewDeleteDialog creates a delete confirmation dialog.

func (DeleteDialog) Init

func (m DeleteDialog) Init() tea.Cmd

func (DeleteDialog) Update

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

func (DeleteDialog) View

func (m DeleteDialog) View() tea.View

type DownloadDialog

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

DownloadDialog is a standalone tea.Model for the file-download prompt.

func NewDownloadDialog

func NewDownloadDialog(api *pcloud.API, entry msgs.Entry) DownloadDialog

NewDownloadDialog creates a download dialog for the given file entry.

func (DownloadDialog) Init

func (m DownloadDialog) Init() tea.Cmd

func (DownloadDialog) Update

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

func (DownloadDialog) View

func (m DownloadDialog) View() tea.View

type FolderDownloadDialog

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

FolderDownloadDialog downloads a remote folder as a zip and extracts it locally.

func NewFolderDownloadDialog

func NewFolderDownloadDialog(api *pcloud.API, entry msgs.Entry) FolderDownloadDialog

NewFolderDownloadDialog creates a download dialog for the given folder entry.

func (FolderDownloadDialog) Init

func (m FolderDownloadDialog) Init() tea.Cmd

func (FolderDownloadDialog) Update

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

func (FolderDownloadDialog) View

func (m FolderDownloadDialog) View() tea.View

type Model

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

Model is the filebrowser component.

func New

func New(api *pcloud.API, width, height int) Model

New creates a new filebrowser starting at root.

func (Model) Init

func (m Model) Init() tea.Cmd

Init kicks off the initial folder load.

func (*Model) SetSize

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

SetSize updates the component dimensions.

func (Model) Update

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

Update handles messages for the filebrowser component.

func (Model) View

func (m Model) View() string

View renders the filebrowser.

type MoveDialog

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

MoveDialog lets the user move a file to a different folder.

func NewMoveDialog

func NewMoveDialog(api *pcloud.API, entry msgs.Entry) MoveDialog

NewMoveDialog creates a move dialog for the given file entry.

func (MoveDialog) Init

func (m MoveDialog) Init() tea.Cmd

func (MoveDialog) Update

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

func (MoveDialog) View

func (m MoveDialog) View() tea.View

type PreviewDialog

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

PreviewDialog is a dialog-compatible tea.Model that fetches and displays a scrollable file preview inside a viewport.

func NewPreviewDialog

func NewPreviewDialog(api *pcloud.API, entry msgs.Entry, width, height int) PreviewDialog

NewPreviewDialog builds a preview dialog for the given file entry.

func (PreviewDialog) Init

func (m PreviewDialog) Init() tea.Cmd

func (PreviewDialog) Update

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

func (PreviewDialog) View

func (m PreviewDialog) View() tea.View

type RenameDialog

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

RenameDialog lets the user rename a file.

func NewRenameDialog

func NewRenameDialog(api *pcloud.API, entry msgs.Entry) RenameDialog

NewRenameDialog creates a rename dialog for the given file entry.

func (RenameDialog) Init

func (m RenameDialog) Init() tea.Cmd

func (RenameDialog) Update

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

func (RenameDialog) View

func (m RenameDialog) View() tea.View

Jump to

Keyboard shortcuts

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