Skip to content

Conversation

@ryantrem
Copy link
Member

Prior to this PR Inspector v2 supports Scene Explorer "commands" which are shown inline in the tree view item, and as such they must have an icon. For the Inspector v1 explorerExtensibility option, it is effectively a Scene Explorer command, but has no icon. In Inspector v1, there is a ... icon at the end that has the context menu. In Inspector v2, we already have a right click context menu for other things like expand/collapse. Given this, the strategy for Inspector v2 is:

  • Allow for "inline" vs. "contextMenu" commands for Scene Explorer. "inline" is the default and requires an icon, where as for "contextMenu" the icon is optional.
  • For commands that are toggle "type" and contextMenu "mode", if an icon is provided it is used, otherwise a checkmark is used, but we don't double up the iconography and have both a checkmark and an icon.

With this in place, explorerExtensibility is simply adding commands of type "action" and mode "contextMenu" with no icon.

image

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds backward compatibility for Inspector v1's explorerExtensibility option in Inspector v2 by introducing support for context menu commands alongside inline commands. The key changes enable commands to be shown either inline in the tree view or in a right-click context menu, with optional icons for context menu commands.

  • Implements conversion of v1 explorerExtensibility options to v2 context menu commands
  • Refactors command type system to support "inline" and "contextMenu" modes
  • Adds context menu rendering with support for action and toggle commands, including proper icon/checkmark handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/dev/inspector-v2/src/legacy/inspector.tsx Adds conversion logic to transform v1 explorerExtensibility entries into v2 context menu commands
packages/dev/inspector-v2/src/components/scene/sceneExplorer.tsx Refactors command type definitions to support inline vs context menu modes, adds context menu rendering logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17470/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/17470/merge/?snapshot=refs/pull/17470/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/17470/merge/

@ryantrem ryantrem enabled auto-merge (squash) November 18, 2025 01:10
@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Nov 18, 2025

@ryantrem ryantrem merged commit 2f20875 into BabylonJS:master Nov 18, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants