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

Enhance Group Block Placeholder Design and Accessibility for Consistency with Other Blocks #67083

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

sarthaknagoshe2002
Copy link
Contributor

@sarthaknagoshe2002 sarthaknagoshe2002 commented Nov 18, 2024

Fixes: #66062

What?

This PR improves the placeholder UI and accessibility of the Group block to align it with other blocks (e.g., Columns, Query Loop); refer #66062. It addresses the following:

  1. Implements a consistent design pattern for the Group block placeholder with:
    • Icon and title.
    • Description text.
    • Interactive controls for initial configuration.
  2. Improves accessibility by:
    • Ensuring variation buttons have correct labels and descriptions.
    • Providing accessible names for all interactive controls using aria-describedby.

Why?

  • The Group block placeholder currently uses an inconsistent design pattern compared to other blocks like Columns and Query Loop. This inconsistency may confuse users and reduce the user experience.
  • The variations picker for Group, Columns, and Query Loop blocks had missing aria-describedby attributes.

How?

  1. Design Consistency:

    • Updated the Group block placeholder to include an icon, title, and description matching the design pattern of other blocks.
    • Added a clear and informative description to the placeholder for better guidance.
  2. Accessibility Improvements:

    • Updated variation buttons to include appropriate aria-describedby attributes, ensuring accessible names match the visible text.
    • Used screen reader text and associated descriptions for interactive controls to provide semantic meaning.
    • Corrected the accessible name for Group block variations by integrating the title and description.

Testing Instructions

  1. Verify Design Consistency:

    • Add a Group block in the editor and observe the placeholder.
    • Confirm the placeholder displays an icon, title ("Group"), and description ("Group blocks together. Select a layout:").
    • Ensure the layout options (variations) are displayed clearly with labels.
  2. Compare Placeholders:

    • Add Columns, and Query Loop blocks. Observe their placeholders.
    • Ensure the Group block now follows the same design pattern as these blocks.
  3. Accessibility Testing:

    • The aria-describedby attribute is present and correctly associates the title and description.
    • Test the variation buttons for the Columns and Query Loop blocks to verify similar improvements.

Screenshots or screencast

Before

Design Floating tooltip
Screenshot 2024-11-18 at 7 17 31 PM Screenshot 2024-11-18 at 7 18 10 PM

After

Design Floating tooltip
Screenshot 2024-11-18 at 6 40 14 PM Screenshot 2024-11-18 at 6 40 27 PM

aria-describedby label

Screenshot 2024-11-18 at 6 40 57 PM

Copy link

github-actions bot commented Nov 18, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sarthaknagoshe2002 <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: afercia <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 18, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @sarthaknagoshe2002! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@sarthaknagoshe2002
Copy link
Contributor Author

@ellatrix Could you please review this PR?

@adamsilverstein adamsilverstein added the [Type] Enhancement A suggestion for improvement. label Dec 16, 2024
@jasmussen
Copy link
Contributor

Thanks for the PR! Design-wise, it's not clear that the icon and label helps this state, and the removal of the label and icon was intentional:

Screenshot 2024-12-17 at 08 23 22

The placeholder's original design did not consider all the contexts in which it was used, and so rather than regressing the Group block to a past design, it seems more friutful to consider how we can refresh the other placeholders to scale better to additional contexts.

@sarthaknagoshe2002
Copy link
Contributor Author

@jasmussen I’d like to propose adding these changes along with some additional updates suggested in #54867. This will help ensure placeholders are present, maintain consistency, and ensure that when adding to narrow layouts, the selection appears in the block controls.

@afercia
Copy link
Contributor

afercia commented Dec 18, 2024

making the added label redundant.

@jasmussen while I do understand the need to make the placeholder scale well in narrow spaces, I'm not sure you are fully understanding the users needs, the accessibility requirements, and the technologies we have to support. A visible label is needed to visually expose the accessible name of the variations. Please keep into consideration all the devices and technologies users use, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve consistency and accessibility of the Block placeholder variations picker
4 participants