Skip to content

editor: preview and place voxel shapes on a sized work plane - #4896

Merged
jakildev merged 2 commits into
codex/editor-review-followupsfrom
codex/editor-shape-placement
Nov 10, 2026
Merged

jakildev merged 2 commits into
codex/editor-review-followupsfrom
codex/editor-shape-placement

Conversation

@jakildev

@jakildev jakildev commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Sculpt places Color Picker beside Shapes. Shapes groups Box/Cube, Sphere, Cone, Cylinder and Pyramid with Stamp and Drag modes, plus box fill in the selected part.
  • Stamp previews the complete voxel surface and visible outline on the document plane. Above Floor raises the base in whole voxels. Each click creates an editable part and supports Undo. Drag sets a rectangular base or radial footprint, then uses pointer height to preview the finished solid before committing.
  • Shift-drag with Line selected locks the starting column and derives voxel height from the current projection. Ordinary blank documents start at 32×32×16 and frame their floor. New Grid Size uses whole-number fields and step buttons for empty parts and new documents.

Original implementation validation

  • Built the macOS editor and passed 133 editor and Lua-session unit tests.
  • Native Shapes passed 22/22. Covered repeated elevated stamps at 30°, dimensioned primitives, a two-stage drag and cancellation at 67°, plus New Grid Size, Create Part and New with the discard prompt.
  • Native region tools passed 35/35, including a five-cell vertical line at both angles, preview, commit, Undo and Escape. Reviewed the rendered contour in the Metal captures.
  • Native part sizes (12), documents (25), material tools (12), sculpt (46) and camera gestures (44) passed with zero layout findings.
  • Checked header conventions, comment references, formatting and whitespace. Launched the installed Debug executable on the normal startup path and observed 32×32×16.

Native captures

Elevated stamp Dragged height Vertical line
Stamp Drag Vertical line

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 into docs/design/editor-validation.md to 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 683a6017c8a7be6964c5872282cba5d982c839a3 on macOS/Metal:

  • IRVoxelEditor and IrredenEngineTest builds pass.
  • 273 focused editor, camera, input, command, keymap and Lua tests pass.
  • 265 native assertions pass across viewport_scroll (15), material_tools (12), shapes_workflow (22), region_tools (35), workspace_controls (19), workspace_restore (2), camera_gestures (44), screen_alignment (70), document_workflow (28), motion_preview (11), and test_dock_rails (7); zero layout findings and clean shutdowns.
  • Independent PNG alignment grading passes all seven poses, including 30 and 67 degrees: no preview leakage through solids, no grid over solid interiors, exact floor-to-cell silhouettes. Its 18 unit controls pass.
  • Header conventions, instruction-size, comment references, changed fixture formatting and whitespace pass.

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 overlap with 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 clean for #4908, #4918.

#4903 creations/editors/voxel_editor/CLAUDE.md clean
#4903 creations/editors/voxel_editor/integer_stepper.hpp clean
#4903 creations/editors/voxel_editor/main.cpp clean
#4903 creations/editors/voxel_editor/part_size_panel.hpp clean
#4903 creations/editors/voxel_editor/region_tools.hpp clean
#4903 creations/editors/voxel_editor/sculpt_panel.hpp clean
#4903 creations/editors/voxel_editor/session_builder.hpp clean
#4903 creations/editors/voxel_editor/sessions.hpp clean
#4903 creations/editors/voxel_editor/shape_placement.hpp clean
#4903 creations/editors/voxel_editor/shapes_panel.hpp clean
#4903 creations/editors/voxel_editor/shapes_workflow.hpp clean
#4903 docs/design/editor-validation.md clean

@jakildev jakildev added fleet:wip Work in progress — not ready for review fleet:author-codex Implementation last authored by Codex; route review to Claude labels Nov 4, 2026
@jakildev
jakildev added this pull request to stack #4870 November 4, 2026 22:55
@jakildev jakildev added fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:author-codex Implementation last authored by Codex; route review to Claude and removed fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:author-claude Implementation last authored by Claude; route review to Codex labels Nov 4, 2026
@jakildev
jakildev force-pushed the codex/editor-shape-placement branch from 4782164 to d2be09c Compare November 6, 2026 07:01
@jakildev

