Skip to content

feat(event-display): allow restoring removed geometries from detector configuration - #1058

Merged
EdwardMoyse merged 1 commit into
HSF:mainfrom
coder-Yash886:feat/restore-removed-geometry
Nov 8, 2026
Merged

EdwardMoyse merged 1 commit into
HSF:mainfrom
coder-Yash886:feat/restore-removed-geometry

Conversation

@coder-Yash886

Copy link
Copy Markdown
Contributor

Closes #1056

Description

When detector geometries were removed using the "Remove" button in their configuration popup, they were permanently detached from both the Three.js scene and the Phoenix Menu, leaving users with no way to restore them without reloading the entire application or scene.

As suggested by @EdwardMoyse in #1056, this PR introduces a "Removed Geometry" section in the top-level Detector configuration panel (where the wireframe option is located) to allow restoring removed geometries back to the scene and menu.


Key Changes

  1. Track Removed Geometries:

    • In PhoenixMenuUI, geometries removed via the menu are tracked with their metadata (id, display name, object, original menuSubfolder, and Three.js parent3D).
    • Also mirrored in DatGUIMenuUI for feature parity.
  2. Top-Level Configuration Panel UI:

    • Single removed geometry: Dynamically adds a Removed Geometry label and a direct Restore <Name> button.
    • Multiple removed geometries: Adds a select dropdown listing the removed geometries, a Restore Selected button, and a Restore All button.
    • Clean cleanup: The restoration controls disappear from the configuration panel as soon as all geometries are restored.
  3. Restoration Logic:

    • Restores the 3D geometry back to its original parent (parent3D or detector geometries group) and sets visible = true.
    • Re-creates the geometry node in the Phoenix menu with its full controls intact (visibility toggle, color picker, opacity slider, and remove button).
  4. Supporting Core Updates:

    • PhoenixMenuNode: Added removeConfig(configOrLabel) and removeConfigsByGroup(group) helper methods.
    • SceneManager: Added addGeometry(object, parent?) and ensured removeGeometry(object) handles nested parents.
    • UIManager: Exposed getRemovedGeometries(), restoreGeometry(), and restoreAllGeometries().
    • PhoenixMenuItemComponent: Ensured select change event updates config.value.

Testing

  • Added unit tests in phoenix-menu-ui.test.ts covering:
    • Tracking removed geometry and restoring via the top-level Detector config.
    • Multi-geometry removal with dropdown selection, Restore Selected, and Restore All.
    • State reset on clear().
  • Added unit tests in phoenix-menu-node.test.ts for removeConfig and removeConfigsByGroup.
  • Added unit tests in scene-manager.test.ts for addGeometry and nested parent removal.
  • Added unit tests in dat-gui-ui.test.ts for dat.GUI removal and restoration.
  • Verified all 47 test suites (435 tests) in phoenix-event-display pass with 100%.
  • Verified yarn lint passes with 0 errors and 0 warnings.
  • Verified clean build of phoenix-app.

@coder-Yash886

Copy link
Copy Markdown
Contributor Author

@EdwardMoyse Please review the Pr when you have the free time.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

🚀 Preview deployed: http://phoenix-pr-1058.surge.sh

Built from bc1f8b5.

@EdwardMoyse
EdwardMoyse merged commit b489cc3 into HSF:main Nov 8, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
pull-request — bc1f8b5a Deployed Nov 7, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We can remove geometry - there should be a way to get it back

2 participants