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
Aymericr
left a comment
There was a problem hiding this comment.
Thanks @ovurrsl, and sorry this waited so long for a maintainer.
This looks good to me:
- Unit geometry scaled through the mesh transform plus colour-keyed cached materials is the right fix for the mid-drag WebGPU dispose. Your reply to Bugbot about R3F 9 only disposing the removed object (not shared geometry/materials) matches how we use these elsewhere, so no
dispose={null}needed. guideImageErrorMessageis a nice small helper, and keeping the generic fallback for empty/non-Error throws is right. Test covers it.- Good call trimming the plugin-id and
randomUUIDchanges out and updating the title/description.
One small ask, not blocking: if you can grab a short clip of a resize drag on a WebGPU browser (before flashing / after steady), please drop it in the description.
CI for fork PRs needs a maintainer to approve the workflow run; once that's green I'll merge.
Drop changes that are not part of slanted walls: tilted columns and the i-beam section (pascalorg#1005), the drag bounding box and guide-image error work (pascalorg#1003), and a .gitignore that had been re-encoded. WallNode.tilt becomes optional, so walls built in code no longer have to spell out tilt: 0. 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.