Added context menu items for collapsing and expanding nodes

Summary:
Added 3 context menu items:
- expand recursive
- collapse recursive

These are self explanatory.

I also collapse non ancestors. This collapses everything except your direct ancestor path to the root. Quite useful to refocus the tree on a node

Changelog: UIDebugger - added  context menu items for exanding and collapsing the tree.

Reviewed By: aigoncharov

Differential Revision: D47949840

fbshipit-source-id: 6eebba182fe2092fbf5f0db0ec5ff728c3900424
This commit is contained in:
Luke De Feo
2023-08-01 10:32:29 -07:00
committed by Facebook GitHub Bot
parent 129c848b78
commit ce1fdfdf19
6 changed files with 123 additions and 4 deletions

View File

@@ -211,9 +211,13 @@ export function Tree2({
focusedNodeId={focusedNode}
hoveredNodeId={hoveredNode}
nodes={nodes}
onSelectNode={instance.uiActions.onSelectNode}
onSetViewMode={instance.uiActions.onSetViewMode}
onContextMenuOpen={instance.uiActions.onContextMenuOpen}
onFocusNode={instance.uiActions.onFocusNode}>
onFocusNode={instance.uiActions.onFocusNode}
onCollapseNonAncestors={instance.uiActions.onCollapseAllNonAncestors}
onCollapseRecursively={instance.uiActions.onCollapseAllRecursively}
onExpandRecursively={instance.uiActions.onExpandAllRecursively}>
<div
//We use this normal divs flexbox sizing to measure how much vertical space we need for the child div
ref={grandParentRef}