Skip to content

feat(site): add a spinning-logo loading state to the playground - #3548

Merged
diegomura merged 1 commit into
masterfrom
diegomura/playground-loading-state
Aug 27, 2026
Merged

feat(site): add a spinning-logo loading state to the playground#3548
diegomura merged 1 commit into
masterfrom
diegomura/playground-loading-state

Conversation

@diegomura

Copy link
Copy Markdown
Owner

The playground's loading state was a line of centered text that cut away the instant the lazy chunk landed, which on a fast connection reads as a flicker rather than a load. This replaces it with a full-page overlay: the react-pdf logo spinning above a "Loading playground…" label, held for a minimum 650ms so a quick load still looks intentional, then faded out over 400ms.

The overlay now sits over a mounted <Playground /> instead of swapping with it, so CodeMirror and the first PDF render happen behind it rather than popping in afterwards. The same visual backs the route's Suspense fallback, so the server HTML and the client overlay are one continuous picture. The logo honours prefers-reduced-motion, and the fade unmounts on a timer rather than transitionend, which never fires under reduced motion.

🤖 Generated with Claude Code

The playground chunk is large enough to leave a visible gap, and the old
fallback was a line of centered text that cut away the instant the chunk
landed. Replace it with a full-page overlay: the logo spinning above a
"Loading playground…" label, held for a minimum beat so a fast load reads
as intentional rather than a flicker, then faded out.

The overlay sits over a mounted playground instead of swapping with it, so
CodeMirror and the first PDF render happen behind it rather than popping in
after. The same visual backs the Suspense fallback, so the server HTML and
the client overlay are one picture.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-pdf Ready Ready Preview Aug 27, 2026 11:28pm

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f3fc17f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@diegomura
diegomura merged commit d59074a into master Aug 27, 2026
17 checks passed
@diegomura
diegomura deleted the diegomura/playground-loading-state branch August 27, 2026 23:29
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