docs: fix a11y issues in composition app#683
Conversation
There was a problem hiding this comment.
Pull request overview
This PR targets accessibility improvements in the Composition app by improving responsive layout behavior (notably the navigation sidebar), strengthening keyboard focus management, and improving semantics/contrast across documentation and demo pages.
Changes:
- Implemented a mobile-aware, collapsible navigation sidebar with focus-management behaviors (Escape handling, active-link focus, and post-navigation focus).
- Improved semantic HTML landmarks/structure (e.g., header/main usage and proper table header markup with
scope="col"). - Updated styling for responsiveness and consistency (px → rem conversions, wrapping layouts, overflow handling), and improved color/contrast logic (e.g., text-on-background selection).
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/cps-ui-kit/src/lib/utils/colors-utils.ts | Updates text color selection logic using relative luminance for better contrast decisions. |
| projects/composition/tsconfig.json | Excludes spec files from this tsconfig’s compilation scope. |
| projects/composition/src/variables.scss | Converts key layout variables to rem units. |
| projects/composition/src/styles.scss | Rem-based spacing updates and adds a small-screen padding adjustment. |
| projects/composition/src/app/pages/tree-table-page/tree-table-page.component.scss | Rem-based spacing adjustment. |
| projects/composition/src/app/pages/tooltip-page/tooltip-page.component.scss | Improves layout responsiveness (wrapping + gaps) for tooltip examples. |
| projects/composition/src/app/pages/tooltip-page/tooltip-page.component.html | Reorders markup to match the updated responsive layout groups. |
| projects/composition/src/app/pages/table-page/table-page.component.scss | Rem-based spacing adjustment. |
| projects/composition/src/app/pages/sidebar-menu-page/sidebar-menu-page.component.ts | Adds icon support for the updated info-card UI. |
| projects/composition/src/app/pages/sidebar-menu-page/sidebar-menu-page.component.scss | Replaces plain text with an “info card” style treatment and adjusts layout. |
| projects/composition/src/app/pages/sidebar-menu-page/sidebar-menu-page.component.html | Replaces span description with a semantic/info-card block including an icon. |
| projects/composition/src/app/pages/notification-page/notification-page.component.html | Adjusts notification buttons (icons + color changes) to address contrast/visual issues. |
| projects/composition/src/app/pages/loader-page/loader-page.component.scss | Ensures loader container can shrink to viewport width. |
| projects/composition/src/app/pages/expansion-panel-page/expansion-panel-page.component.scss | Prevents overly narrow layout by enforcing min-width: max-content. |
| projects/composition/src/app/pages/colors-page/colors-page/colors-page.component.scss | Rem-based conversions and breakpoint normalization for responsive layout. |
| projects/composition/src/app/pages/button-page/button-page.component.scss | Allows wrapping + adds gaps for responsive button rows. |
| projects/composition/src/app/components/theme-toggle/theme-toggle.component.scss | Rem-based sizing and replaces outline styling with shared focus-ring() mixin. |
| projects/composition/src/app/components/shared/api-type/api-type.component.scss | Adds focus-visible styling using shared focus-ring() mixin. |
| projects/composition/src/app/components/service-docs-viewer/service-docs-viewer.component.scss | Rem-based spacing tweaks. |
| projects/composition/src/app/components/service-docs-viewer/service-docs-viewer.component.html | Fixes table semantics by adding <tr> in <thead> and scope="col" on headers. |
| projects/composition/src/app/components/navigation-sidebar/navigation-sidebar.component.ts | Adds link-click eventing and active-link focus helper for keyboard UX. |
| projects/composition/src/app/components/navigation-sidebar/navigation-sidebar.component.spec.ts | Adds unit tests covering inert behavior, filtering, click behavior, and focusActiveLink(). |
| projects/composition/src/app/components/navigation-sidebar/navigation-sidebar.component.scss | Adds focus-visible ring, mobile fixed positioning, and rem-based conversions. |
| projects/composition/src/app/components/navigation-sidebar/navigation-sidebar.component.html | Wraps nav in a semantic landmark, uses inert when collapsed, and emits link-click events. |
| projects/composition/src/app/components/component-docs-viewer/component-docs-viewer.component.html | Improves table semantics with <tr> in <thead> and scope="col" on headers. |
| projects/composition/src/app/components/code-example/code-example.component.scss | Rem-based updates and adds horizontal overflow handling for previews. |
| projects/composition/src/app/app.component.ts | Adds mobile breakpoint handling, Escape-to-close, focus management, and sidebar interaction wiring. |
| projects/composition/src/app/app.component.spec.ts | Expands unit tests for mobile/desktop behavior, navigation focus, Escape handling, and sidebar toggling. |
| projects/composition/src/app/app.component.scss | Adds mobile sidebar/backdrop/toggle styling and layout updates. |
| projects/composition/src/app/app.component.html | Introduces semantic <header>/<main>, adds sidebar toggle button + backdrop, and hooks focus behavior. |
Playwright test resultsDetails
|
lukasmatta
left a comment
There was a problem hiding this comment.
Nice work! What do you think about adding PW accessibility tests for the composition app to prevent any future a11y regressions?
release-please supports multiple feats/fixes within one PR (squash commit). I suggest changing the title to |
Coverage report for library
Test suite run success1931 tests passing in 54 suites. Report generated by 🧪jest coverage report action from 469c595 |
Yes, I created a follow-up work item #685 |
Overview
This PR addresses accessibility issues in the Composition app.
Changes
The PR is marked as a feature because it introduces changes to the
getTextColorfunction in color utils.Additional info
There is an issue with
ArtiomTr/jest-coverage-report-actionwhere it now fails with:HttpError: Invalid response body while trying to fetch https://api.github.com/repos/AbsaOSS/cps-shared-ui/pulls/<number>: Premature close.More details can be found here:
ArtiomTr/jest-coverage-report-action#452
As a temporary workaround,
continue-on-error: truehas been added to the "Comment coverage on PR" step to unblock the pipeline.Release notes: