-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Style book: create static categories #65430
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +751 B (+0.04%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
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. |
ed53658
to
021275c
Compare
@vcanales Thanks for linking. Also for the tracking issue 👍🏻 Sorry, I didn't see that until today. Is there anything else we can add to the TODO list in the description of this PR do you think? Let's coordinate so we don't double up on work. I'm currently looking at catering for other registered categories (aside from those in the static list). I think @aaronrobertshaw might be working on custom examples, e.g., the theme colors. |
I'm currently working through ensuring we have examples for all the core blocks outlined in the style book iteration issue. I've gotten a little sidetracked on some blocks that render placeholder states, such as the Avatar block. It might be open for debate as to what state the block should be in for the Style Book but that can be discussed on relevant PRs. Once the core block examples are sorted my plan is to work on display of the examples in the Color tab. |
dfa250a
to
c9d092d
Compare
* @property {string} slug Category identifier. | ||
* @property {string} title Category title/label. | ||
* @property {Array?} blocks Array of block names to include in the category. Used when blocks are not included in the category by default. | ||
* @property {Array?} excludes Array of blocks to exclude from the category. Used when blocks are included in the category by default. |
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.
Wondering if I should just convert this all to TS
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.
One step at a time?
It could easily be a follow-up but if you're going to pull the trigger on it, maybe before we get too deep into the weeds iterating on then Style Book?
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.
Yeah, good call. That was a 🧠 🌬️
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.
Didn't see your reply before leaving my review which sort of flip-flopped. I think eventually we'll end up doing it. Now, or in a follow-up, I don't think it matters greatly.
Flaky tests detected in e07ce98. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10987752597
|
e07ce98
to
cced471
Compare
cced471
to
4a64a9b
Compare
Nice one. Possibly on my end, I got a small error: Error
What's the best type of feedback I can share at this point? I presume this is initial work to be able to create a new and curated "Overview" page for the book, yes? |
Thank you for testing! You're right: this is just the first PR to lay the ground work. The expectations here are that:
This PR will make adding the "Overview" page possible in a follow up PR. I'll fix that type error today 🙇🏻 |
Using fixtures for tests. Using fixtures for tests.
…lock store update comments Use `slug` instead of `name`
4a64a9b
to
8ea8273
Compare
✅ |
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.
Thanks for iterating on this one so quickly @ramonjd, nice work 👍
I've given this PR a test and it is working well for me. I did notice one oddity though but it isn't something introduced by this PR.
When in the Style Book, the zoom out button is still available in the top toolbar and has seemingly no effect. If the block inspector button is clicked it takes the user out of the Style Book and back to the normal editor.
What's the expected behaviour for the Style Book here? I'm not sure it adds much benefit for the Style Book to get zoomed out but others' opinions might vary on that.
As it stands, if the zoom out mode is toggled on in the top toolbar, then the user exits the Style Book, zoom out mode isn't actually in effect. The user then has to toggle the button off, then back on.
Screen.Recording.2024-09-24.at.5.30.30.pm.mp4
As for the changes to the Style Book in this PR:
✅ No errors loading style book
✅ Clicking on blocks in the Style Book opens block type under Global Styles sidebar
✅ Current categories are within set outlined by #53431
Wondering if I should just cover this all to TS
Thinking on this a little more, maybe it is better to just bite the bullet and convert it to TS now when we're introducing these new files. We can save duplicating the typedefs, keep a cleaner file history etc.
I'm happy to go with your call in the end but I don't think we're in a great rush right?
Part of:
What? How?
MVP for #53431
Why?
Note
This is a foundational PR only. So clearing a path to creating custom tabs and example lists. More design stuff to come in subsequent PRs.
Below is the theme tab for example. The "Design" tab's examples are now under "Theme" sorted into subcategories.
Testing Instructions
Open the style book and check for regressions, e.g.,
Screenshots
Steps after this PR:
getCategories()
for extenders etc. Style book: display registered categories #65507