Skip to content

fix(editor): outline polygon edit handles, fix vertex grab + console error#365

Merged
Aymericr merged 1 commit into
mainfrom
fix/polygon-editor-handles
Jun 3, 2026
Merged

fix(editor): outline polygon edit handles, fix vertex grab + console error#365
Aymericr merged 1 commit into
mainfrom
fix/polygon-editor-handles

Conversation

@Aymericr

@Aymericr Aymericr commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Three bundled fixes to the shared PolygonEditor (slab/ceiling boundary and hole editing) in packages/editor/src/components/tools/shared/polygon-editor.tsx.

  1. Console error — committing a vertex drag triggered "Cannot update a component (NodeArrowHandles) while rendering a different component (PolygonEditor)". The cross-store onPolygonPreview(null) write is now deferred into a useEffect (local setState stays in render), so no other component is updated during render.
  2. Vertex grab regression — the edge bar overlapped the vertex/midpoint handles and stole their clicks, so you could only move edges. The bar is now visual-only (raycast disabled); edge dragging runs through the chevron arrow that sits outside the polygon edge.
  3. Outlines — each handle is now a single SCENE_LAYER mesh with a node material (MeshBasicNodeMaterial / useArrowMaterial) and pointer handlers attached directly, matching the registry arrow gizmos in node-arrow-handles.tsx. This puts the handles in the ink-edge post-pass so vertex/midpoint cylinders, chevron arrows, and the move sphere read as outlined 3D plates — while staying grabbable (the R3F event raycaster picks SCENE_LAYER too, so no paired hit mesh is needed).

Verification

  • cd packages/editor && bunx tsc --noEmit — clean
  • bunx biome check on the file — clean
  • Adversarial review (6/6 substantive checks): grabbing preserved, outlines render, no plain material on SCENE_LAYER (so no WebGPU "Vertex buffer slot 1" error), console-fix intact, edge bar non-interactive, per-instance material/geometry lifecycle correct.
  • Out of CI scope: mcp-ci.yml only covers packages/mcp + apps/editor/lib scene files; this change touches neither.

Known follow-up (tracked, out of scope)

SCENE_LAYER handles can appear in user-driven capture-mode snapshots — a pre-existing property of the existing arrow gizmos that this change extends to polygon handles (outlines require SCENE_LAYER). To be hidden uniformly later via the existing thumbnail:before-capture visibility toggle.

🤖 Generated with Claude Code

…error

Bundles three fixes to the shared PolygonEditor (slab/ceiling boundary &
hole editing):

- Console error: defer the cross-store onPolygonPreview(null) write into a
  useEffect so committing a drag no longer updates another component
  (NodeArrowHandles) during PolygonEditor's render.
- Vertex grab: make the edge bar visual-only (raycast disabled) so it can
  no longer steal clicks from the vertex/midpoint handles overlapping it;
  edge dragging runs through the chevron arrow outside the polygon edge.
- Outlines: render each handle as a single SCENE_LAYER mesh with a node
  material (MeshBasicNodeMaterial / useArrowMaterial) and pointer handlers
  attached directly, matching the registry arrow gizmos. This puts the
  handles in the ink-edge post-pass so vertex/midpoint cylinders, the
  chevron arrows, and the move sphere read as outlined 3D plates while
  staying grabbable. No paired hit mesh needed — the R3F event raycaster
  picks SCENE_LAYER too.

Known follow-up (tracked, out of scope): SCENE_LAYER handles can appear in
user-driven capture-mode snapshots, same as the existing arrow gizmos; to
be hidden uniformly later via the thumbnail:before-capture toggle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 3, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
pascal 🔴 Failed Jun 3, 2026, 3:58 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@Aymericr Aymericr merged commit e741ba6 into main Jun 3, 2026
1 check failed
@Aymericr Aymericr deleted the fix/polygon-editor-handles branch June 3, 2026 03:59
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.

1 participant