filepicker

package
v1.0.260758 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package filepicker is a small modal file browser used by Host.PickFile — deliberately not the full Files app (apps/files): no clipboard, trash, mkdir, or drag/drop, just navigate and pick, so consumers like Amp/Vid ("open local file") don't have to pull in a second, heavier UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is a modal file browser: Up/Down move, Enter opens a directory or picks a file, Esc cancels. onResult fires exactly once.

func New

func New(startDir string, extensions []string, onResult func(path string, ok bool)) *App

New opens a picker rooted at startDir (falls back to the home directory if empty or unreadable), restricted to extensions (without the leading dot) if any are given.

func (*App) Close

func (a *App) Close() error

func (*App) Draw

func (a *App) Draw(cv *uiapp.Canvas) error

func (*App) Handle

func (a *App) Handle(e uiapp.Event) error

func (*App) Init

func (a *App) Init(ctx *uiapp.Context) error

func (*App) WantsClose

func (a *App) WantsClose() bool

Jump to

Keyboard shortcuts

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