Skip to content

feat(ecs): Scene::AddComponentRaw + InspectorPanel Add Component popup - #757

Merged
JeanPhilippeKernel merged 3 commits into
JeanPhilippeKernel:developfrom
jnyfah:user/jnyfah/ticketx
Sep 6, 2026
Merged

feat(ecs): Scene::AddComponentRaw + InspectorPanel Add Component popup#757
JeanPhilippeKernel merged 3 commits into
JeanPhilippeKernel:developfrom
jnyfah:user/jnyfah/ticketx

Conversation

@jnyfah

@jnyfah jnyfah commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Implements Scene::AddComponentRaw — type-erased, size/align-validated component addition, backed by a new IComponentStorage::AddRaw virtual and a per-component ComponentMeta::Add factory pointer registered on all 8 built-in components.
  • Implements the "Add Component" popup in InspectorPanel — a button in the actor header opens a popup listing every registered component type not already on the selected actor, driven entirely by ComponentReflectionRegistry::ForEach; selecting one calls Scene::AddComponentRaw.
  • Adds 8 tests to ComponentReflectionTest.cpp: default-member-initializer semantics (not memset-zero — a zeroed Scale would make actors invisible), duplicate-add no-ops, dead-entity/unknown-type guards, sentinel-field preservation, and size/align validation.

Test plan

  • ZEngineTests builds and passes via ctest, including the 8 new ReflectionSceneFixture cases
  • Full suite: 562/562 passing, no regressions
  • Manually verified in Obelisk: selecting an actor, clicking "+ Add", picking an unowned component immediately shows it in the panel

Closes #704
Closes #706

@jnyfah
jnyfah marked this pull request as ready for review September 5, 2026 22:02
Move "+ Add Component" from below the component list into the actor
header next to the name field, matching the reference layout. The
relocated button sits flush against the panel's right edge, which
exposed a real bug: ZUIOpenPopup defaults to opening at the click
position with no edge clamping, so the popup's component list was
clipped off the window's right edge. Anchor it leftward from the
button's own screen position instead, same pattern ZUIBeginCombo
already uses for its dropdown.
@JeanPhilippeKernel JeanPhilippeKernel changed the title feat(ecs): Add Component button in inspector feat(ecs): Scene::AddComponentRaw + InspectorPanel Add Component popup Sep 6, 2026
@JeanPhilippeKernel JeanPhilippeKernel added enhancement New feature or request Feature request New feature area-linux Work on Linux system area-window Work on Window system area-ui area-macOS Work on macOS system labels Sep 6, 2026
@JeanPhilippeKernel JeanPhilippeKernel moved this to In Progress in ZEngine Board Sep 6, 2026
@JeanPhilippeKernel
JeanPhilippeKernel merged commit 18d1512 into JeanPhilippeKernel:develop Sep 6, 2026
17 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in ZEngine Board Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-linux Work on Linux system area-macOS Work on macOS system area-ui area-window Work on Window system enhancement New feature or request Feature request New feature

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ECS: implement Scene::AddComponentRaw Tetragrama: Add Component popup in InspectorPanel using ComponentReflectionRegistry

2 participants