Skip to content

nodes: improve block mesh editing UX - #691

Open
sudhir9297 wants to merge 49 commits into
pascalorg:mainfrom
sudhir9297:t3code/improve-block-node-ux
Open

nodes: improve block mesh editing UX#691
sudhir9297 wants to merge 49 commits into
pascalorg:mainfrom
sudhir9297:t3code/improve-block-node-ux

Conversation

@sudhir9297

@sudhir9297 sudhir9297 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Adds Blender-style block mesh editing with modal move, rotate, and scale; axis and plane constraints; numeric input; precision and snapping feedback; live values; X-Ray selection; and adjustable/repeatable operations.
  • Generalizes topology operations across multi-component selections, simplifies face material slots with automatic assignment and accent materials, and fixes item detachment from block faces.
  • Isolates block edit-mode scene/history services and extracts focused modal and face-operation controllers, with updated architecture documentation and tests.

How to test

  1. Run bun dev, add and select a Block, then press Tab to enter mesh edit mode.
  2. Select vertices, edges, or faces and verify G, R, and S; constrain with X/Y/Z or Shift+axis, enter numeric values, hold Shift for precision, and confirm/cancel with click, Enter, Escape, or right-click.
  3. Verify multi-component extrude, inset, bevel, loop cut, merge, dissolve, transform, and delete operations; use F9 to adjust the last operation and Shift+R to repeat it.
  4. Select one or more faces, add a material slot, and confirm the faces are assigned immediately with a visible accent material; clicking another slot should reassign the selection.
  5. Move a wall/ceiling/floor item from a block face and confirm it detaches cleanly when leaving the host surface.
  6. Run bun run check, bun run lint, bun run check-types, and bun run build; all should pass.

Screenshots / screen recording

Recording to be added — this PR changes visual and interactive block-editing behavior.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

High Risk
Rewrites core block topology commands, undo/history replacement, and mesh-edit keyboard ownership. Bugs here can corrupt meshes or scene history.

Overview
Adds Blender-style block mesh editing: modal move/rotate/scale with axis and plane locks, typed values, geometry snap, and live status. Topology commands now operate on multi-component selections (extrude-faces, inset-faces, bevel-edges, dissolve-edges/dissolve-faces), including connected-region extrude and optional global extrude axes.

Last operations can be adjusted in place (one undo step) or repeated on the current selection via injected scene/history services on selection affordances. Material slots no longer use a reusable-material picker; adding a slot assigns selected faces immediately with an accent material, and clicking a slot reassigns the selection.

Also detaches wall/ceiling items when they leave a block face, reserves R/T for the mesh editor, and cycles snapping on a clean Shift tap so Shift can still mean precision during modal ops.

Reviewed by Cursor Bugbot for commit 126835b. Bugbot is set up for automated code reviews on this repo. Configure here.

sudhir9297 and others added 30 commits May 19, 2026 02:59
Items (e.g. solar panels) can now be placed on sloped roof surfaces.
The placement system computes euler rotation from the roof surface
normal so items sit flush on the slope instead of going inside.

- Add roofStrategy to placement-strategies with enter/move/click/leave
- Wire roof:enter/move/click/leave events in the placement coordinator
- Add calculateRoofRotation in placement-math using surface normals
- Support full 3D cursor rotation for sloped surfaces
- Items on roofs are parented to the level with world-space rotation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread packages/nodes/src/block/selection.tsx Outdated
Comment thread packages/nodes/src/block/geometry-snap.ts
Comment thread packages/nodes/src/block/selection.tsx
Comment thread packages/nodes/src/block/selection.tsx
Comment thread packages/nodes/src/block/use-block-face-operation.ts
Comment thread packages/nodes/src/block/selection.tsx
Comment thread packages/nodes/src/block/selection.tsx
Comment thread packages/nodes/src/block/selection.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 126835b. Configure here.

return !best || score < best.score ? { edge, score } : best
}, null)?.edge
if (!remappedEdge) return { ok: false, error: `Could not remap bevel edge: ${edgeId}` }
const result = bevelOneEdge(current, remappedEdge.id, command)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bevel remap lacks distance limit

Medium Severity

When beveling multiple edges, if an edge id is gone after an earlier bevel, remapping picks the globally closest remaining edge by endpoint distance with no maximum score. A poor match can bevel an unrelated edge and still produce a topology that passes validation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 126835b. Configure here.

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