-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try splitting style book into sections. #68071
Conversation
Size Change: +95 B (+0.01%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
34531f6
to
81f7a75
Compare
Flaky tests detected in ad39bce. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12458003651
|
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. |
E2e failure is legit; I messed something up in the classic stylebook 😬 fixing now |
...and just fixed another little boo-boo 😄 |
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.
This is much more useful I think, thanks for getting this PR up.
Do you think we can get rid of the scroll behavior too? Seems like we don't need it anymore, or I could be missing something.
: { | ||
examples: [ | ||
examples.find( | ||
( example ) => example.name === previewCategory |
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.
comments-pagination
, list-item
and maybe some other blocks don't have any examples and will bork the whole page.
/wp-admin/site-editor.php?p=%2Fstyles§ion=%2Fblocks%2Fcore%252Fcomments-pagination&preview=stylebook
/wp-admin/site-editor.php?p=%2Fstyles§ion=%2Fblocks%2Fcore%252Flist-item&preview=stylebook
Some other blocks are listed on #64707. Also there are links to PRs where we created missing block examples.
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.
Oh I just fixed that! Blocks without examples should now just show the all blocks page, I think that's the best we can do until we get all the examples added.
Thanks for reviewing!
Do you think so? Because we still have a couple longish pages (Typography and all blocks) I thought it might be good to keep it in place for now. Anything specific seem off about it? |
Ah, not at all. I must have been only testing with short pages. Makes sense to keep it intact for the longer pages. 🍺 |
I made a couple of adjustments to the scrolling logic so that it now only scrolls long pages to the top and removed the block-specific logic as that's no longer needed with the individual block pages. |
if ( | ||
path === '/' || | ||
path.startsWith( '/typography' ) || | ||
path.startsWith( '/blocks' ) |
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.
Should /colors
also be here? Without, there's no scroll to top
Kapture.2024-12-23.at.08.59.48.mp4
I'll tentatively add 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.
Done in ad39bce
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.
This is working pretty well for me. I added scroll to top for colors as well. Seem to match the pattern. Thanks!
What?
Split style book into sections according to the latest designs.
Testing Instructions
Screenshots or screencast
stylebooksections.mp4