Log inGet started
Package

explorer.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

explorer

A two-pane filesystem Explorer composite: a breadcrumb plus up/refresh actions on top, a folder tree on the left, and a details list (icon · name · kind) of the current directory on the right. Stateless — pass the model from Z.fs.controller.model(slot) and a callback prefix; the controller's handle(slot, prefix, ...) routes the callbacks this emits.

The same composite is the body of Z.fs.dialog (the modal save/load picker), so the panel and the dialog look and behave identically. The explorer fills its parent's height via flex, so the host panel just needs to give it room.

The module returns the builder function directly.

Builder

build(model, opts?) -> widget node.

  • model — the Z.fs.controller.model(slot) result: { root, currentDir, breadcrumbPath, treeRoots, listEntries, selectedPath, expanded }.
  • opts (ExplorerOpts) — prefix (callback prefix, default "fs"), treeFrac (tree pane fraction of width, 0..1, default 0.4), id.

Returns a vbox of the action row (up + refresh + breadcrumb) and a resizable horizontal split of the tree and details-list panes.

Usage

local model = Z.fs.controller.model(state.files)
Z.fs.explorer(model, { prefix = "files", treeFrac = 0.4 })