Skip to main content

Module TreeView

Module TreeView 

Source
Expand description

§TreeView (Tauri command surface)

Bridges tree-view UI requests from Sky (file explorer, SCM viewlet, debug viewlet, extension-contributed views) into the MountainEnvironment::Require<dyn TreeViewProvider> registry. Eight wire-bound commands, each in its own file (file name = Tauri command identifier per the Naming-Convention exception):

  • GetTreeViewChildren::GetTreeViewChildren - fetch children for a tree node (or root).
  • GetTreeViewItem::GetTreeViewItem - fetch a single item’s metadata.
  • OnTreeViewExpansionChanged::OnTreeViewExpansionChanged (stub).
  • OnTreeViewSelectionChanged::OnTreeViewSelectionChanged (stub).
  • RefreshTreeView::RefreshTreeView - request data refresh.
  • RevealTreeViewItem::RevealTreeViewItem - focus / scroll-into -view.
  • PersistTreeView::PersistTreeView (stub).
  • RestoreTreeView::RestoreTreeView (stub).

Errors propagate as Result<Value, String> with the error string surfaced directly to the renderer.

VS Code reference: vs/workbench/api/browser/mainThreadTreeViews.ts, vs/workbench/api/common/extHostTreeViews.ts.

TODO: trait additions on CommonTreeViewProvider for the four stubs above (expansion, selection, persist, restore). Drag-and- drop, multi-column, badge / tooltip / icon-theming support, and tree-item validation are deferred.

Modules§

GetTreeViewChildren
Tauri command - fetch children for a tree node. ElementHandle = None returns the root level. Dispatches through MountainEnvironment::Require<dyn TreeViewProvider>.
GetTreeViewItem
Tauri command - fetch a single tree item’s metadata (label, icon, description, command, contextValue) by its element handle.
OnTreeViewExpansionChanged
Tauri command - notify the provider when a tree node is expanded / collapsed.
OnTreeViewSelectionChanged
Tauri command - notify the provider when tree-item selection changes (multi-select supported via SelectedHandles).
PersistTreeView
Tauri command - serialise tree-view state (expansion, selection, scroll position) for cross-session restore.
RefreshTreeView
Tauri command - request a tree view refresh, optionally targeting specific item handles. None refreshes the entire tree.
RestoreTreeView
Tauri command - deserialise + apply tree-view state captured by PersistTreeView (sibling). Called when a tree view is recreated or the workspace is reloaded.
RevealTreeViewItem
Tauri command - focus / scroll-into-view a specific tree item. Options carries the LSP-shaped select, focus, expand booleans (matches vscode.TreeView.reveal).