filebrowser

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 23 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.CloudAPI, 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.CloudAPI, 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.CloudAPI, 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.CloudAPI, 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.CloudAPI, 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.CloudAPI, 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.CloudAPI, 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.CloudAPI, 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

type SyncDialog added in v1.2.0

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

SyncDialog prompts for a sync mode and a local directory, then installs a systemd user service that continuously syncs the selected pCloud folder.

func NewSyncDialog added in v1.2.0

func NewSyncDialog(cloudPath string) *SyncDialog

NewSyncDialog creates a sync setup dialog for the given folder path.

func (*SyncDialog) Init added in v1.2.0

func (m *SyncDialog) Init() tea.Cmd

func (*SyncDialog) Update added in v1.2.0

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

func (*SyncDialog) View added in v1.2.0

func (m *SyncDialog) View() tea.View

Jump to

Keyboard shortcuts

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