style: cap height of artificially-slow example output (#8486)#8495
Open
lee-eojin wants to merge 1 commit into
Open
style: cap height of artificially-slow example output (#8486)#8495lee-eojin wants to merge 1 commit into
lee-eojin wants to merge 1 commit into
Conversation
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
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.
Fixes #8486
Summary
Expanded Sandpack previews can become excessively tall when an example renders hundreds of list items.
This change caps the affected lists while preserving the original 250/500 item counts and their rendering behavior.
.items { + max-height: 1200px; + overflow-y: auto; }This covers:
useDeferredValueexamples rendering 250 itemsuseTransitionexamples rendering 500 postsAll items are still rendered and remain accessible by scrolling inside the list.
Scope
This change intentionally scopes the height limit to the affected list examples. Applying a global limit to expanded Sandpack previews would affect unrelated examples and may change the intended “Show more” behavior.
Follow-up question
Would you be open to capping the height of expanded Sandpack previews globally?
Currently, “Show more” removes the maximum height entirely. I kept this PR scoped to the affected examples to avoid changing unrelated Sandpacks.
If a global limit is preferred, I can address that separately in a follow-up.
AFTER
Test plan
git diff --checkyarn check-all