Fix Blocks list ordering in Global Styles#39093
Conversation
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @mashikag! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
ntsekouras
left a comment
There was a problem hiding this comment.
Thanks for the PR @mashikag!
I've left a comment and also it's a good opportunity to use getBlockTypes selector from blocks store.
packages/edit-site/src/components/global-styles/screen-block-list.js
Outdated
Show resolved
Hide resolved
|
@ntsekouras Thanks for your review and the suggestion. I will fix this up later this evening. 🙇♂️ |
5167acb to
2036446
Compare
|
BTW @ntsekouras after I run |
packages/edit-site/src/components/global-styles/screen-block-list.js
Outdated
Show resolved
Hide resolved
No you shouldn't. I guess you're talking about the |
ntsekouras
left a comment
There was a problem hiding this comment.
Besides the small nit about the declaration of the new hook outside return, this looks good!
Thanks so much for the PR @mashikag ! 💯
packages/edit-site/src/components/global-styles/screen-block-list.js
Outdated
Show resolved
Hide resolved
2036446 to
56a7fd1
Compare
…nent This commit ensures that core blocks are always displayed first, ahead of, non-core blocks in the ScreenBlockList component of GlobalStylesUI.
56a7fd1 to
b3cd261
Compare
|
@ntsekouras No problem! Thanks for your guidance. :) I updated the PR once again to align with your most recent suggestions. 👍 |
|
Congratulations on your first merged pull request, @mashikag! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
Description
This commit ensures that core blocks are always displayed first, ahead of, non-core blocks in the ScreenBlockList component of GlobalStylesUI.
Currently there is an issue that when non-core blocks are registered they are displayed first, ahead of, non-core blocks. This PR is fixing this issue. See the follow-up, before and after, screenshots for reference.
The issue being fixed was discovered and raised here.
Testing Instructions
Install
Jetpackplugin on your local gutenberg dev env site. This does not have to be necessarilyJetpack. Any plugin that registers non-core blocks should do.Activate the
Jetpackplugin. This can be done fromPlugins->Installed Plugins.Open site editor, via
Appearance->Editor, or by navigating to http://yoursite.com/wp-admin/themes.php?page=gutenberg-edit-siteIn the top right of the editor, click at

Stylesicon. This should open upStylessidebar on the right hand side of youreditor's screen.
Expand the
Blockssection in theStylessidebar, by clicking at the section's sub-header.Notice how the
Contact infoandMarkdownnon-core blocks are displayed ahead of the core blocks when there is no fix applied, and vice-versa when the fix is applied.Screenshots
Before
Notice how the

Business hourstoTiled Galleryblocks, which are non-core, are displayed in front of the core blocks.After
Now notice how the

Business hourstoTiled Galleryblocks, which are non-core, are displayed after core blocks.Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.jsfiles for terms that need renaming or removal).