Page MenuHomePhabricator

Improve Accessibility (A11y) Across All Pages
Closed, ResolvedPublic

Description

Domain: Design / UI-UX / Coding

Difficulty: Difficult

Description:
Conduct a comprehensive accessibility audit and implement fixes for WCAG 2.1 AA compliance:

  • Add proper ARIA labels and roles to interactive elements
  • Implement keyboard navigation throughout the site
  • Improve color contrast ratios (test with contrast checker)
  • Add focus indicators for keyboard users
  • Implement proper heading hierarchy
  • Add skip navigation links
  • Improve form accessibility with proper labels
  • Add alt text to all images
  • Test with screen readers (NVDA, JAWS)
  • Document accessibility patterns used

Expected Outcome:

  • WCAG 2.1 AA compliance
  • Keyboard navigation is functional on all pages
  • All interactive elements have proper ARIA labels
  • Color contrast meets standards
  • Focus indicators visible
  • Screen reader compatible
  • Accessibility documentation

Setup Steps:

  1. Install accessibility testing tools:
    • npm install --save-dev axe-core axe-playwright.
    • Use Lighthouse DevTools audit
  2. Run automated accessibility tests
  3. Test with keyboard navigation (Tab, Enter, Space, Arrow keys)
  4. Update components with ARIA labels
  5. Fix color contrast issues in CSS
  6. Add skip links to src/components/layout/header.tsx.
  7. Improve form accessibility
  8. Test with screen reader (NVDA on Windows)
  9. Document patterns in README

Links/References:

Event Timeline

Change #1217864 had a related patch set uploaded (by NkwadaNora; author: NkwadaNora):

[labs/tools/WdTmCollab@main] Implement WCAG 2.1 AA accessibility improvements: Add skip navigation link for keyboard users, Implement proper ARIA labels and roles throughout, Add visible focus indicators (2px blue outline), Ensure keyboard navigation on all interactive elements, Add screen reader support with semantic HTML, Implement reduced motion support, Add accessibility documentation to README. Bug: T412368

https://gerrit.wikimedia.org/r/1217864

Change #1217869 had a related patch set uploaded (by NkwadaNora; author: NkwadaNora):

[labs/tools/WdTmCollab@main] This patch covers WCAG 2.1 AA accessibility improvements by: Adding a skip navigation link for keyboard users, Implemented proper ARIA labels and roles throughout, also added visible focus indicators, ensured keyboard navigation on all interactive elements, added screen reader support with semantic HTML, implemented reduced motion support, and lastly added the accessibility documentation in detail to the README. Bug: T412368

https://gerrit.wikimedia.org/r/1217869

Change #1217869 had a related patch set uploaded (by Wandji collins; author: NkwadaNora):

[labs/tools/WdTmCollab@main] This patch covers WCAG 2.1 AA accessibility improvements.

https://gerrit.wikimedia.org/r/1217869

Change #1217869 had a related patch set uploaded (by NkwadaNora; author: NkwadaNora):

[labs/tools/WdTmCollab@main] This patch covers WCAG 2.1 AA accessibility improvements by: Adding a skip navigation link for keyboard users, Implemented proper ARIA labels and roles throughout, also added visible focus indicators, ensured keyboard navigation on all interactive elements, added screen reader support with semantic HTML, implemented reduced motion support, and lastly added the accessibility documentation in detail to the README. Bug: T412368

https://gerrit.wikimedia.org/r/1217869

Change #1217869 had a related patch set uploaded (by Wandji collins; author: NkwadaNora):

[labs/tools/WdTmCollab@main] This patch covers WCAG 2.1 AA accessibility improvements by:

https://gerrit.wikimedia.org/r/1217869

Change #1217869 merged by jenkins-bot:

[labs/tools/WdTmCollab@main] This patch covers WCAG 2.1 AA accessibility improvements by:

https://gerrit.wikimedia.org/r/1217869

Change #1217864 abandoned by Wandji collins:

[labs/tools/WdTmCollab@main] Implement WCAG 2.1 AA accessibility improvements: Add skip navigation link for keyboard users, Implement proper ARIA labels and roles throughout, Add visible focus indicators (2px blue outline), Ensure keyboard navigation on all interactive elements, Add screen reader support with semantic HTML, Implement reduced motion support, Add accessibility documentation to README. Bug: T412368

https://gerrit.wikimedia.org/r/1217864

