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

Deseng 617 screen reader improvements #2549

Merged
merged 8 commits into from
Jul 2, 2024
Merged

Deseng 617 screen reader improvements #2549

merged 8 commits into from
Jul 2, 2024

Conversation

Baelx
Copy link
Collaborator

@Baelx Baelx commented Jun 29, 2024

Issue #: https://citz-gdx.atlassian.net/browse/DESENG-617

Description of changes:

  • Update markup to be more semantic
  • Improve aria labelling
  • Add aria live announcer for dynamic search result updates

@Baelx Baelx requested a review from NatSquared June 29, 2024 00:03
@@ -22,6 +22,7 @@ const BannerWithImage = ({ height, imageUrl, children }: BannerProps) => {
>
<img
src={imageUrl}
alt="Banner Image"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This looks like an edit Ratheesh had made. Will be removing most likely

@@ -48,6 +49,10 @@ const FilterBlock = () => {
return () => setDidMount(false);
}, []);

useEffect(() => {
console.log('search', searchFilters);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will remove!

@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.94%. Comparing base (ae08700) to head (5b55440).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2549   +/-   ##
=======================================
  Coverage   75.94%   75.94%           
=======================================
  Files         608      608           
  Lines       21991    21997    +6     
  Branches     1709     1710    +1     
=======================================
+ Hits        16700    16706    +6     
  Misses       5028     5028           
  Partials      263      263           
Flag Coverage Δ
metweb 64.73% <91.66%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
met-web/src/components/common/Input/Button.tsx 94.18% <ø> (ø)
met-web/src/components/landing/FilterBlock.tsx 75.00% <100.00%> (+0.71%) ⬆️
met-web/src/components/landing/FilterDrawer.tsx 48.00% <ø> (ø)
met-web/src/components/landing/TileBlock.tsx 91.66% <90.00%> (+1.66%) ⬆️

Copy link
Contributor

@NatSquared NatSquared left a comment

Choose a reason for hiding this comment

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

Thanks for your work on improving accessibility :) just one major thing to address with the <ul>/<li> elements and I think you're good to go

</MuiButton>
<If condition={searchFilters.status.length || searchFilters.metadata.length}>
<Then>
<MuiButton
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use <When> from react-if here instead for concision

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do ! Thanks


const TileBlock = () => {
const { engagements, loadingEngagements, totalEngagements, page, setPage } = useContext(LandingContext);
const { engagements, loadingEngagements, totalEngagements } = useContext(LandingContext);
const [ariaStatusMessage, setAriaStatusMessage] = useState(`Results updated. ${totalEngagements} results`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Love the live feedback for screen reader users

met-web/src/components/landing/TileBlock.tsx Show resolved Hide resolved
component="ul"
item
container
xs={12}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we creating a series of <ul>s with only 1 child each? I feel like it would make more sense if the parent component was a ul and this element was the li

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're definitely right. I think things got a bit garbled when I merged from main. We had a lot of intersecting code. Will fix thanks!

@@ -57,7 +57,12 @@ const PublicHeader = () => {
{headerTitle}
</Header1>
<When condition={isLoggedIn}>
<Button color="inherit" onClick={() => UserService.doLogout()}>
<Button
role="button"
Copy link
Contributor

Choose a reason for hiding this comment

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

This element already renders as a , but it doesn't really matter because this When condition will never be true while a user is being shown the public header.

@@ -54,63 +58,47 @@ const TileBlock = () => {
xs={10}
>
<NoResult />
<ul tabIndex={0} aria-label="Engagements list. No results."></ul>
Copy link
Contributor

Choose a reason for hiding this comment

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

Text elements should generally not have tabIndex set on them - screen readers can navigate text on their own

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link

sonarcloud bot commented Jul 2, 2024

Copy link
Contributor

@NatSquared NatSquared left a comment

Choose a reason for hiding this comment

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

Looks good; thanks for addressing my comments!

@Baelx Baelx merged commit 9c158c6 into main Jul 2, 2024
8 checks passed
@Baelx Baelx deleted the DESENG-617-ScreenReader branch July 2, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants