Conversation
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: ff399ff5-d2a5-4414-beaf-9548f766fc0b |
NodeRenderer read the registry at render time without subscribing, so nodes mounted before async plugin discovery stayed invisible and unbuilt. It now subscribes to its own kind's definition only, so a registration re-renders the nodes of that kind and no others. Flips the plugin-dispatch test.failing case recorded in #917 and adds a test that an unrelated kind's registration does not re-render mounted nodes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Aymericr
force-pushed
the
fidelity/a-09-late-plugin-render
branch
from
September 25, 2026 10:23
0332e7b to
c5b69bb
Compare
This branch has not been deployed
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.
What does this PR do?
A host discovers plugins asynchronously, so a scene can mount before its plugin kinds register.
NodeRendererreadnodeRegistry.get(node.type)at render time and never subscribed to the registry. A plugin node mounted before its plugin registered renderednulland kept doing so after registration, until something unrelated re-rendered it. Geometry-only plugin kinds never mounted their group either, soGeometrySystemnever built them.NodeRenderernow subscribes, throughuseSyncExternalStore(onRegistryChange, …), to its own kind's definition only. A registration re-renders the nodes of that kind and leaves every other mounted node alone. There is no API change.Failing case: it is already on main as
test.failinginplugin-dispatch.test.tsx(added by #917): "nodes mounted before their plugin registers render once it registers" (Expected: 1, Received: 0). This PR flips it totest, so the duplicate coverage lives in one place. It also adds "registering an unrelated kind does not re-render mounted plugin nodes".Found by the plugin API v1 conformance work (A-09).
How to test
bun test packages/viewer/src/components/viewer/plugin-dispatch.test.tsx→ 5 passbun run --cwd packages/viewer test→ 370 pass, 0 fail.bun run checkis clean and the viewer typechecks.Local preview
Scene:
/private/tmp/fid/previews/A-09/plugins-installed.json. It has a house, a Spielberg "Shot camera" and three Nature trees, with both plugins installed.Start:
/private/tmp/fid/preview.sh start A-09R /private/tmp/fid/previews/A-09/plugins-installed.json. Worktree/private/tmp/fid/A-09R: the editor pin plus the two #925 commits cherry-picked.What you will notice
before-1.pngandafter-1.pngare identical.Where to look
Try this
packages_plugin-spielberg_src_*chunks for about 15 s, then reload.Before / after (same view, Spielberg chunks held back 15 s by the capture script, screenshot at 45 s)
/private/tmp/fid/previews/A-09R/before-2-late.png. The camera is missing (boxed)./private/tmp/fid/previews/A-09R/after-2-late.png. The camera is back (boxed).before-1.pngandafter-1.png./private/tmp/fid/scratch/A-09/shot-editor.tswithDELAY_PLUGIN_CHUNKS=spielberg.Known limits
NEXT_PUBLIC_PLUGIN_TREES, so the Nature plugin isn't loaded. Only the Spielberg camera is used.R1–R9
Checklist
bun dev(see Local preview)bun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Medium Risk
Touches core viewer render path for every node; behavior change is narrow (late plugin registration) but high visibility if subscriptions or snapshot reads regress.
Overview
Fixes plugin nodes staying invisible when the scene mounts before async plugin discovery registers their kind.
NodeRendererno longer does a one-shotnodeRegistry.getat render time; it subscribes withuseSyncExternalStore(onRegistryChange, …)and reads the definition for that node’s kind only, so custom renderers and geometry-only kinds appear once the plugin loads.Tests promote the former
test.failinglate-registration case to a passing test, add render-count instrumentation, and assert that registering an unrelated kind does not re-run already-mounted plugin renderers.Reviewed by Cursor Bugbot for commit c5b69bb. Bugbot is set up for automated code reviews on this repo. Configure here.