-
Notifications
You must be signed in to change notification settings - Fork 4
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
Jl/accessibility hotspots #278
Conversation
There was a problem hiding this 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 aims to enhance accessibility and improve UX in the publication components. Key changes include:
- Replacing the deprecated DOMSubtreeModified event with a MutationObserver in the paged publication component.
- Introducing a new binding for the Enter key in the controls and viewer components.
- Updating hotspot element semantics to use a button element with appropriate ARIA attributes and refreshing locale translation entries.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
lib/kits/core-ui/paged-publication.ts | Replaces deprecated event listener with a MutationObserver for monitoring progress changes. |
lib/kits/paged-publication/controls.ts | Adds handling for the Enter key to trigger navigation or custom events. |
locales/sv_SE.ts, da_DK.ts, en_US.ts, nb_NO.ts | Updates translation keys to support the new accessibility features and UI texts. |
lib/kits/paged-publication/hotspots.ts | Changes hotspot elements from div to button and adds ARIA labels using translations. |
lib/kits/core-ui/components/common/offer-overview.ts | Enhances the offer overview template with improved accessibility attributes. |
lib/kits/paged-publication/viewer.ts | Adds a new event binding and enterKeyPressed handler for hotspot selection via keyboard. |
lib/key-codes.ts | Introduces an export for the Enter key code. |
Comments suppressed due to low confidence (1)
lib/kits/paged-publication/hotspots.ts:101
- [nitpick] The local variable name 'translations' may be misleading in this context; consider renaming it to 'priceForText' to better reflect its purpose.
const translations = { for: translate('publication_viewer_offer_price_for') };
There was a problem hiding this 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 accessibility improvements and additional keyboard navigation support for the paged publication viewer along with some related cleanup changes. Key changes include:
- Adding MutationObservers to track UI changes and ensuring proper cleanup via a destroy callback.
- Enhancing accessibility by using appropriate aria labels and replacing non-interactive elements with interactive ones (e.g., converting a div to a button for hotspots).
- Adding support for keyboard ENTER key events and updating locale translation strings accordingly.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
lib/kits/core-ui/paged-publication.ts | Adds MutationObservers and a destroy callback to handle cleanup properly. |
lib/kits/paged-publication/controls.ts | Introduces new keyboard handling for the ENTER key event. |
lib/kits/core-ui/components/common/offer-overview.ts | Updates templates with aria-labels for improved accessibility. |
locales/* | Adds new translation keys for quantity increase/decrease and price wording. |
lib/kits/paged-publication/hotspots.ts | Uses a button element instead of a div for hotspots to boost accessibility. |
lib/kits/paged-publication/viewer.ts | Adds a new event binding for handling ENTER key presses. |
lib/key-codes.ts | Adds export for the ENTER key code. |
lib/kits/core-ui/components/common/header.ts | Includes a destroy callback invocation on closing the publication. |
No description provided.