-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add toggle for grid types and stabilise Grid block variation. #59051
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/experimental/editor-settings.php ❔ lib/experiments-page.php |
Size Change: +87 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Flaky tests detected in 64cca68. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7910864098
|
Why is 6 columns the max? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
The columns control doesn't feel quite right to me. I think the slider should range from 1 to ~10 and the NumberInput
should let you type in anything that's greater than 0.
But that's already in the codebase so have a 👍 anyway.
Confirming, if we merge this now it won't land in 6.5, right? Better for this to wait until 6.6 imo. |
key={ 'auto' } | ||
value="auto" | ||
label={ __( 'Auto' ) } | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Auto is the default should it be on the left?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know! Is the default usually on the left? Happy to switch it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing great for me, too!
✅ Grid block defaults to min column width approach
✅ Post Template block defaults to column count approach
✅ Toggle between Manual and Auto works nicely
Not related to this PR, but I noticed that the Featured Image block's placeholder component doesn't play nicely at really small sizes (it has a min height of 200px
). Possibly something to look at separately at some point, but not a blocker for now:
Working well:
2024-02-16.15.03.29.mp4
LGTM! ✨
I honestly don't remember 😂 The manual option was initially added to support Post Template block. I guess now that it's a free-for-all the limitation doesn't make sense. |
I'll merge this and update the max columns (and possibly the toggle order?) as a follow-up. |
Thanks for the reviews folks! I didn't forget the props this time 😅 |
* trunk: (78 commits) Components: Use `Element.scrollIntoView()` instead of `dom-scroll-into-view` (#59085) DataViews: Correctly display featured image that don't have image sizes (#59111) Elements: Fix block instance element styles for links applying to buttons (#59114) Allow editing of image block alt and title attributes in content only mode (#58998) Add toggle for grid types and stabilise Grid block variation. (#59051) Global Styles: fix console error in block preview (#59112) Navigation: Avoid using embedded records from fallback API (#59076) Refactor responsive logic for grid column spans. (#59057) Editor: Unify Mode Switcher component between post and site editor (#59100) Move StopEditingAsBlocksOnOutsideSelect to Root (#58412) Fix logic error in #58951 (#59101) Block-editor: Auto-register block commands (#59079) Fix small typo in rich text reference guide (#59089) Components: Add lint rules for theme color CSS var usage (#59022) Enter editing mode via Enter or Spacebar (#58795) Updating Storybook to v7.6.15 (latest) (#59074) CustomSelectControl (v1 & v2): Fix errors in unit test setup (#59038) Add stylelint rule to prevent theme CSS vars outside of wp-components (#59020) ColorPicker: Style without accessing InputControl internals (#59069) Pattern block: batch replacing actions (#59075) ...
👋🏼 @tellthemachines . Do I understand correctly from this PR description that the Grid block variation is no longer experimental? If so, I'm wondering if this would be a good feature to highlight in the 17.8 Gutenberg release post tomorrow (Feb 28th). How would you describe it? |
@creativecoder correct, Grid variation is now stable! In terms of describing the feature, there are several parts to it:
So overall I think it's worth highlighting that grid layout support has a few new features! Are you already working with designers to create assets for the release post, or do you need help with that at all? |
Thanks for clarifying @tellthemachines ! I tagged you over in this slack thread where we're coordinating design assets: https://wordpress.slack.com/archives/C02S78ZAL/p1709053653841079 |
What?
Another step on the way to #57478.
Testing Instructions
In a post or template, add a Grid block. Play around with the layout controls in the sidebar and check that everything works as expected.
Testing Instructions for Keyboard
Screenshots or screencast
19d3a260-90d7-4478-b2b6-a846b5c25db6.mp4