Skip to content

Commit 9737480

Browse files
authored
Inspector v2: Scene Explorer expand/collapse all (#17024)
This change brings expand/collapse all to scene explorer. - Previously there was a single useMemo that traversed the expanded part of the scene and created TreeItemData only for the expanded nodes. I've broken this out now into two different useMemos. The first one creates TreeItemData for *all* entities, and the second one filters down those TreeItemData into only those that are expanded/visible. I'd already been thinking about reworking it like this for other reasons as it simplifies a lot of things. As part of this, I was able to simplify the interface a scene explorer section in that it no longer needs to provide a predicate or a function to get the parent (which can now be inferred from the internal TreeItemData tree structure). - Removed the unnecessary type param from all the scene explorer command interfaces and components. This was needed when a command instance was not tied to a specific entity instance, but now they are 1:1, so there is no need to pass an entity into a command instance (it holds it internally). This is just cleanup that I missed in previous changes. - Expand/collapse all can be triggered in a similar way as inspector v1 by holding down shift (or ctrl) when clicking the expand/collapse button on a tree node. I also added explicit context menus to help make it more discoverable. I did not make the context menus extensible in this PR, but may in a future change if we think it makes sense to be able to add in more items to the context menu dynamically. - Also updated to the virtualizer that is no longer in preview state. It is part of the fluent contrib package family, which is analogous to Babylon's Addons package. <img width="374" height="395" alt="image" src="https://github.com/user-attachments/assets/386244a1-f521-47e1-beee-d4cea7d32426" />
1 parent adc1579 commit 9737480

16 files changed

+284
-181
lines changed

package-lock.json

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dev/inspector-v2/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@dev/loaders": "1.0.0",
2323
"@dev/materials": "^1.0.0",
2424
"@dev/serializers": "1.0.0",
25+
"@fluentui-contrib/react-virtualizer": "^0.1.0",
2526
"@fluentui/react-components": "^9.62.0",
2627
"@fluentui/react-icons": "^2.0.271",
2728
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",

0 commit comments

Comments
 (0)