Repository navigation
editor: preview and place voxel shapes on a sized work plane - #4896
Conversation
4782164 to
d2be09c
Compare
|
Rebased onto the rewritten parent: the stack below was replayed onto master after #4882 merged, so this layer's owned commits ( |
d2be09c to
dc44c41
Compare
dc44c41 to
358f753
Compare
|
Holding review: upstream PR #4895 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label. |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: preview and place voxel shapes on a sized work plane
Verdict: approve
Stacked on #4895 (cross-author). Reviewing the child diff only — upstream is approved separately; approval assumes #4895 lands first. Merged-parent gate: the parent is open, so it does not apply. Review head 358f753e. mergeable=MERGEABLE, mergeStateStatus=CLEAN. Every check on the head is green, including linux-build, format-check, header-checks, instruction-size, comment-refs, no-plan-files and fleet-tests.
Scope is creations/editors/voxel_editor/** plus one docs/design/editor-validation.md line pair. It touches no engine/ code, no shaders and no CMake, so there is no render, ECS-core or serialization surface, and no cross-host smoke tagging applies. The nearest CLAUDE.md (creations/editors/voxel_editor/CLAUDE.md) was updated in the same diff to match the new Stamp/Drag, New Grid Size and Shift-line behaviour. The body has no Closes #N, so there is no acceptance grading.
I did not build or run the editor. The macOS native results in the PR body (shapes 22/22, region tools 35/35 and so on) are the author's and I did not reproduce them. They match what the diff asserts: evaluateShapeGestureCheck pins lower corner, size, phase, undo state and part colour per shot.
What I checked
- Placement state machine (
shape_placement.hpp,updateShapePlacement). Phases HOVER → FOOTPRINT → HEIGHT are consistent. The*draft.proposal()dereferences incommitare guarded on every path: hover sets the proposal beforepress,beginFootprintsets it, and the HEIGHT phase only follows a footprint. Cancel paths (blocked UI, camera gesture, tool switch, Escape, leaving the plane) all reset to HOVER. - Vertical-line sign convention.
verticalVoxelDragDeltais positive when the pointer moves toward lower z.sizeHeight(1 - zDelta) and the lineendPos->zclamp to[origin.z, origin.z + size.z - 1]agree with it, and with thelower_.z = anchor.z - size.z + 1growth direction. - Capacity check.
checkEditorPartCapacitywidens tosize_tbefore multiplying and guards theunsignednarrowing. It now backs bothspawnEditorShapeandaddEditorVoxelPart, so the Create Part button gets the same pre-mutation rejection as shapes. - Interactive 32×32×16 default is gated off for
--gui-session,--module-session,--reference-scene,--profile-framesand--auto-screenshot. Scripted fixtures keep the 16³ scene.replaceWithSingleDocumentnow also updatesg_editableSceneOriginwith the size, which fixes a stale-origin case on Open/New. - Removed slider symbols. A tree-wide
git grepforpartSizeSliderGeometry,kPartSizeSlider*,g_partSizeSliders,partSizeFromSlider,kSculptButtonSize,kSculptButtonStrideandSculptToolbarButton::slot_finds no remaining references. The two.slot_hits intest/render/gpu_readback_ring_test.cppare an unrelated type. - Naming and headers.
IntegerStepperandShapePlacementusem_on private members and no trailing_. Include guards follow theNAME_Hform. The new headers carry no namespace-scope mutable state. - Tests. The new pure-logic surfaces (
ShapePlacement,IntegerStepper, vertical Shift-line) are exercised by theshapes_workflow(13 new gesture shots) andregion_tools(10 new vertical shots) native sessions, each with a registered predicate. That is the editor's established executor for gesture logic. The PR body honestly discloses six pre-existing registry failures outside this PR's cases. - Allocation.
ShapePlacement::appendrebuilds the cell mask and merged face runs only when shape or size changes, and the contour only when yaw changes. Cursor motion just translates cached local faces.rebuildis O(size³) per size change, at most 64³ during a drag, which is fine for an editor-only path.
No blockers and no needs-fix.
Nits (follow-up)
main.cpp:10235(Escape command): with the Shapes panel visible, Escape returns beforecancelPartEdits(). A transform or LOD gesture in progress while the panel is open would close the panel instead of cancelling. I could not trace a reachable path that does this today, so treat it as a question rather than a defect. Consider runningcancelPartEdits()first, or documenting that Shapes owns Escape.shapes_workflow.hpp:236and:239(widget({526, 15}),widget({407, 229})): raw File-menu and prompt pixel coordinates. Every other click in these recipes derives from a layout constant. Naming them next to the menu geometry would make a layout shift fail loudly.shapes_workflow.hpp:181andmain.cpp:5945(stampLower,{2, 2, 17}): the STAMP_HOVER expectations rely on the previous shape's 1×2×17 size carried over from earlier shots. That is order-coupled and fragile if shots are reordered. A comment at thestampLowerlambda naming the carry-over would help.main.cpp:8554: the Line status text no longer distinguishesERASE LINEfromADD LINE. If that distinction was useful in Erase mode, restore it.
Praise
- Building the preview mesh in part-local coordinates and caching the contour by yaw keeps the hover preview cheap.
IntegerStepperreplaces the slider-based PART SIZE controls and the Shapes number fields with one reusable widget group, and the session builder'ssetPartSizedrives the same fields the Create Part button reads.
Test plan the author should run before merge
- Re-run
shapes_workflowandregion_toolson the final stack order after #4895 lands.
Escalation: none. Safe for merge.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Opus recheck not required.
The evidence directories now live at media commit 877cd27; master keeps no committed PR screenshots. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
358f753 to
7ba9d35
Compare
Summary
Original implementation validation
Native captures
Stack validation — 2026-11-06
Replayed the owned editor commits onto merged master
f7b1dbfa2, preserving the four-PR chain. Range-diff inspection found no lost runtime hunks. Moved detailed validation/session contracts intodocs/design/editor-validation.mdto fix instruction-size CI. Corrected the newly inherited document-transition fixture's stale File/Discard click centers and made composite Save As repeatable.Validated the combined stack at
683a6017c8a7be6964c5872282cba5d982c839a3on macOS/Metal:Follow-up integration — 2026-11-07
The two parked follow-ups are reconciled in dependency order: #4903 → #4908 → #4918. #4908 maps Actions to the current tools and integer fields, isolates modal input, and keeps remapped badges synchronized. #4918 preserves the Shapes/dock UI gate and diagnoses replay clicks swallowed by UI.
Current evidence: 273 focused unit tests pass. The combined native registry covers 75 cases and 1,524 assertions; all 73 pre-existing case verdicts and failure sets are unchanged, and both new click-occlusion controls behave as expected. Six baseline failures remain: fill_ghost, click_orbit, mode_preview, component_field_key (layout findings), text_input_command_capture, and test_recipe_reapply. These are disclosed with exact results in #4918; this is not an all-green editor suite. Per-case comparison. The overlap gate is
overlapwith clean trial merges and no blockers. This PR is ready for review in stack order; no merge or fleet approval is claimed.Overlap gate
fleet-pr-overlap --self-pr 4896: VERDICT: overlap (exit 1). All shared-path trial merges are clean; no blocking or base-conflict rows.Upstream rows: #4893 (5 paths), #4895 (7 paths).
#4903, #4908, #4918: identical clean grades on 12 shared paths
The gate reports the following rows for #4903; the same paths are graded
cleanfor #4908, #4918.