capture-viewer: render extracted JSON preview artifacts - #757
Merged
Conversation
The manifest-first archive moved surface-mesh, point-cloud, and device-motion payloads out of inline stream data into JSON preview artifacts, but renderability and hydration still assumed inline — surface mesh reported "no data", point cloud and the motion trajectory silently vanished. Accept application/json payload artifacts as renderable and fetch them into the inline payload shape the layers already consume. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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: 641e5cca-9915-462b-9a02-15eeb0a193da |
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.
The manifest-first archive moved surface-mesh, point-cloud, and device-motion payloads out of inline stream data into JSON preview artifacts, but renderability and hydration still assumed inline — surface mesh reported "no data", point cloud and the motion trajectory silently vanished.
streamHydratesJsonPayloadis one predicate for both renderability and runtime hydration, so a stream can never be declared renderable without a hydration path.CaptureStreamLayerfetches the JSON artifact into the inline payload shape the layers already consume.Covered by
stream-rendering.test.ts.🤖 Generated with Claude Code
Note
Medium Risk
Changes capture viewer data loading and render gating for large JSON artifacts; failures surface as thrown fetch errors in the stream error boundary, but scope is limited to preview layers.
Overview
Fixes manifest-first archives where surface mesh, point cloud, and device motion no longer ship inline payloads—those layers were missing or empty because renderability and hydration still required
stream.inline.Adds
streamHydratesJsonPayloadso device motion, point cloud, and surface mesh streams with a JSON artifact (and no inline data) count as renderable and share the same hydration rule.CaptureStreamLayerfetches that artifact viauseJsonArtifactPayload(loopback URL rewrite, abort on unmount) and feeds the result into the existing layer props aspayload(inline ?? fetched).For device motion, trajectory parsing and playback remounting use
payloadinstead of inline only; the motion playback key uses artifact URL plus load state when the payload is fetched, avoidingJSON.stringifyon multi‑MB JSON.Tests assert
isCaptureStreamRenderableis true for ready streams with JSON preview artifacts for all three layer kinds.Reviewed by Cursor Bugbot for commit 80438fd. Bugbot is set up for automated code reviews on this repo. Configure here.