-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block Comments: Make "n more replies" text clickable for accessibility #71387
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
Block Comments: Make "n more replies" text clickable for accessibility #71387
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. |
t-hamano
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.
Sorry for the late review!
Almost looks good, but I believe we can simplify the Button:
- No need to add
aria-labelbecause the button has visible text. - Since this button disappears when clicked, I don't think
aria-expanded=trueis necessary.
Taking this into consideration, it should be possible to simplify it as shown below:
<Button
__next40pxDefaultSize
variant="link"
className="editor-collab-sidebar-panel__show-more-reply"
onClick={ () => setFocusThread( thread.id ) }
>
{ sprintf(
// translators: %s: number of replies.
_x( '%s more replies', 'Show replies button' ),
thread?.reply?.length
) }
</Button>Furthermore, this padding should no longer be necessary:
| padding: 0; |
@WordPress/gutenberg-design, Note that this PR changes the appearance of the "n more replies" text. Any feedback is welcome.
| Before | After |
|---|---|
![]() |
![]() |
t-hamano
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.
LGTM! If there is any design feedback, let's address it as a follow-up.
|
@jasmussen Thanks for the feedback! Let's apply that design as a follow-up PR. P.S. We're currently working hard to get the Block Commenting ready for shipping in 6.9. If you discover any issues from the design perspective, please let us know, and we'll address them 🙏 |
|
FYI that I created #71774 to follow-up on that design update, thanks for flagging @jasmussen! |



What?
See #71249
Converts the static "n more replies" text in block comments to a clickable, keyboard-accessible button that expands hidden comment replies.
Why?
The block comments feature currently displays "X more replies" as static text when there are many replies to a comment. Users found it unintuitive that they needed to click elsewhere on the comment thread (or use the "Select an action" menu) to expand and view these hidden replies. This creates accessibility barriers for keyboard and screen reader users who cannot easily discover how to access the additional replies.
How?
VStackelement containing "n more replies" text with aButtoncomponentaria-expanded="false", descriptivearia-label)variant="link"styling to maintain visual consistency while making it clearly interactivesetFocusThread()functionality that was previously only available through clicking elsewhere on the comment threadTesting Instructions
Testing Instructions for Keyboard
Tabkey to navigate through the comment sidebarEnterorSpacewhile the button is focusedScreenshots or screencast
Before
Before.mov
After
After.mov