Builtin Library
README.md
dockApp
A visibility-driven docked-app handle. Wraps Z.app with a per-panel refresh scheduler over the same tab contract as Z.shell.tabApp, but renders the open panels as Z.dockPanels inside a single Z.dockArea (real egui_dock tabs, splits, and drag). The app costs zero engine work while hidden; each open panel polls on its own refresh interval, and the open model is an ordered set of open panel keys rather than a single active tab.
Each entry in tabs follows the tab contract { label, refresh, build, onMount?, onCallback?, tick?, float? }. A tab's own float overrides the app-level float default — e.g. a viewport tab sets float = false to dock into the main surface while tool panels float.
Create
M.create(opts) -> DockAppHandle — the module table is callable, so DockApp(opts) works too. Required opts: name, tabs, tabOrder (may be empty). Optional: initialOpen, tabAliases, statusClock, onStatusTick, extraScreens, appOpts, initialState, dockLayout, float, and dock presentation keys (overlayType, leafCollapseButtons, leafCloseAllButtons, allowedSplits, dockStyle).
Handle
The returned DockAppHandle carries:
app,state,screenNameupdate(dt)— runs the scheduler and ticks the app.onCallback(callbackId, data) -> boolean— routes dock close, app dispatch, and tab/extraScreen callbacks.destroy(),setVisible(v)openPanel(key),closePanel(key),isOpen(key) -> boolean,togglePanel(key)— drive the open set.getLayout() -> string?,restoreLayout(json)— read and re-apply the live dock split/tab arrangement.
Usage
local DockApp = require("modules.zui.shell.dockApp")
local handle = DockApp {
name = "system_tools",
tabs = TABS,
tabOrder = { "entities", "logs" },
initialOpen = { "entities" },
}