@Collins was going through the codebase and realised this ticket has not been completed.
I have reviewed the codebase against the ticket requirements. While the semantic HTML structure and ARIA implementation in the Search component are excellent, several acceptance criteria listed in the Description and Setup Steps are not fully met.

  1. Missing Testing Dependencies (Setup Step #1) The ticket explicitly required installing automation tools. The package.json file does not contain axe-core or axe-playwright.

Action: Run npm install --save-dev axe-core axe-playwright and ensure they are committed.

  1. Skip Navigation Not Integrated (Expected Outcome) The SkipNav component was created, but it is dead code. It is not imported or rendered in src/components/layout/header.tsx.

Action: Import and place <SkipNav /> as the first element in the Header component.

  1. Missing Focus Indicators on Interactive Cards The FeatureCard (Home), ActorCard, and other Link-wrapped block elements have hover styles but lack focus styles. Keyboard users cannot see which card is selected when tabbing.

Action: Add standard focus utilities to these components (e.g., focus:outline-none focus:ring-2 focus:ring-blue-600).

  1. Missing Documentation The ticket requires "Accessibility documentation" in the README.
  1. The Search Component does not use the hook that was implemented

Production Detail Page: The "Find Actors in Common" <select> element is missing an explicit aria-label or <label> tag.

You can look into it and see, I think, maybe during merge conflicts, what she might have been omitted.

@Collins was going through the codebase and realised this ticket has not been completed.
I have reviewed the codebase against the ticket requirements. While the semantic HTML structure and ARIA implementation in the Search component are excellent, several acceptance criteria listed in the Description and Setup Steps are not fully met.

  1. Missing Testing Dependencies (Setup Step #1) The ticket explicitly required installing automation tools. The package.json file does not contain axe-core or axe-playwright.

Action: Run npm install --save-dev axe-core axe-playwright and ensure they are committed.

  1. Skip Navigation Not Integrated (Expected Outcome) The SkipNav component was created, but it is dead code. It is not imported or rendered in src/components/layout/header.tsx.

Action: Import and place <SkipNav /> as the first element in the Header component.

  1. Missing Focus Indicators on Interactive Cards The FeatureCard (Home), ActorCard, and other Link-wrapped block elements have hover styles but lack focus styles. Keyboard users cannot see which card is selected when tabbing.

Action: Add standard focus utilities to these components (e.g., focus:outline-none focus:ring-2 focus:ring-blue-600).

  1. Missing Documentation The ticket requires "Accessibility documentation" in the README.
  1. The Search Component does not use the hook that was implemented

Production Detail Page: The "Find Actors in Common" <select> element is missing an explicit aria-label or <label> tag.

You can look into it and see, I think, maybe during merge conflicts, what she might have been omitted.

The ticket was implemented and merge if you can check the patch link, you should see this. I am sure this issue comes from a merge conflict, and someone has overridden the implementation.

This comment was removed by Essa237.

@Collins @Collins, I checked the patch and even downloaded it. All that was trashed is
Met requirement

  • Heading Hierarchy: You have excellent structure (h1 -> h2 -> h3) across all pages.
  • Alt Text: All img tags utilise dynamic alt text (e.g., alt={actor.name ?? "actor image"}).
  • Search Component Accessibility: This is the strongest part of the code, implemented role="combobox", aria-expanded, aria-activedescendant patterns, and sr-only labels correctly.
  • Semantic HTML: Good use of <main>, <nav>, <header>, and <footer>.

What I think is lacking
Testing Tools are Missing The ticket explicitly required installing accessibility tools. Your package.json does not list axe-core or axe-playwright.

  • Action: Run npm install --save-dev axe-core axe-playwright
  • Skip Navigation is Not Integrated. A SkipNav component definition was provided in your snippets, but it is not imported or rendered in the Header.tsx file you provided.
  • Action: Import <SkipNav /> in src/components/layout/header.tsx (or your Root Layout) and place it as the very first element.
  • Interactive Cards Lack Focus Indicators While your buttons and inputs have focus states, the clickable cards (like FeatureCard in ActorCollaboratorsPage and ActorCard) rely on browser defaults, which are often insufficient for AA compliance, especially when hover styles are custom.
  • Evidence: ActorCollaboratorsPage uses hover: bg-grey-50 but has no focus: utilities.
  • Action: Add focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2 to these Link wrappers.

Areas for Improvement (Near Compliance)

  1. Form Labelling (Production Detail Page)

Issue: In ProductionDetailPage, the <select> element for "Find Actors in Common" lacks an explicit label.

Fix: Add aria-label="Select a production to compare" to the <select> tag, or wrap the text "Select another production..." in a <label> tag with an htmlFor matching the select's ID.

  1. Documentation

Issue: The ticket requires "Document accessibility patterns used" in a README. claims features exist (like Skip Navigation) that are not actually hooked up in the code you shared earlier.
Fix: Ensure a section in your README.md details how to use the SkipNav and the ARIA patterns implemented in the Search component.

@Collins @Collins, I checked the patch and even downloaded it. All that was trashed is
Met requirement

  • Heading Hierarchy: You have excellent structure (h1 -> h2 -> h3) across all pages.
  • Alt Text: All img tags utilise dynamic alt text (e.g., alt={actor.name ?? "actor image"}).
  • Search Component Accessibility: This is the strongest part of the code, implemented role="combobox", aria-expanded, aria-activedescendant patterns, and sr-only labels correctly.
  • Semantic HTML: Good use of <main>, <nav>, <header>, and <footer>.

What I think is lacking
Testing Tools are Missing The ticket explicitly required installing accessibility tools. Your package.json does not list axe-core or axe-playwright.

  • Action: Run npm install --save-dev axe-core axe-playwright
  • Skip Navigation is Not Integrated. A SkipNav component definition was provided in your snippets, but it is not imported or rendered in the Header.tsx file you provided.
  • Action: Import <SkipNav /> in src/components/layout/header.tsx (or your Root Layout) and place it as the very first element.
  • Interactive Cards Lack Focus Indicators While your buttons and inputs have focus states, the clickable cards (like FeatureCard in ActorCollaboratorsPage and ActorCard) rely on browser defaults, which are often insufficient for AA compliance, especially when hover styles are custom.
  • Evidence: ActorCollaboratorsPage uses hover: bg-grey-50 but has no focus: utilities.
  • Action: Add focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2 to these Link wrappers.

Areas for Improvement (Near Compliance)

  1. Form Labelling (Production Detail Page)

Issue: In ProductionDetailPage, the <select> element for "Find Actors in Common" lacks an explicit label.

Fix: Add aria-label="Select a production to compare" to the <select> tag, or wrap the text "Select another production..." in a <label> tag with an htmlFor matching the select's ID.

  1. Documentation

Issue: The ticket requires "Document accessibility patterns used" in a README. claims features exist (like Skip Navigation) that are not actually hooked up in the code you shared earlier.
Fix: Ensure a section in your README.md details how to use the SkipNav and the ARIA patterns implemented in the Search component.

Let's have a different ticket for this and handle all these improvements there.