fix(editor): harden editor interactions and WebGPU rendering

Fix editor bug sweep regressions, WebGPU CSG/material crashes, Shift snap bypass behavior, arrow handle drag projection, and the wall preview null guard covered by the Sentry follow-up PRs.
This commit is contained in:
Aymeric Rabot
2026-06-11 13:03:34 -04:00
committed by GitHub
parent 2d2dba5dba
commit aab48e053f
111 changed files with 2211 additions and 955 deletions
+3 -3
View File
@@ -66,7 +66,7 @@ export const shelfFloorplanMoveTarget: FloorplanMoveTarget<ShelfNode> = ({ node,
const gridSnapped = resolveCursor(planPoint, { snap }) as WallPlanPoint
// Figma-style alignment layered on the grid snap — the shelf footprint
// edges snap to neighbours / wall faces and a guide is published. Alt
// bypasses (matches placement tools' "No snap").
// bypasses alignment; Shift bypasses all snap.
const { point: snapped } = applyFloorplanAlignment(
gridSnapped,
movingFootprintAnchors(
@@ -76,7 +76,7 @@ export const shelfFloorplanMoveTarget: FloorplanMoveTarget<ShelfNode> = ({ node,
originalRotationY,
),
candidates,
{ bypass: modifiers.altKey },
{ bypass: modifiers.altKey || modifiers.shiftKey },
)
const next: [number, number, number] = [snapped[0], originalPosition[1], snapped[1]]
lastPosition = next
@@ -85,7 +85,7 @@ export const shelfFloorplanMoveTarget: FloorplanMoveTarget<ShelfNode> = ({ node,
// and the placement coordinators. Item / slab / wall flows fire
// the same cue, so the shelf following along is the expected UX.
const snapKey = `${snapped[0]},${snapped[1]}`
if (snapKey !== lastSnapKey) {
if (!modifiers.shiftKey && snapKey !== lastSnapKey) {
triggerSFX('sfx:grid-snap')
lastSnapKey = snapKey
}
+12 -3
View File
@@ -83,7 +83,8 @@ const ShelfTool = () => {
rawZ: event.localPosition[2],
gridStep: useEditor.getState().gridSnapStep,
candidates: alignmentCandidates,
bypassAlignment: event.nativeEvent?.altKey === true,
bypassAlignment: event.nativeEvent?.altKey === true || event.nativeEvent?.shiftKey === true,
bypassGrid: event.nativeEvent?.shiftKey === true,
})
useAlignmentGuides.getState().set(guides)
@@ -97,7 +98,10 @@ const ShelfTool = () => {
lastCursorRef.current = position
const prev = previousSnapRef.current
if (!prev || prev[0] !== position[0] || prev[1] !== position[2]) {
if (
event.nativeEvent?.shiftKey !== true &&
(!prev || prev[0] !== position[0] || prev[1] !== position[2])
) {
triggerSFX('sfx:grid-snap')
previousSnapRef.current = [position[0], position[2]]
}
@@ -110,7 +114,12 @@ const ShelfTool = () => {
// first). Both paths apply the same grid snap.
const position =
lastCursorRef.current ??
getLevelLocalSnappedPosition(activeLevelId, event, useEditor.getState().gridSnapStep)
getLevelLocalSnappedPosition(
activeLevelId,
event,
useEditor.getState().gridSnapStep,
event.nativeEvent?.shiftKey === true,
)
const shelf = ShelfNode.parse({
...shelfDefinition.defaults(),
name: 'Shelf',