Skip to content

feat(dockview-core): WAI-ARIA roles and states for tabs, groups and floating groups#1314

Merged
mathuo merged 2 commits into
masterfrom
feat/a11y-aria-baseline
Jun 10, 2026
Merged

feat(dockview-core): WAI-ARIA roles and states for tabs, groups and floating groups#1314
mathuo merged 2 commits into
masterfrom
feat/a11y-aria-baseline

Conversation

@mathuo

@mathuo mathuo commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the baseline WAI-ARIA semantics to the dockview layout so screen-reader and assistive-technology users can understand the tab/group structure. Previously tabs were focusable but exposed no roles, states or relationships.

Changes

  • Tab striprole="tablist" with aria-orientation that follows the header direction (horizontal / vertical).
  • Tabsrole="tab", aria-selected (kept in sync with the active panel), and aria-controls pointing at the group's content area.
  • Content arearole="tabpanel" with aria-labelledby pointing at the active tab.
  • Groupsrole="region" labelled by the active panel's title; the label updates when the active panel changes or is retitled.
  • Floating groupsrole="dialog" with aria-modal="false" (non-modal).

All attributes are wired through the existing activation path (doSetActivePanel) and the panel title-change event, so the relationships stay correct as panels are activated, retitled, moved and floated.

Implementation notes

  • Each Tab and content container is given a stable, namespaced DOM id so aria-controls / aria-labelledby can reference each other. Tabs exposes a getTabId lookup; the group model owns the aria-labelledby update on activation.
  • Constructor-time group.model access is guarded (the unit tests construct tabs with mock groups), matching the existing defensive style in this code.
  • Floating dialogs currently expose role + modality; a dynamic accessible name can follow separately.

Testing

  • New accessibility.spec.ts covering the roles, the tab ↔ tabpanel relationships, reactive aria-selected / aria-labelledby, the region label (activation + title change), and the floating dialog role.
  • Full dockview-core suite green (1035 tests), typecheck clean, no new lint errors.

🤖 Generated with Claude Code

mathuo and others added 2 commits June 9, 2026 23:01
…d floating groups

Expose the baseline accessibility semantics for the docking layout so
assistive technology can understand the tab/group structure. Previously
tabs were focusable but carried no roles, states or relationships.

- tab strip: role="tablist" + aria-orientation (follows header direction)
- tabs: role="tab", aria-selected, aria-controls -> content area
- content: role="tabpanel", aria-labelledby -> active tab
- groups: role="region" labelled by the active panel title
  (updates on activation and on title change)
- floating groups: role="dialog" with aria-modal="false"

Roles and states are wired through the existing activation seam
(doSetActivePanel) and the panel title-change event, so aria-selected and
the region/tabpanel relationships stay correct as panels are activated,
retitled, moved and floated.

Adds accessibility.spec.ts covering the roles, relationships and reactivity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@mathuo mathuo merged commit efb738f into master Jun 10, 2026
9 checks passed
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.

1 participant