Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve aria-label
  • Loading branch information
t-hamano committed Sep 26, 2025
commit ebfc1df00b439b115fa7224663a593485a3875ea
14 changes: 13 additions & 1 deletion packages/editor/src/components/collab-sidebar/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ function Thread( {
: undefined;
const restReplies = !! replies.length ? replies.slice( 0, -1 ) : [];

const ariaLabel = sprintf(
/* translators: 1: comment identifier, 2: author name, 3: number of replies. */
_n(
'Comment %1$s by %2$s. %3$s reply.',
'Comment %1$s by %2$s. %3$s replies.',
replies.length
),
thread.id,
thread.author_name,
replies.length
);

return (
// Disable reason: role="listitem" does in fact support aria-expanded.
// eslint-disable-next-line jsx-a11y/role-supports-aria-props
Expand Down Expand Up @@ -166,7 +178,7 @@ function Thread( {
tabIndex={ 0 }
role="listitem"
ref={ threadRef }
aria-label={ thread?.content?.raw }
aria-label={ ariaLabel }
aria-expanded={ isSelected }
>
<CommentBoard
Expand Down
Loading