feat(dockview-core): WAI-ARIA roles and states for tabs, groups and floating groups#1314
Merged
Conversation
…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>
|
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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
role="tablist"witharia-orientationthat follows the header direction (horizontal / vertical).role="tab",aria-selected(kept in sync with the active panel), andaria-controlspointing at the group's content area.role="tabpanel"witharia-labelledbypointing at the active tab.role="region"labelled by the active panel's title; the label updates when the active panel changes or is retitled.role="dialog"witharia-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
Taband content container is given a stable, namespaced DOM id soaria-controls/aria-labelledbycan reference each other.Tabsexposes agetTabIdlookup; the group model owns thearia-labelledbyupdate on activation.group.modelaccess is guarded (the unit tests construct tabs with mock groups), matching the existing defensive style in this code.Testing
accessibility.spec.tscovering the roles, the tab ↔ tabpanel relationships, reactivearia-selected/aria-labelledby, the region label (activation + title change), and the floating dialog role.dockview-coresuite green (1035 tests), typecheck clean, no new lint errors.🤖 Generated with Claude Code