feat(dockview-core): a11y polish — tab keyboard navigation + floating dialog name#1316
Merged
Conversation
…Tabs pattern) Make the tab strip operable by keyboard, completing the ARIA Tabs pattern whose roles/states already ship: - roving tabindex — only the active tab is in the tab order; the rest are reachable via arrow keys (anchored to the active tab, moves with focus) - Arrow keys move focus along the strip (Left/Right for horizontal strips, Up/Down for vertical, following aria-orientation), clamped at the ends - Home / End jump to the first / last tab - Enter / Space activate the focused tab (manual activation — arrowing moves focus only, so it doesn't switch panels until committed) The keydown handler lives on the tablist and only acts when a tab element itself is focused, so it never hijacks keys typed inside a custom tab renderer's own controls. Focus movement between groups and keyboard docking are out of scope here. Extends accessibility.spec.ts with roving-tabindex, arrow/Home/End, clamping, manual-activation and Enter/Space coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Name the floating-group dialog (role="dialog", added previously) from its representative group's active panel title, refreshed when the active panel changes. An untitled panel leaves the dialog unnamed rather than hard-coding a label string (no i18n surface). Resolves the accessible-name gap left when the dialog role was introduced. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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.



Description
Two small accessibility improvements that complete the WAI-ARIA baseline shipped in #1314.
1. Tab strip keyboard navigation (WAI-ARIA Tabs pattern)
Makes the tab strip operable by keyboard:
aria-orientation), clamped at the ends.The keydown handler lives on the tablist and only acts when a tab element itself is focused, so it never hijacks keys typed inside a custom tab renderer's controls. Focus movement between groups (F6/spatial) and keyboard docking are intentionally out of scope.
2. Floating-group dialog accessible name
The floating-group dialog (
role="dialog", from #1314) now gets an accessible name from its representative group's active panel title, refreshed when the active panel changes. An untitled panel leaves the dialog unnamed rather than hard-coding a label string — no i18n surface introduced.Type of change
Affected packages
dockview-coreHow to test
accessibility.spec.tsadds a "tab keyboard navigation" suite (roving tabindex, arrow nav, end-clamping, Home/End, manual activation, Enter/Space) and a floating-dialog accessible-name test.Checklist
yarn testpasses (fulldockview-coresuite: 1051)npm run gen— no diff (no new public exports)Note on the one behaviour change
Roving tabindex means inactive tabs are no longer individually Tab-reachable (they move from
tabindex="0"to"-1"); you Tab to the strip once and arrow within it. This is the standard ARIA Tabs behaviour and the correct pairing for the roles shipped in #1314, but it is a (minor, conformant) change to keyboard tab-order.Deliberately not included
Other "polish" ideas were left out because each introduces either a hardcoded i18n string or new public API, which deserve a deliberate decision rather than slipping in: a tablist accessible name (
"Tabs"), a tab close-button label ("Close"), andDelete-to-close (needs an opt-in option). Happy to add any on request.🤖 Generated with Claude Code