Skip to content

feat: fix a11y issues in expansion panel component#654

Merged
fateeand merged 4 commits into
masterfrom
586-fix-a11y-issues-in-expansion-panel-component
Jun 10, 2026
Merged

feat: fix a11y issues in expansion panel component#654
fateeand merged 4 commits into
masterfrom
586-fix-a11y-issues-in-expansion-panel-component

Conversation

@fateeand

@fateeand fateeand commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Fixing accessibility issues in expansion panel component

Validation rules:

Validated using Playwright accessibility tests, Lighthouse tool, and manual checks including keyboard tab navigation and screen reader testing.

Full doc with rules


Playwright axe-core validation results:

State before:

Component aria-roles color-contrast tabindex target-size
Expansion panel - - -

State after:

Component aria-roles color-contrast tabindex target-size
Expansion panel

Checklist

  • Keyboard Navigation
    All interactive elements are fully operable via keyboard only, including buttons, inputs, menus, dialogs, sliders, drag-and-drop, tree views, multi-selects, and composite widgets. No traps or dead ends.

  • Focus Management
    Focus is visible, logical, moves in predictable order, trapped where necessary (modals/popovers), and restored after closing. Focus is perceivable in all interactive widgets.

  • Semantics / ARIA

    • Semantic HTML is used correctly.
    • ARIA roles, states, and properties are applied only when needed.
    • All form fields, tables, and widgets (including autocomplete, tree selects, tree tables, drag-and-drop, sliders, and multi-selects) are properly labeled and accessible.
  • Color / Contrast

    • Text and interactive elements meet contrast requirements (≥4.5:1 normal text, ≥3:1 large text).
    • Focus and selection indicators are visually perceivable.
    • Color is not the only indicator of state.
  • Screen Reader / Assistive Technology

    • All content, labels, and dynamic updates are perceivable via screen readers.
    • Live regions announce status messages, alerts, modals, notifications, and dynamic changes.
    • Interactive widgets provide proper announcements of selection and updates.
  • Responsive & Zoom

    • Components function correctly and remain readable at all viewport sizes and up to 200% zoom, including mobile and touch devices.
    • Prefer em/rem units over px where scaling is required.
  • [N/A] Error Handling

    • Errors are clearly identified visually and programmatically.
    • Form inputs use aria-describedby or aria-invalid for inline messages.
    • Instructions and suggestions are accessible.
  • [N/A] Dynamic Content / Updates

    • Status updates, alerts, notifications, and modals use live regions.
    • Updates do not disrupt focus or user control unexpectedly.
  • Interaction Feedback / States

    • All interactive states (hover, focus, active, disabled, drag-and-drop, reordering, multi-select) are visually perceivable.
  • [N/A] Authentication & Sensitive Actions

    • Inputs and actions involving sensitive data provide accessible instructions, feedback, and error messages.
  • Predictable & Controllable UI

    • Components behave consistently and predictably.
    • Popups, modals, autocomplete suggestions, drag-and-drop, and dynamic content allow user control.

Release notes:

  • Fix a11y issues in expansion panel component

@fateeand fateeand linked an issue Jun 4, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Coverage report for library

St.
Category Percentage Covered / Total
🔴 Statements 48.49% 3542/7305
🔴 Branches 44.61% 1590/3564
🔴 Functions 46.96% 664/1414
🔴 Lines 49.06% 3300/6726

Test suite run success

1208 tests passing in 34 suites.

Report generated by 🧪jest coverage report action from 937bf7e

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  88 passed

Details

stats  88 tests across 4 suites
duration  3 minutes, 2 seconds
commit  937bf7e
info  For details, download the Playwright report

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the accessibility of CpsExpansionPanelComponent by adding proper ARIA semantics, keyboard interaction handling, and focus styling, and then re-enables automated Playwright axe validation for the expansion panel example page.

Changes:

  • Add ARIA roles/attributes (role="button", aria-expanded, aria-controls, aria-hidden) and keyboard handlers to the expansion panel header/content.
  • Update styling to include an accessible focus ring and switch several hard-coded px values to rem.
  • Expand unit test coverage for new accessibility behavior and re-enable the expansion panel in Playwright accessibility scans.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
projects/cps-ui-kit/src/lib/components/cps-expansion-panel/cps-expansion-panel.component.ts Adds unique content IDs, keyboard interaction state, and runtime conversions for style inputs.
projects/cps-ui-kit/src/lib/components/cps-expansion-panel/cps-expansion-panel.component.html Adds ARIA semantics and keyboard event wiring; switches to converted style inputs.
projects/cps-ui-kit/src/lib/components/cps-expansion-panel/cps-expansion-panel.component.scss Adds focus-visible styling via shared focus-ring mixin; converts sizing from px to rem.
projects/cps-ui-kit/src/lib/components/cps-expansion-panel/cps-expansion-panel.component.spec.ts Updates defaults and adds tests for ARIA attributes, keyboard interaction, and unique IDs.
projects/composition/src/app/pages/expansion-panel-page/expansion-panel-page.component.ts Imports CpsButtonComponent for the updated example content.
projects/composition/src/app/pages/expansion-panel-page/expansion-panel-page.component.html Updates examples (adds a button; switches some values to rem-based inputs).
projects/composition/src/app/pages/expansion-panel-page/expansion-panel-page.component.scss Converts example layout spacing from px to rem.
projects/composition/src/app/api-data/cps-expansion-panel.json Updates API docs description for borderRadius.
playwright/cps-accessibility.spec.ts Re-enables expansion panel route in axe scanning list with a page-scoped selector.

@fateeand fateeand merged commit 70acf37 into master Jun 10, 2026
11 checks passed
@fateeand fateeand deleted the 586-fix-a11y-issues-in-expansion-panel-component branch June 10, 2026 08:50
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.

Fix a11y issues in expansion panel component

3 participants