Documentation
¶
Index ¶
- func NewEnterDirMsg(path string) tea.Cmd
- type AdvancedKeyMap
- type AdvancedModel
- func (fp *AdvancedModel) FullHelpForMode() [][]key.Binding
- func (fp *AdvancedModel) GetDirectorySelectionMode() bool
- func (fp *AdvancedModel) GetError() error
- func (fp *AdvancedModel) GetSelected() ([]string, bool)
- func (fp *AdvancedModel) Init() tea.Cmd
- func (fp *AdvancedModel) IsDirectorySelectionMode() bool
- func (fp *AdvancedModel) SelectedFile() string
- func (fp *AdvancedModel) SetDirectorySelectionMode(enabled bool)
- func (fp *AdvancedModel) SetShowHidden(show bool)
- func (fp *AdvancedModel) SetShowPreview(show bool)
- func (fp *AdvancedModel) SetSize(width, height int)
- func (fp *AdvancedModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (fp *AdvancedModel) View() string
- type AdvancedStyles
- type CancelFilePickerMsg
- type CompatFilepicker
- type EnterDirMsg
- type File
- type Model
- type Operation
- type Option
- func WithCompatibilityMode(compat bool) Option
- func WithDetailedView(detailed bool) Option
- func WithDirectorySelection(enabled bool) Option
- func WithGlobPattern(pattern string) Option
- func WithJailDirectory(path string) Option
- func WithKeyMap(keys *AdvancedKeyMap) Option
- func WithMaxHistorySize(size int) Option
- func WithPreviewWidth(width int) Option
- func WithShowHidden(show bool) Option
- func WithShowIcons(show bool) Option
- func WithShowPreview(show bool) Option
- func WithShowSizes(show bool) Option
- func WithSortMode(mode SortMode) Option
- func WithStartPath(path string) Option
- func WithStyles(styles *AdvancedStyles) Option
- type SelectFileMsg
- type SortMode
- type ViewState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEnterDirMsg ¶
Types ¶
type AdvancedKeyMap ¶
type AdvancedKeyMap struct {
// Navigation
Up key.Binding
Down key.Binding
Home key.Binding
End key.Binding
// Selection
Enter key.Binding
Space key.Binding
SelectAll key.Binding
DeselectAll key.Binding
SelectAllFiles key.Binding
// File operations
Delete key.Binding
Copy key.Binding
Cut key.Binding
Paste key.Binding
Rename key.Binding
NewFile key.Binding
NewDir key.Binding
// Navigation
Escape key.Binding
Backspace key.Binding
Refresh key.Binding
Back key.Binding
Forward key.Binding
// Tier 4 features
TogglePreview key.Binding
Search key.Binding
Glob key.Binding
ClearGlob key.Binding
ToggleHidden key.Binding
ToggleDetail key.Binding
CycleSort key.Binding
// Directory selection
SelectCurrentDir key.Binding
ToggleDirSelection key.Binding
// System
Help key.Binding
Quit key.Binding
}
AdvancedKeyMap defines the key bindings for the advanced file picker
func DefaultAdvancedKeyMap ¶
func DefaultAdvancedKeyMap() *AdvancedKeyMap
DefaultAdvancedKeyMap returns the default key bindings for the advanced file picker
func (AdvancedKeyMap) FullHelp ¶
func (k AdvancedKeyMap) FullHelp() [][]key.Binding
FullHelp returns keybindings for the expanded help view
func (AdvancedKeyMap) ShortHelp ¶
func (k AdvancedKeyMap) ShortHelp() []key.Binding
ShortHelp returns keybindings to be shown in the mini help view
type AdvancedModel ¶
type AdvancedModel struct {
CurrentPath string
Styles *AdvancedStyles
// contains filtered or unexported fields
}
AdvancedModel represents the advanced file picker model
func New ¶
func New(options ...Option) *AdvancedModel
New creates a new file picker with the specified options
func NewAdvancedModel ¶
func NewAdvancedModel(startPath string) *AdvancedModel
NewAdvancedModel creates a new advanced file picker Deprecated: Use New(WithStartPath(startPath)) instead
func (*AdvancedModel) FullHelpForMode ¶
func (fp *AdvancedModel) FullHelpForMode() [][]key.Binding
FullHelpForMode returns keybindings for the expanded help view based on the current mode
func (*AdvancedModel) GetDirectorySelectionMode ¶
func (fp *AdvancedModel) GetDirectorySelectionMode() bool
GetDirectorySelectionMode returns whether directory selection mode is enabled
func (*AdvancedModel) GetError ¶
func (fp *AdvancedModel) GetError() error
GetError returns any error that occurred
func (*AdvancedModel) GetSelected ¶
func (fp *AdvancedModel) GetSelected() ([]string, bool)
GetSelected returns the selected file paths
func (*AdvancedModel) Init ¶
func (fp *AdvancedModel) Init() tea.Cmd
Init initializes the file picker
func (*AdvancedModel) IsDirectorySelectionMode ¶
func (fp *AdvancedModel) IsDirectorySelectionMode() bool
IsDirectorySelectionMode returns whether directory selection mode is enabled
func (*AdvancedModel) SelectedFile ¶
func (fp *AdvancedModel) SelectedFile() string
SelectedFile returns the currently selected files
func (*AdvancedModel) SetDirectorySelectionMode ¶
func (fp *AdvancedModel) SetDirectorySelectionMode(enabled bool)
SetDirectorySelectionMode enables or disables directory selection mode
func (*AdvancedModel) SetShowHidden ¶
func (fp *AdvancedModel) SetShowHidden(show bool)
SetShowHidden sets whether to show hidden files
func (*AdvancedModel) SetShowPreview ¶
func (fp *AdvancedModel) SetShowPreview(show bool)
SetShowPreview sets whether to show file preview
func (*AdvancedModel) SetSize ¶
func (fp *AdvancedModel) SetSize(width, height int)
SetSize sets the width and height of the file picker
func (*AdvancedModel) View ¶
func (fp *AdvancedModel) View() string
View renders the advanced file picker (Tier 4)
type AdvancedStyles ¶
type AdvancedStyles struct {
BorderStyle lipgloss.Style
TitleStyle lipgloss.Style
PathStyle lipgloss.Style
SelectedStyle lipgloss.Style
MultiSelectedStyle lipgloss.Style
NormalStyle lipgloss.Style
DirStyle lipgloss.Style
DirSelectionStyle lipgloss.Style
HiddenStyle lipgloss.Style
StatusStyle lipgloss.Style
PreviewTitleStyle lipgloss.Style
SearchStyle lipgloss.Style
ConfirmStyle lipgloss.Style
ErrorStyle lipgloss.Style
}
AdvancedStyles defines the styles
func DefaultAdvancedStyles ¶
func DefaultAdvancedStyles() *AdvancedStyles
DefaultAdvancedStyles returns the default styles
type CancelFilePickerMsg ¶
type CancelFilePickerMsg struct{}
type CompatFilepicker ¶
type CompatFilepicker struct {
DirAllowed bool
FileAllowed bool
CurrentDirectory string
Height int
// contains filtered or unexported fields
}
CompatFilepicker provides compatibility with the old bubbles filepicker interface
type EnterDirMsg ¶
type EnterDirMsg struct {
Path string
}
EnterDirMsg sends a msg to enter a directory
type File ¶
type File struct {
Name string
Path string
IsDir bool
Size int64
ModTime time.Time
Mode os.FileMode
Selected bool
Hidden bool
}
File represents a file or directory with extended metadata
type Model ¶
type Model struct {
*AdvancedModel
// Compatibility fields
Title string
Error string
Filepicker CompatFilepicker
SelectedPath string
// contains filtered or unexported fields
}
Model provides backward compatibility with the original bobatea filepicker API
func NewModel ¶
func NewModel() Model
NewModel creates a new file picker with backward compatibility This maintains the original bobatea API while using the advanced implementation
func NewModelWithOptions ¶
NewModelWithOptions creates a new file picker with backward compatibility using options
type Option ¶
type Option func(*AdvancedModel)
Option represents a configuration option for the file picker
func WithCompatibilityMode ¶
WithCompatibilityMode enables compatibility mode (no additional effect currently)
func WithDetailedView ¶
WithDetailedView sets whether to show detailed file information
func WithDirectorySelection ¶
WithDirectorySelection enables or disables directory selection mode
func WithGlobPattern ¶
WithGlobPattern sets the initial glob pattern filter
func WithJailDirectory ¶
WithJailDirectory sets a directory restriction boundary - navigation will be limited to this directory and subdirectories
func WithKeyMap ¶
func WithKeyMap(keys *AdvancedKeyMap) Option
WithKeyMap sets the key map for the filepicker
func WithMaxHistorySize ¶
WithMaxHistorySize sets the maximum number of history entries
func WithPreviewWidth ¶
WithPreviewWidth sets the width of the preview panel
func WithShowHidden ¶
WithShowHidden sets whether to show hidden files
func WithShowIcons ¶
WithShowIcons sets whether to show file icons
func WithShowPreview ¶
WithShowPreview sets whether to show file preview
func WithShowSizes ¶
WithShowSizes sets whether to show file sizes
func WithStartPath ¶
WithStartPath sets the starting directory path
func WithStyles ¶
func WithStyles(styles *AdvancedStyles) Option
WithStyles sets the key map for the filepicker
type SelectFileMsg ¶
type SelectFileMsg struct {
Path string
}
Messages for compatibility with existing bobatea filepicker API