[fix] local-objects share reaches peers + list reactivity + role dropdown color - #52
Merged
Merged
Conversation
…down color
- Share now actually copies objects to peers: dropped the uuids array from the
{type:object} send. A non-null uuids routed createObject into the GLTF-loader
branch, which rejected a THREE toJSON payload, so the object never landed. Every
proven single-object send (prefabs/autosave/drawMode/environment/Inspector) omits
uuids and hits the ObjectLoader branch; shareLocal + shareAll now match.
- Objects.svelte re-derives children + the __localOnly badge from an objectsGroup
poke (THREE trees aren't reactive) so the local mark clears after Share, group
children appear as they are added, and the show-local toggle stops duplicating rows.
- Role menu items render colored role-badge pills (editor blue / admin violet) to
match the trigger pill instead of a plain dot + label.
- Drag a local object onto the Local-objects background to un-nest it to the top
level (moveObjectToGroup root) rather than only into groups.
- Docs: CLAUDE.md + peer-feature skill cover objectPermissions, cloudApi v2.2,
Connect drawer, role UI, the CRLF/tabs + THREE-not-reactive traps.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…der role pills
- Dragging a local object into the shared object list now REPLICATES it, not just
reparents it. moveObjectToGroup sends a `group` message keyed by a uuid peers never
received, so it was a silent no-op on their side; nesting merely hid the object from
the top-level "Local objects" filter, so it looked shared but never left the machine.
- New shareObject(obj, groupUuid?) in objectPermissions: re-parents into the target
group (so toJSON carries the group-local transform), clears __localOnly, broadcasts
{type:object}, pokes the list. Wired into all three drop targets:
- a new full-width drop zone over the shared list body (Svelte action, so no
on:-directive / a11y warnings) -> share to scene root;
- the list header drop-to-root -> shares local objects instead of a dead reparent;
- dropping onto a shared group row -> shares into that group.
Dropping within the Local-objects section still keeps the object local.
- shareLocal / shareAll now route through shareObject too.
- Role pill: fully-rounded, 600-weight, padded chip with a button shadow on the admin
trigger + a clearer caret, and a distinct slate viewer color, so every role reads as
a colored pill rather than a plain dropdown.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… on share Sharing a Stairs primitive arrived rotated ~90 deg on peers. Root cause: the custom builders apply post-construction geometry.rotateY/rotateX/translate to a PARAMETRIC ExtrudeGeometry / PlaneGeometry. Those subclasses' toJSON() serialize only the shape + options, so ObjectLoader.parse on the receiver rebuilds a fresh geometry WITHOUT the baked transforms -- Stairs/Corner/Terrain lose their rotate, Wedge/Arch lose their translate. Verified: parsed bbox [0,0,0..2,1.5,2] vs original [-1,0,-1..1,1.5,1]. Fix: bake custom-builder output into a plain BufferGeometry (copy) at creation, so its toJSON carries the real vertices. Standard primitives stay parametric (they round-trip fine -- no post-construction transforms). The deterministic /create path is unchanged; this only affected the toJSON share/serialize path. Covers SDK-registered builders too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up fixes to the viewer object-permissions batch (#51), from the user's testing.
Fixes
shareLocal/shareAllsent{type:'object', element: toJSON(), uuids:[uuid]}. A non-nulluuidsroutes the receiver'screateObjectinto the GLTFLoader branch, which rejects a THREEtoJSON()payload — so the shared object silently never landed on peers. Every proven single-object send (prefabs, autosave, drawMode, environment, Inspector) omitsuuidsand hits the ObjectLoader branch; both share paths now match.Objects.sveltenow re-deriveskidsand the__localOnlybadge (isLocal) from anobjectsGrouppoke via$derived.by. Fixes: the "Local only" mark persisting after Share, group children not appearing as more are added, and the show-local toggle duplicating rows.role-badgepills (editor blue / admin violet) matching the trigger pill, replacing the plain dot + label.moveObjectToGroup(uuid, 'root')) instead of only allowing drops into groups.Verification
npm run buildgreen;npx svelte-check485 errors / 72 warnings (baseline held, 0 new).🤖 Generated with Claude Code