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
fix: accessibility issue with feeds comment section #14958
fix: accessibility issue with feeds comment section #14958
Conversation
|
Thank you for opening this PR! We appreciate you! For all pull requests coming from third-party forks we will need to A Forem Team member will review this contribution and get back to |
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.
This is looking good! The only issue is that the Preact component is only used for the logged in home feed, so the new changes aren't currently impacting the logged out feed, paged in articles or search results for posts.
I think if you apply your same changes to _single_story.html.erb and buildArticleHTML.js, we should be good to go 🙂
| @@ -15,6 +14,7 @@ export const CommentsCount = ({ count, articlePath }) => { | |||
| <path d="M10.5 5h3a6 6 0 110 12v2.625c-3.75-1.5-9-3.75-9-8.625a6 6 0 016-6zM12 15.5h1.5a4.501 4.501 0 001.722-8.657A4.5 4.5 0 0013.5 6.5h-3A4.5 4.5 0 006 11c0 2.707 1.846 4.475 6 6.36V15.5z" /> | |||
| </svg> | |||
| ); | |||
| const commentsAriaLabelText = `Comments for article ${articleTitle}. ${count} comment(s) so far`; | |||
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.
suggestion (not blocking) - maybe consider something shorter, e.g. Comments for article ${articleTitle} (${count})
Just thinking for screen reader users who need to listen to everything being read aloud, it can be quite verbose, especially if the post has a long title 🙂
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.
Make sense @aitchiss will do the changes. thank you!
Added screenshots below for the refactored changes:
|
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.
This is looking great - thanks for applying those changes to the other files! Something that occurred to me later was that we use "post" terminology in most places now, rather than "article", so I've left a few suggestions to make sure we're using the same terminology in the aria-label too (sorry - didn't think about that earlier!)
No problem, Updated PR with the changes. please take a look. |
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! Thanks a lot @pramodrhegde
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.
Looks great! Thanks for making that final change - I'm excited to get this merged ✨
The failed build doesn't seem to be anything related to your changes, so I've hit restart on it. Hopefully it'll pass shortly and then this is good to go 🚀
|
Hey @pramodrhegde looks like we still need you to sign the Contributor License Agreement - once you've been able to do that, we'll be able to merge 🚀 |




What type of PR is this? (check all applicable)
Description
Improved the accessibility of the feeds comment section by adding a more meaningful name to the comment button element. fixes: #14881
Comments section name before the fix :
On mobile the accessible name for this link is either:
Completely blank (if no comments exist)
Just the number (e.g. a link with name '1')
On desktop the accessible names are:
Add comment (if no comments exist)
"1 comment" / "X comments" (if comments do exist)
Comments section name after the fix :
Both on mobile and the desktop:
for both cases (if no comments exist)(if no comments exist) below will be the name for the comments section on a feed:
Comments for article ${articleTitle}. ${count} comment(s) so farRelated Tickets & Documents
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note
on the devices and browsers this has been tested on, as well as any relevant
images for UI changes.
UI accessibility concerns?
With this fix accessibility of the site has been improved in the comments section on a feed. now the name of the comment section is more meaningful and conveys a unique message based on the article title and number of comments on the article so far. attached are the screenshots below for mobile and desktop versions:
For Mobile:


For Desktop:


Verified these changes by running a screen reader in local.
Added/updated tests?
have not been included
[Forem core team only] How will this change be communicated?
Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.
Storybook (for Crayons components)
updated. I have filled out the
Changes Requested
issue template so Community Success can help update the Admin Docs
appropriately.
CHANGELOG.mdor in a forem.dev post
replace this line with details on why this change doesn't need to be
shared
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?