Skip to content

fix(catalog): keep the recorded video for canvas drawElement previews - #3171

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/canvas-items-keep-video
Aug 10, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/canvas-items-keep-video

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Eight blocks go back to their recorded video instead of a live player: the three 3D device blocks (ios26-liquid-glass, macos-tahoe-liquid-glass, vfx-iphone-device) and the five vfx-* effects.

Why

They paint DOM into a canvas with ctx.drawElementImage(), which sits behind chrome://flags/#canvas-draw-element. Without the flag the preview still mounts and still plays, and the canvas is simply empty.

This is why the 3D blocks looked broken even after #3170 embedded their models correctly. The model was fine; the surface it draws onto was never going to paint for a reader. The recorded video was captured by a renderer that does have the capability, so it is the only preview these items can honestly show.

How

The payload generator skips an item whose composition calls drawElementImage, and says so in its output rather than dropping it silently. The page generator already falls back to the video whenever no payload exists, so no change was needed there.

All eight have a published .mp4 and .png, checked before this was written.

Side effect: docs/public/catalog drops from 21 MB to 15 MB, since these carried the embedded 3D models.

Test plan

  • Manual testing performed
  • Unit tests added/updated
  • Documentation updated (if applicable)

Regenerated the full catalog: 158 items keep a live player, 9 use a video, and each of the eight now emits a <video> tag. No unit test here — the rule is a substring check on composition source, and the meaningful verification is that the eight items are the exact set that calls the API, which the regeneration output shows by name.

Reported by a reader who has the flag enabled and still saw empty 3D previews, which is also why the flag is not a safe thing to rely on.

Eight blocks paint DOM into a canvas with ctx.drawElementImage(), which sits
behind chrome://flags/#canvas-draw-element. A reader without the flag gets a
preview that mounts, plays, and shows an empty canvas, which is what the 3D
device blocks were doing even after their models were embedded correctly.

The recorded video was captured by a renderer that has the capability, so it is
the only preview these items can honestly show. All eight have a published mp4
and poster.
@mintlify

mintlify Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hyperframes 🔴 Failed – Aug 10, 2026, 10:31 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@miguel-heygen
miguel-heygen merged commit 0f76305 into main Aug 10, 2026
13 of 14 checks passed
@miguel-heygen
miguel-heygen deleted the fix/canvas-items-keep-video branch August 10, 2026 22:30
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