Problem/Motivation
The rendered comment tree does not meet WCAG 2.1 A in several respects, and a partial tree is worse than no tree. The tree is partial (10 of N roots, lazy branches) but does not expose set size or position, has no accessible name, and comments have no headings. Other issues: no skip link, duplicated announcements, an aria-label on a generic div, and errors announced politely rather than assertively.
Steps to reproduce
- Open a thread with a screen reader.
- Traverse the tree: note a group of 216 announces as "1 of 10" with no set size or position.
- Attempt to bypass the comment block: no skip link exists.
Proposed resolution
- Add aria-setsize and aria-posinset to treeitems.
- Name the tree (role=tree) and each comment (role=heading or a heading element).
- Add a skip link before the comment block.
- Use role=alert for submission errors; avoid announcing to both Drupal.announce and the module's live region.
- Replace the aria-label on the generic status div with a semantic role.
- Do not point aria-describedby at the empty breadcrumb paragraph on root-level filter results, which currently leaves a dangling reference and adds dead vertical space per result.
- Use :focus rather than :focus-visible on the programmatically focused tabindex=-1 landing targets (.act-comment-approval and [data-act-pending]); :focus-visible generally does not match script-focused non-natively-focusable elements, so focus currently moves with no visible indicator after approving a comment.
Remaining tasks
- Verify with a screen reader and automated a11y checks.
User interface changes
Screen-reader-visible structure and announcements; no visual layout change.
API changes
None anticipated.
Data model changes
None anticipated.
AI-Generated: Yes (Used Opus 5 and DeepSeek Flash to review and discover these issues)
Comments
Comment #8
freelockFixed - followup issue in #3623886: Delivered comments report incorrect positions within their sibling group.