Skip to content

fix(editor): load authored objects in the public embed - #1299

Open
AleeAbdullah wants to merge 1 commit into
pascalorg:mainfrom
AleeAbdullah:fix/embed-authored-objects
Open

AleeAbdullah wants to merge 1 commit into
pascalorg:mainfrom
AleeAbdullah:fix/embed-authored-objects

Conversation

@AleeAbdullah

@AleeAbdullah AleeAbdullah commented Nov 20, 2026 •

Copy link
Copy Markdown

What does this PR do?

Fixes #1298. The public link /embed/<id> drew every authored object as an empty placeholder box. EmbedViewer never configured an artifact store, so artifact:// references resolved against core's empty in-memory default, and the page never requested /api/artifacts/*.

EmbedViewer now calls useLocalArtifactStore(), as SceneLoader does in the editor. No server change is needed: the artifacts route already lets an unauthenticated GET through for an artifact referenced by a shared scene (isArtifactShared). An artifact that isn't shared still returns 401.

How to test

  1. Create a project with a few authored objects (add_object) and turn on Share.
  2. Open /embed/<id>. Before this change the objects are red placeholder boxes; with it they render as they do in the editor.

Verified locally on main + this commit:

  • bun dev: the embed went from placeholder boxes to the rendered objects (screenshots below).
  • Production build (next build + next start) with PASCAL_ADMIN_PASSWORD set, in a browser that never signed in: the embed renders the objects, and every /api/artifacts/* request returns 200. Without a session, a shared artifact returns 200, while an unknown hash and /api/scenes return 401.
  • apps/editor check-types and Biome pass.

Unrelated, seen while testing: with PASCAL_ADMIN_PASSWORD set under bun dev, /embed/<id> reloads itself in a loop, with or without this change. The production build doesn't. There is also an existing hydration warning on the sky control's clock (11:45 vs 11:45 AM).

Screenshots / screen recording

Screenshots added below.

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): none needed
  • This PR targets the main branch

🤖 Generated with Claude Code


Note

Low Risk
Single hook addition aligning embed with existing editor artifact loading; no auth or API behavior changes.

Overview
Fixes public /embed/<id> views showing red placeholder boxes for authored objects instead of real geometry.

EmbedViewer now calls useLocalArtifactStore(), matching the editor’s SceneLoader, so artifact:// references resolve via /api/artifacts/* (including unauthenticated access for artifacts tied to a shared scene) rather than core’s default empty in-memory store.

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

The embed page never configured an artifact store, so every
artifact:// reference resolved against core's empty in-memory default
and authored objects drew as placeholder boxes. Use the same local
store the editor uses; the artifacts route already serves a shared
scene's artifacts without a sign-in.

Fixes pascalorg#1298

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 09:19

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@AleeAbdullah

Copy link
Copy Markdown
Author

Screenshots, same shared project on bun dev. Before this change, /embed/<id> draws every authored object as a placeholder box:

embed-before

With it, the embed draws them as the editor does:

embed-after

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @AleeAbdullah, nice catch and a clean diagnosis in #1298. EmbedViewer was the only scene entry point without useLocalArtifactStore(), so artifact:// refs fell through to core's empty in-memory store. I checked the server side too: GET /api/artifacts/[sha256] lets an unauthenticated request through only when isArtifactShared(sha256) is true, and proxy.ts already treats /api/artifacts as self-guarded. So the embed can load shared artifacts without opening up private ones. The before/after screenshots make the fix obvious.

LGTM. CI for this fork is waiting on maintainer approval to run; it can merge once that's green.

This branch has not been deployed

No deployments
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.

Public embed (/embed/<id>) draws authored objects as empty placeholder boxes

3 participants