yera.ui.apps_sidebar
Utils for the rendering the app tree sidebar panel.
Symbols
app_icon
app_icon(
app_id: str,
app: AppFunctionWrapper,
) → strGenerates an HTML badge for an application.
Parameters
The unique identifier of the app used to determine its color.
The application wrapper containing the display name.
Returns
An HTML string representing the app's icon badge.
AppTreeFile
A Python source file containing one or more app functions.
AppTreeFolder
A directory containing folders or Python source files.
AppTreeLeaf
A selectable app function within a source file.
build_app_tree
build_app_tree(
apps: dict[str, AppFunctionWrapper],
) → list[AppTreeFolder | AppTreeFile]Build a tree that preserves source files above app functions.
render_app_tree
render_app_tree(
nodes: list[AppTreeLeaf | AppTreeFolder | AppTreeFile],
depth: int = 0,
selected_app_id: str | None = None,
) → strRecursively renders a compacted app tree as HTML.
Indentation comes entirely from the nested .app-tree__children wrapper (border + margin, in CSS) — rows use fixed padding regardless of depth; depth here only controls whether a folder starts expanded.
Parameters
Tree nodes at this level, from _build_app_tree.
Current nesting depth — default-open state only.
Optional app identifier to mark as the current selection.
Returns
HTML string of the rendered tree.