Repository navigation
Conversation
…facing) - fix: node id prefixes split at the wrong underscore, breaking plugin duplicate - fix: surface upload failures, survive insecure contexts, stop mid-drag GPU disposal
SummaryThree stability fixes in the editor package, all in
One thing worth knowing while you read: the PR description lists an Best place to start is |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FX8vGAP5g43AHR1jixUeXr
…odes
generateId builds ids as `${prefix}_${suffix}` with a suffix drawn from
0-9a-z, but the three copies of extractIdPrefix (core registry/subtree,
core utils/clone-scene-graph, editor scene-clipboard) split at the FIRST
underscore. Built-in prefixes have none, so only plugin kinds noticed: a
duplicate of `pallet_rack_<suffix>` came back as `pallet_<suffix>`, which
the kind's own id template rejects.
Replace the copies with one nodeIdPrefix next to generateId that splits at
the last underscore. Tests cover the helper, cloneNodesInto,
cloneSceneGraph / cloneLevelSubtree and the editor's fresh-subtree
duplicate of a registered plugin kind; all of them fail on the old split.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FX8vGAP5g43AHR1jixUeXr
Both guide-image upload paths formatted the same "Could not add that guide image: <reason>" message and logged the error; move that into guideImageErrorMessage next to createLocalGuideImage. This also drops the stale secure-context comment: upstream asset ids already come from nanoid, so that TypeError no longer exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FX8vGAP5g43AHR1jixUeXr
The underscore split only matters for third-party plugin kinds whose id prefix contains an underscore; Pascal's own nodes never do, so it does not belong in an upstream stability fix. This reverts commit dc98059. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FX8vGAP5g43AHR1jixUeXr
fix(editor): stop mid-drag GPU disposal in the drag box and surface guide-image errors
Description
What does this PR do?
Two stability fixes in the editor:
DragBoundingBoxno longer creates and disposes GPU resources every frame. It previously rebuilt itsBoxGeometry/PlaneGeometryon every size change and disposed the old ones in an effect cleanup. During a resize drag that happens once per frame, and WebGPU can still be executing a command buffer that references the destroyed buffers, so it drops the whole frame ("Vertex buffer slot … was not set"). The box now uses module-level unit geometry scaled through the mesh transform, plus materials cached by colour.catch {}. They now log the error and showCould not add that guide image: <reason>, built by one sharedguideImageErrorMessagehelper inlib/local-guide-image.ts.The earlier description also mentioned a plugin duplicate-id change and an insecure-context (
crypto.randomUUID) fix. Both are out of this PR: the first only affects third-party plugin kinds, and upstream asset ids already come from nanoid.The branch is merged with the current
main.How to test
bun test packages/editor/src/lib/local-guide-image.test.ts.bun devon a WebGPU browser: resize-drag an item or a cabinet with the bounding box showing. No frames blank out, and the box follows the size live.Screenshots / screen recording
Checklist
bun devbun checkto verify)mainbranchReplies to bot review threads
dispose={null}): Checked against the versions in use; it does not occur. In @react-three/fiber 9.6.1, unmounting callsdispose()on the removed object only, and three 0.186'sObject3D.dispose()only fires itsdisposeevent, which lets the WebGPU renderer drop the per-object RenderObject. The sharedUNIT_EDGES/UNIT_PLANEgeometry and the cached materials are never disposed.dispose={null}would also skip that per-object cleanup, so it is left out.guideImageErrorMessageinlib/local-guide-image.ts, with a test.