Repository navigation
Editor: Page the patterns in the "Choose a pattern" modal - #85233
Draft
MaggieCabrera wants to merge 3 commits into
Draft
MaggieCabrera wants to merge 3 commits into
MaggieCabrera wants to merge 3 commits into
Conversation
The modal for new pages rendered a preview iframe for every starter pattern at once. Show them 20 at a time with the paging the pattern explorer uses, exposed through block-editor's private APIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. 📦 Bundle sizeSize Change: +119 B (0%) Total Size: 9.05 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Regression: updating a specific option will only change its value and will not corrupt others in
|
This branch has not been deployed
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?
See #84507. The "Choose a pattern" modal for new pages now shows its patterns 20 at a time, with the same pagination as the pattern explorer.
Why?
The modal rendered a preview of every starter pattern at once, and each preview is its own iframe. While testing #84507 on a site with hundreds of themes installed, the modal's 44 starter patterns took about 265 MB of JS heap and 4 s of main-thread time.
With 60 starter patterns, opening the modal now mounts 21 iframes instead of 61, takes 0.73 s of main-thread time instead of 1.23 s, and uses 90 MB of JS heap instead of 137 MB (Playwright with CDP
Performance.getMetrics, median of 5 runs,emptytheme).How?
usePatternsPagingandBlockPatternsPaging, exposed through block-editor's private APIs.Testing Instructions
packages/e2e-tests/plugins. It registers 60 starter page patterns.Testing Instructions for Keyboard
Use of AI Tools
Claude Code (Claude Opus 5.5) wrote the change, the e2e test and the measurements.
🤖 Generated with Claude Code