(bug) Docs videos leave an empty block while they load instead of showing a skeleton
While a video loads on a docs page, the page shows a blank block where the player will be. Nothing tells the reader that something is coming, so the page reads as broken or unfinished. A skeleton should fill the box until the player paints, and images should get the same treatment.
Steps to reproduce
- Open https://docs.agenta.ai/guides/trigger-an-automation-from-an-app with the network throttled (devtools → Slow 3G), then hard reload.
- Scroll to "Pick the app and the event".
Expected: a skeleton placeholder fills the video's box until the player paints.
Actual: the box stays blank for the whole load.
Where
Docs site, any page with a <Stream> embed — ten pages under docs/docs/ use one. The video in the screenshot is docs/guides/08-trigger-an-automation-from-an-app.mdx:29.
A skeleton already ships for Cloudflare Stream embeds — docs/src/clientModules/streamSkeleton.ts plus the [data-stream-state="loading"] rules in docs/src/css/custom.css — yet the block still renders empty here. Images have no skeleton at all.
Screenshot
@ashrafchowdury Good catch. After digging into the repo, here's what I found:
The streamSkeleton.ts / data-stream-state code you mention does not exist yet in the codebase. The docs/src/ directory contains only css/ — there is no clientModules/ folder, no streamSkeleton.ts, and no data-stream-state rules anywhere in custom.css [1] [2]. So the skeleton infrastructure needs to be created from scratch.
What does exist: The docs use @cloudflare/stream-react and <Stream> embeds appear in multiple files (both under docs/docs/ and docs/blog/), all using the same bare pattern with no wrapper, no skeleton, and no loading state:
import { Stream } from '@cloudflare/stream-react';
<Stream controls src="<id>" height="400px" />
To fix this, the work needed is:
-
Create
docs/src/clientModules/streamSkeleton.ts— a Docusaurus client module that sets adata-stream-state="loading"attribute on each<stream-player>element (rendered by@cloudflare/stream-react) and removes it once the player fires itsloadeddataorcanplayevent. -
Add skeleton CSS to
docs/src/css/custom.css— rules targeting[data-stream-state="loading"]that render an animated shimmer/pulse. Theheight="400px"is already set inline, so the box dimensions are known. -
Register the client module in
docs/docusaurus.config.tsvia theclientModuleskey. -
For images,
@docusaurus/plugin-ideal-imageis already configured [5] and handles lazy loading for<Image>components, so pages using@theme/IdealImage(like the changelog) already get partial coverage. Native<img>tags would need separate treatment.
The page at docs.agenta.ai/guides/trigger-an-automation-from-an-app does exist on the deployed site, but the docs/docs/ tree in the repo has no guides/ folder [6] — the sidebar maps "Tutorials" to tutorials/ subdirectories [7], so the /guides/ URL path may come from routing configuration or a branch not yet merged to main.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
Hi, I'd like to work on this. I'll submit a PR shortly.
Appreciate your effort @nightcityblade , make sure to add a short video on the PR by showing the fix for all the cases
I found that current main already contains the requested Stream loading skeleton in commit 3b436ee (client module, Docusaurus registration, and shimmer CSS). I’m stepping back so this is unclaimed rather than opening a duplicate PR.
You can still try locally or on documentation to see whether that implementation fixed the issue or not
Checked this on current production: https://agenta.ai/docs/guides/trigger-an-automation-from-an-app
The Stream embed is no longer a blank box. The wrapper gets data-stream-state="loaded", the 16:9 frame is reserved, and the Cloudflare player paints (play control visible). So the video half of this issue looks fixed by the streamSkeleton.ts + media.css work already on main.
The remaining part from the original report is still true: markdown / IdealImage screenshots have no loading skeleton. Happy to take just that if you still want it.