jakildev commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto the rewritten parent: the stack below was replayed onto master after #4882 merged, so this layer's owned commits (editor: preview and place voxel shapes on a sized work plane) were replayed with git rebase --onto <new parent head> <old parent head>; the inherited pre-rework commits are gone and the diff against the parent is the original PR-owned scope. The rebase applied cleanly. Evidence moved off the branch to media commit 877cd2702ff9532b898a1480268ca8e488160413 and the body's image links repointed, so the no-plan-files check passes. The reviewer hold stays until the upstream is approved. — opus-architect

@jakildev
jakildev force-pushed the codex/editor-shape-placement branch from d2be09c to dc44c41 Compare November 6, 2026 17:40
@jakildev
jakildev force-pushed the codex/editor-shape-placement branch from dc44c41 to 358f753 Compare November 6, 2026 17:52
@jakildev jakildev removed the fleet:wip Work in progress — not ready for review label Nov 7, 2026
@jakildev
jakildev marked this pull request as ready for review November 7, 2026 19:05
@jakildev jakildev added the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 8, 2026
@jakildev

jakildev commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Holding review: upstream PR #4895 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label.

@jakildev jakildev removed the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 8, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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 in commit are guarded on every path: hover sets the proposal before press, beginFootprint sets 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. verticalVoxelDragDelta is positive when the pointer moves toward lower z. sizeHeight (1 - zDelta) and the line endPos->z clamp to [origin.z, origin.z + size.z - 1] agree with it, and with the lower_.z = anchor.z - size.z + 1 growth direction.
  • Capacity check. checkEditorPartCapacity widens to size_t before multiplying and guards the unsigned narrowing. It now backs both spawnEditorShape and addEditorVoxelPart, 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-frames and --auto-screenshot. Scripted fixtures keep the 16³ scene. replaceWithSingleDocument now also updates g_editableSceneOrigin with the size, which fixes a stale-origin case on Open/New.
  • Removed slider symbols. A tree-wide git grep for partSizeSliderGeometry, kPartSizeSlider*, g_partSizeSliders, partSizeFromSlider, kSculptButtonSize, kSculptButtonStride and SculptToolbarButton::slot_ finds no remaining references. The two .slot_ hits in test/render/gpu_readback_ring_test.cpp are an unrelated type.
  • Naming and headers. IntegerStepper and ShapePlacement use m_ on private members and no trailing _. Include guards follow the NAME_H form. The new headers carry no namespace-scope mutable state.
  • Tests. The new pure-logic surfaces (ShapePlacement, IntegerStepper, vertical Shift-line) are exercised by the shapes_workflow (13 new gesture shots) and region_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::append rebuilds 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. rebuild is 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 before cancelPartEdits(). 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 running cancelPartEdits() first, or documenting that Shapes owns Escape.
  • shapes_workflow.hpp:236 and :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:181 and main.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 the stampLower lambda naming the carry-over would help.
  • main.cpp:8554: the Line status text no longer distinguishes ERASE LINE from ADD 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.
  • IntegerStepper replaces the slider-based PART SIZE controls and the Shapes number fields with one reusable widget group, and the session builder's setPartSize drives the same fields the Create Part button reads.

Test plan the author should run before merge

  • Re-run shapes_workflow and region_tools on 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.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:reviewing-mac-pool-1 labels Nov 8, 2026
jakildev and others added 2 commits November 9, 2026 21:56
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>
@jakildev
jakildev force-pushed the codex/editor-shape-placement branch from 358f753 to 7ba9d35 Compare November 10, 2026 05:56
@jakildev
jakildev merged commit 3203547 into master Nov 10, 2026
11 checks passed
@evin-mac-claude-app evin-mac-claude-app Bot added the fleet:needs-human Fleet can't complete autonomously; human must act. Keeps human:approved. Clears when human resolves. label Nov 10, 2026
@evin-mac-claude-app

Copy link
Copy Markdown
Contributor

Orphaned from merged PR #4895; the child conflicts while replaying onto master. No branch mutation was made. Repair manually with git rebase --onto origin/master b8a4c94, push, then gh pr edit --base master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:needs-human Fleet can't complete autonomously; human must act. Keeps human:approved. Clears when human resolves.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant