Skip to content

capture-viewer: render extracted JSON preview artifacts - #757

Merged
Aymericr merged 1 commit into
mainfrom
feat/capture-viewer-json-previews
Sep 2, 2026
Merged

capture-viewer: render extracted JSON preview artifacts#757
Aymericr merged 1 commit into
mainfrom
feat/capture-viewer-json-previews

Conversation

@Aymericr

@Aymericr Aymericr commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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.

  • streamHydratesJsonPayload is one predicate for both renderability and runtime hydration, so a stream can never be declared renderable without a hydration path.
  • CaptureStreamLayer fetches the JSON artifact into the inline payload shape the layers already consume.
  • The device-motion playback key is keyed on artifact identity and load state rather than the payload's contents, which can be megabytes.

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 streamHydratesJsonPayload so 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. CaptureStreamLayer fetches that artifact via useJsonArtifactPayload (loopback URL rewrite, abort on unmount) and feeds the result into the existing layer props as payload (inline ?? fetched).

For device motion, trajectory parsing and playback remounting use payload instead of inline only; the motion playback key uses artifact URL plus load state when the payload is fetched, avoiding JSON.stringify on multi‑MB JSON.

Tests assert isCaptureStreamRenderable is 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.

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>
@pascal

pascal Bot commented Sep 2, 2026

Copy link
Copy Markdown

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

@Aymericr
Aymericr merged commit 5c058b9 into main Sep 2, 2026
3 checks passed
@Aymericr
Aymericr deleted the feat/capture-viewer-json-previews branch September 2, 2026 20:08
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.

1 participant