-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add contentRole support to Accordion, Accordion Item, Accordion Panel #72052
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
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. |
|
Size Change: +4 B (0%) Total Size: 1.96 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 4d4f7a0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18271844080
|
andrewserong
left a comment
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.
In much the same way as we consider the Details block to be content, I agree, I think the Accordion and its blocks need to be thought of the same way 👍
Something that's a bit challenging in terms of usability is that the Accordion block has a fair bit of (necessary) nesting, and so I found the Content panel on the right-hand side to be a bit noisy once there are a few accordion items:
Because of the nature of the nesting and how the panel flattens the hierarchy, to me it's a little hard to see which item or panel I'm within.
That said, I can't quite think of how we'd simplify these blocks for content only mode, as each wrapper needs to be made available — so that we can add additional items, so that we can add headings, and so that we can add multiple blocks within each panel.
For example, on trunk we're stuck with the existing accordion items, and it's not possible to add additional blocks within the accordion panels:
So, all up I think this LGTM (and is necessary for these blocks to be useful in content only mode), but it might be worth getting a second pair of 👀 if there's any concern here.
Thanks for think through how this block works with content only mode!
|
@andrewserong Thanks for the review!
For example, we might be able to consider an entire block that supports the |
tellthemachines
left a comment
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 the quick follow-up!
Initially I was thinking we only need the role on Accordion and Accordion Panel, because just having it on Accordion means the inserter appears inside the block:
But on reflection (and testing this PR) having Accordion Items be treated as a unit of content that you can duplicate, delete or move provides a better experience.
I think how nesting translates to the inspector view needs more work holistically because it's not an ideal experience for many patterns right now, so adding the extra level has more benefits than downsides 🙂
Agreed 👍 |
|
Thanks for the review!
Yes, that's why I added the role to the Accordion Item👍 |
…WordPress#72052) Co-authored-by: t-hamano <[email protected]> Co-authored-by: andrewserong <[email protected]> Co-authored-by: tellthemachines <[email protected]>
What?
This PR adds
contentRoleblock support to Accordion, Accordion Item, and Accordion Panel blocks.Why?
The Accordion block is made up of multiple Accordion Item blocks. Many users may think of Accordion Item blocks as content and want to add or remove them. The blocks inside an Accordion Panel can also be considered content.
Testing Instructions for Keyboard
Screenshots or screencast
eceaadd9f54229026e1fd44deac0a034.1.mp4