Skip to content

Fix a11y issues in timepicker component#636

Open
fateeand wants to merge 1 commit into
masterfrom
598-fix-a11y-issues-in-timepicker-component
Open

Fix a11y issues in timepicker component#636
fateeand wants to merge 1 commit into
masterfrom
598-fix-a11y-issues-in-timepicker-component

Conversation

@fateeand
Copy link
Copy Markdown
Collaborator

Fixing accessibility issues in timepicker 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 button-name color-contrast label tabindex
Timepicker - -

State after:

Component aria-roles button-name color-contrast label tabindex
Timepicker

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.
  • 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.
  • 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.
  • 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.

Additional changes

  • Updated tsconfig.spec.json since npm run generate-json-api was failing with [error] Unable to find any entry points. The root tsconfig has "files": [], so TypeDoc requires the tsconfig to explicitly include those files.

  • Added composition/tsconfig.json since cps-ui-kit couldn't be found by TS within composition app. VSCode's language server finds "files: []" and since the component file isn't explicitly included, it treats it as an inferred project which doesn't inherit the paths mapping.


Release notes:

  • Fix a11y issues in timepicker component

Copilot AI review requested due to automatic review settings May 20, 2026 18:03
@fateeand fateeand linked an issue May 20, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

Coverage report for library

St.
Category Percentage Covered / Total
🔴 Statements 42.51% 2950/6939
🔴 Branches 37.76% 1279/3387
🔴 Functions 41.57% 562/1352
🔴 Lines 43.11% 2758/6398

Test suite run success

898 tests passing in 31 suites.

Report generated by 🧪jest coverage report action from 85b4477

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 focuses on resolving accessibility gaps in CpsTimepickerComponent, re-enabling automated a11y coverage for the component, and adjusting TypeScript project configs to support API generation and editor tooling.

Changes:

  • Added ariaLabel support to the timepicker and propagated usage updates where the component is embedded (e.g., scheduler).
  • Introduced comprehensive unit tests for CpsTimepickerComponent and re-enabled its Playwright axe scan.
  • Updated TypeScript config files to fix documentation/API generation entry-point detection and composition app path resolution.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsconfig.generator.json Adds explicit include roots for generator/TypeDoc entry points.
projects/cps-ui-kit/src/lib/components/cps-timepicker/cps-timepicker.component.ts Adds ariaLabel input + runtime a11y warning.
projects/cps-ui-kit/src/lib/components/cps-timepicker/cps-timepicker.component.html Updates timepicker field labeling and sizing (rem units).
projects/cps-ui-kit/src/lib/components/cps-timepicker/cps-timepicker.component.scss Converts select spacing/sizing from px to rem.
projects/cps-ui-kit/src/lib/components/cps-timepicker/cps-timepicker.component.spec.ts Adds unit test coverage for timepicker behavior and validation.
projects/cps-ui-kit/src/lib/components/cps-scheduler/cps-scheduler.component.html Provides ariaLabel to embedded timepickers.
projects/composition/tsconfig.json Adds a composition app tsconfig to ensure path mappings work in tooling.
projects/composition/src/app/pages/timepicker-page/timepicker-page.component.scss Converts layout gap from px to rem.
projects/composition/src/app/api-data/cps-timepicker.json Documents the new ariaLabel prop.
playwright/cps-accessibility.spec.ts Re-enables axe scan for the timepicker route.

Comment on lines +229 to +233
ngOnChanges(): void {
if (!this.label?.trim() && !this.ariaLabel?.trim()) {
console.error(
'CpsTimepickerComponent: unlabeled timepicker component must have an ariaLabel for accessibility.'
);
Comment on lines 42 to +46
<cps-autocomplete
#minutesField
ariaLabel="Minutes"
(keypress)="numberOnly($event)"
width="60"
width="3.75rem"
@github-actions
Copy link
Copy Markdown

Playwright test results

passed  72 passed

Details

stats  72 tests across 4 suites
duration  2 minutes, 16 seconds
commit  85b4477
info  For details, download the Playwright report

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 timepicker component

2 participants