Skip to content

643 Standardize Add menu entries and offer only objects the simulator supports - #2563

Merged
grzanka merged 2 commits into
masterfrom
1030-standarize-add-menu-option-names
Dec 4, 2026
Merged

grzanka merged 2 commits into
masterfrom
1030-standarize-add-menu-option-names

Conversation

@martastn

Copy link
Copy Markdown
Contributor

Closes #1030, closes #643.

What was left in these issues

Most of #1030 was already done by the UI rework (#2063, #2165): figures are calledBox / Cylinder / Sphere (no "Mesh"), "Material Zone" became Boolean Zone, "Detect Geometry" became Detector, "Simulation Output" became Output. #1031 is closed. The last item of #643, "Remove material number from label", referred to the old outliner (Zone [947] ▲ WATER, LIQUID [276]); the current tree shows only object names, so nothing is left to do there.

What was still inconsistent:

Before After
Filter names Custom filter, Particle filter, New filter (Geant4) Custom Filter, Particle Filter, Filter, the same Title Case as Boolean Zone, CTCube, Beam Modulator. New filter was the only entry that did not name an object type
Object menu Figures, Zones, Detectors, Outputs. Filters and Special Componentswere filtered out, but Zones were shown for every simulator The same groups and order as the sidebar for the current simulator
Geant4 Object menu offered Boolean Zone. Geant4 has no Zones section, so the zone was created and selected (Zone Operations and Material panels appear) but it is not listed anywhere. After deselecting it the user cannot find or delete it no Boolean Zone

Changes

  • CommandButtonProps.ts: renamed the three filter labels. Zones is empty for Geant4 and Special Components is empty outside SHIELD-HIT12A, which matches what EditorSidebar already renders.
  • EditorMenu.tsx: the Object menu uses every non-empty group instead of a hard-coded exclusion list.

The sidebar is unchanged apart from the labels. It already picked groups per simulator, and its buttons are upper-cased by the theme, so only Geant4 visibly changes (NEW FILTER becomes FILTER).

Screenshots

Object menu, SHIELD-HIT12A (left: master, right: this PR)
cmp-shieldhit-object-menu

Object menu, Geant4. Boolean Zone is gone, Filter is added
cmp-geant4-object-menu

Geant4 Filters section
cmp-geant4-filters

Testing

  • Playwright on master and on this branch, for Common, SHIELD-HIT12A, FLUKA and Geant4: compared the sidebar add buttons and the Object menu, then clicked every Object menu entry. Each entry creates the right object type (Box/Cylinder/Sphere, Geant4Box/…, BooleanZone, Detector, CTCube, BeamModulator, Custom/Particle/Geant filter,Output, Quantity), selects it and switches to the right sidebar tab. CT Cube and Beam Modulator become disabled in the menu after one is added. Quantity is disabled until an output is selected.
  • tsc --noEmit, eslint and prettier on the changed files. Unit tests pass.
  • The patch applies to master f26ccab4 and does not touch any file changed by other open PRs.

@martastn martastn self-assigned this Nov 24, 2026
@martastn
martastn marked this pull request as ready for review November 28, 2026 10:39

@grzanka grzanka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice cleanup. The Object menu now matches the sidebar for each simulator, and removing Boolean Zone from Geant4 fixes a real problem. One regression and two small points are inline.

Comment thread src/util/Ui/CommandButtonProps.ts Resolved
Comment thread src/util/Ui/CommandButtonProps.ts Resolved
…e for filter group labels, test Add menu entries
@grzanka
grzanka enabled auto-merge December 4, 2026 16:34
@grzanka
grzanka added this pull request to the merge queue Dec 4, 2026
Merged via the queue into master with commit ca6c62b Dec 4, 2026
10 checks passed
@grzanka
grzanka deleted the 1030-standarize-add-menu-option-names branch December 4, 2026 16:35
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.

Standarize Add menu option names Remarks on the naming

2 participants