feat(site): add a spinning-logo loading state to the playground - #3548
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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.
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 honoursprefers-reduced-motion, and the fade unmounts on a timer rather thantransitionend, which never fires under reduced motion.🤖 Generated with Claude Code