Directory

Remove `accordion` from details block keywords by aurooba · Pull Request #51597 · WordPress/gutenberg · GitHub
Skip to content
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

Remove accordion from details block keywords #51597

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

aurooba
Copy link
Member

@aurooba aurooba commented Jun 16, 2023

What?

This PR simply removes the keyword accordion from the Details block's block.json file, to stop the Details block from being suggested if someone searches for accordion in the Block Inserter.

Why?

I know there has been lots of discussion around whether a details block is an accordion or not and the journey to bring the details block to fruition has been a long one. However, the details block does not serve as an accessible accordion pattern since it's not navigable. It's not a good idea to encourage people to think of the Details block as an accordion alternative.

Some helpful articles and resources:

@aurooba aurooba requested a review from ajitbohra as a code owner June 16, 2023 15:55
Copy link
Contributor

@alexstine alexstine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@skorasaurus skorasaurus added the [Block] Details Affects the Details Block - used to display content which can be shown/hidden label Jun 16, 2023
@alexstine alexstine requested a review from carolinan June 18, 2023 18:41
@carolinan carolinan merged commit 6e94233 into WordPress:trunk Jun 19, 2023
48 checks passed
@carolinan carolinan added the [Type] Enhancement A suggestion for improvement. label Jun 19, 2023
@github-actions github-actions bot added this to the Gutenberg 16.1 milestone Jun 19, 2023
@richtabor
Copy link
Member

I know there has been lots of discussion around whether a details block is an accordion or not

It's not an accordion block, but I am concerned about discoverability.

If you're not a developer, it will be difficult to discover the Details block, which is a suitable (and accessible) replacement for accordions in most scenarios.

@alexstine
Copy link
Contributor

We could always add an accordion block...

@richtabor
Copy link
Member

We could always add an accordion block...

Sure!

@aurooba
Copy link
Member Author

aurooba commented Jun 19, 2023

I would be strongly in favour of an accordion block! But making the details block discoverable as an accordion sets an unhelpful precedent. An accordion has requirements and needs to be accessible in a manner that the details block doesn't support.

They are two different things even if on the surface they seem similar.

@richtabor
Copy link
Member

richtabor commented Jun 19, 2023

But making the details block discoverable as an accordion sets an unhelpful precedent.

The block has its own name; it's not an accordion. If the block was named "Accordion" that'd be suggesting it was an accordion wholesale.

I equate this change to if we removed the "image" keyword from the Cover and Media & Text blocks.

@aurooba
Copy link
Member Author

aurooba commented Jun 19, 2023

I equate this change to if we removed the "image" keyword from the Cover and Media & Text blocks.

That's really not the same thing. The image keyword is helpful because you can add and work with images in the Cover and Media & Text block, and it's correct to use images in those blocks if you so wish – they support it well and accessibly.

The only reason to add accordion as a keyword is because an accordion shows/hides things, which the Details block does too.

But if people start using the Details block as a replacement for accordions, instead of actual accessible accordions, we'll create more accessibility issues because you can't navigate/jump to a details block like you can to an accordion. When people search for accordion in the Inserter, it should correctly pull up accordion block options available in the plugin repository, instead of suggesting the Details block.

The details block is fantastic when you need to add an aside, when you need to add information that is helpful but not primary, which is why you can't inherently navigate/tab/announce a heading in the summary section of the Details block.

Most people use show/hide (aka accordion functionality) for important things like FAQs and tabs with lots of valuable information that you do need to be able to jump and navigate through. We shouldn't encourage people to use the Details block for things like an FAQ.

sethrubenstein pushed a commit to pewresearch/gutenberg that referenced this pull request Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Details Affects the Details Block - used to display content which can be shown/hidden [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants