Repository navigation
fix(catalog): keep the recorded video for canvas drawElement previews - #3171
Merged
Merged
Conversation
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.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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
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 fivevfx-*effects.Why
They paint DOM into a canvas with
ctx.drawElementImage(), which sits behindchrome://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
.mp4and.png, checked before this was written.Side effect:
docs/public/catalogdrops from 21 MB to 15 MB, since these carried the embedded 3D models.Test plan
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.