Skip to content

editor: light WebGPU preview and /editor scene redirect - #570

Open
ActArtech wants to merge 4 commits into
pascalorg:mainfrom
ActArtech:feat/editor-light-preview
Open

editor: light WebGPU preview and /editor scene redirect#570
ActArtech wants to merge 4 commits into
pascalorg:mainfrom
ActArtech:feat/editor-light-preview

Conversation

@ActArtech

@ActArtech ActArtech commented Aug 2, 2026

Copy link
Copy Markdown

What does this PR do?

Improves the standalone apps/editor local/MCP preview experience:

  1. Route compatibility — redirect /editor/:id to /scene/:id so MCP editorUrl links open saved scenes instead of 404.
  2. Light preview — scene list opens with ?disable=postFx,outline (existing viewer flags) and forces solid shading when that path is active; scene page exposes a Light preview control.
  3. Clearer home banner — home is a blank canvas; saved scenes live under Scenes (wording fix only).

No viewer package API changes; uses existing post-processing disable query flags.

How to test

  1. bun run --cwd apps/editor dev (or project equivalent) on port 3002 with a local scene store.
  2. Open /editor/<existing-scene-id> — expect redirect to /scene/<id> and the scene loads.
  3. Open /scenes — each card links with light-preview query; canvas should stay responsive (post-FX off).
  4. On a scene page, click Light preview — URL gains disable flags; shading goes solid.
  5. Home / still shows blank editor with link to saved scenes.

Screenshots / screen recording

N/A for core logic (routing + existing viewer flags). Optional: short clip of /editor/id redirect if desired.

Checklist

  • I've tested this locally with the editor dev server
  • My code follows the existing code style
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

Low Risk
Scoped to standalone editor routing, preview UX, and an optional Editor prop defaulting to false; no auth or persistence logic changes.

Overview
Adds a light preview path for local WebGPU stability and fixes MCP link routing for the standalone apps/editor app.

Routing: next.config redirects /editor/:id/scene/:id so MCP editorUrl bookmarks open saved scenes instead of 404.

Light preview: Scene list links include ?disable=postFx,outline. On the scene page, URL query (or safe=1) drives disablePostFx on Editor, solid vs rendered shading via the viewer store, plus a Light preview toolbar button that can re-apply settings or navigate with LIGHT_PREVIEW_QUERY.

Editor package: New optional disablePostFx on Editor / ViewerCanvas, forwarded to Viewer (same effect as ?disable=postFx).

Copy/UI: Home banner clarifies blank canvas vs saved scenes under Scenes; banner layout wraps on small viewports.

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

Redirect MCP-style /editor/:id URLs to /scene/:id, open scenes with a
lighter post-FX path for stable local WebGPU, and clarify the home
blank-canvas banner vs the saved scenes list.
Comment thread apps/editor/components/scene-loader.tsx Outdated
SceneLoader stayed mounted on same-route Light preview navigation, so
shading never updated. Depend on useSearchParams so solid mode applies.
Comment thread apps/editor/components/scene-loader.tsx Outdated
@ActArtech

Copy link
Copy Markdown
Author

Addressed Bugbot finding L5 in the follow-up commit:

  • L5 - light preview now re-applies solid shading when search params change (useSearchParams dependency), so client navigation to ?disable=postFx on the same scene updates correctly.

Same pitfall is noted as L5 in packages/mcp/docs/layout-clearance-error-log.md (layout clearance PR) for future editor/MCP work.

When ?disable=postFx is removed, set shading back to rendered so the
viewer is not stuck on the solid/light path after client navigation.
@ActArtech

Copy link
Copy Markdown
Author

Addressed the latest Bugbot finding (N3 / L8):

  • When light-preview query flags are cleared, shading restores to rendered so the viewer is not stuck on the solid/light path after client navigation.

Previously we only set solid when flags were present.

Comment thread apps/editor/components/scene-loader.tsx Outdated
Comment thread apps/editor/components/scene-loader.tsx
Pass disablePostFx from SceneLoader into Viewer so post-FX is actually
skipped (not only solid shading). Light preview button re-applies solid
shading even when the query is already active.
@ActArtech

Copy link
Copy Markdown
Author

Addressed the latest Bugbot findings on light preview:

  • High - disablePostFx is now threaded SceneLoader → Editor → Viewer, so light preview actually disposes/skips the post-FX pipeline (not only setShading('solid'), which is a no-op when already solid).
  • Medium - Light preview is a button that always re-applies solid shading (lightApplyTick), even when the query is already ?disable=postFx,outline after the user changed toolbar shading.

Query flags still toggle disablePostFx; clearing them restores rendered + post-FX.

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 003ac55. Configure here.


const viewerCanvas = (
<ViewerCanvas
disablePostFx={disablePostFx}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Preview mode ignores disablePostFx

High Severity

This PR passes disablePostFx into the main editor Viewer, but preview mode renders a second Viewer in previewViewerContent without that prop. On a light-preview scene, opening toolbar Preview turns post-FX back on and can reintroduce the WebGPU instability light preview was meant to avoid.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 003ac55. Configure here.

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.

2 participants