Content
View differences
Updated by Alexander Coles 8 days ago
## Context
`Primer::Alpha::ActionList#before_render` assigns `aria-labelledby = heading.title_id` unconditionally whenever a heading is present (`openproject-primer_view_components` 0.91.1, `app/components/primer/alpha/action_list.rb:178`). Accessible-name computation follows `aria-labelledby` references even when the referenced element is hidden, so a group rendered with a hidden heading is still announced under that heading's heading's text.
Found during #AGILE-364: the Backlogs card ActionMenu renders its batch group heading with `hidden: true` for a one-card scope, yet screen readers announce the group as "0 "0 selected work packages" packages" (or a stale count after a batch collapses). #AGILE-364 ships a client-side workaround that strips and restores the attribute; that workaround should become unnecessary.
## Goal
Fix the fork (`opf/primer_view_components`) so a hidden heading never contributes an accessible group name, and propose the same change upstream to `primer/view_components`. Either omit `aria-labelledby` (and `aria-describedby` for a hidden subtitle) while the heading is hidden, or hide the heading in an accname-safe way; a heading revealed at runtime must get its naming relationship back without a re-render.
## Acceptance criteria
* - A group whose heading is rendered hidden exposes no accessible name or description derived from that heading.
*
- Revealing the heading restores the `aria-labelledby`/`aria-describedby` relationships without server round-trip.
*
- Component/system test coverage for the hidden and revealed states, including accessible-name assertions.
*
- PR opened against `opf/primer_view_components`;
* issue or PR filed against `primer/view_components` referencing the accname behavior.
- Follow-up note on #AGILE-364 (or its successor) so the client-side attribute workaround can be removed once the fix ships.
`Primer::Alpha::ActionList#before_render` assigns `aria-labelledby = heading.title_id` unconditionally whenever a heading is present (`openproject-primer_view_components` 0.91.1, `app/components/primer/alpha/action_list.rb:178`). Accessible-name computation follows `aria-labelledby` references even when the referenced element is hidden, so a group rendered with a hidden heading is still announced under that heading's
## Goal
Fix the fork (`opf/primer_view_components`) so a hidden heading never contributes an accessible group name, and propose the same change upstream to `primer/view_components`. Either omit `aria-labelledby` (and `aria-describedby` for a hidden subtitle) while the heading is hidden, or hide the heading in an accname-safe way; a heading revealed at runtime must get its naming relationship back without a re-render.
## Acceptance criteria
*
*
-
*
-
*
-
*
-