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§
- GetTree
View Children - Tauri command - fetch children for a tree node.
ElementHandle = Nonereturns the root level. Dispatches throughMountainEnvironment::Require<dyn TreeViewProvider>. - GetTree
View Item - Tauri command - fetch a single tree item’s metadata (label, icon, description, command, contextValue) by its element handle.
- OnTree
View Expansion Changed - Tauri command - notify the provider when a tree node is expanded / collapsed.
- OnTree
View Selection Changed - Tauri command - notify the provider when tree-item selection
changes (multi-select supported via
SelectedHandles). - Persist
Tree View - Tauri command - serialise tree-view state (expansion, selection, scroll position) for cross-session restore.
- Refresh
Tree View - Tauri command - request a tree view refresh, optionally targeting
specific item handles.
Nonerefreshes the entire tree. - Restore
Tree View - Tauri command - deserialise + apply tree-view state captured by
PersistTreeView(sibling). Called when a tree view is recreated or the workspace is reloaded. - Reveal
Tree View Item - Tauri command - focus / scroll-into-view a specific tree item.
Optionscarries the LSP-shapedselect,focus,expandbooleans (matchesvscode.TreeView.reveal).