feat: accessibility (a11y) support & improvements to the core interactive components#203
Open
Vinyl-Davyl wants to merge 6 commits intoNetflix:masterfrom
Open
feat: accessibility (a11y) support & improvements to the core interactive components#203Vinyl-Davyl wants to merge 6 commits intoNetflix:masterfrom
Vinyl-Davyl wants to merge 6 commits intoNetflix:masterfrom
Conversation
Author
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.
Requirements for a pull request
Description of the Change
The metaflow-ui codebase currently has zero
aria-*attributes, zeroroleattributes, and only 3tabIndexusages across 124 components. This PR adds foundational accessibility (a11y) support to the core interactive components, bringing the UI closer to WCAG 2.1 AA compliance.Changes by component
tabIndexdefault from99to0— a value of 99 breaks natural keyboard tab order (WCAG 2.4.3)role="dialog",aria-modal="true",aria-label, focus trap (Tab/Shift+Tab cycles within the modal), and auto-focus on openaria-haspopup="listbox",aria-expanded,role="listbox",role="option",aria-selectedaria-live="polite"so screen readers announce notifications without interrupting the userrole="button",aria-label="Close fullscreen",tabIndex={0}to close button (was not keyboard accessible)aria-label="Breadcrumb navigation"on the nav wrapper,role="button"/aria-label/tabIndexon the close buttontitleattribute to fullscreen button for tooltip on hoverAlternate Designs
An alternative was to add ARIA attributes only to the Button component and let all consumers inherit them via props. This was rejected because many interactive elements (close icons, overlays) are plain
divs that don't go through the Button component — they need direct ARIA attributes. The chosen approach targets each component individually for complete coverage of the interactive surface.Possible Drawbacks
tabIndexchange from99to0affects every Button instance in the app. This is intentionally the correct default per WCAG — a value of99placed all buttons at the end of the tab order. Any component that explicitly passes atabIndexprop is unaffected.keydownevent listener when the modal is open. This is cleaned up on unmount via theuseEffectreturn, so there is no risk of memory leaks.Verification Process
npx tsc --noEmit— zero TypeScript errorsaria-live="polite"by triggering a notification — screen reader (VoiceOver) announces the message without interrupting current focus.Quick Preview of Metaflow UI Accessibility Improvements
- Breadcrumb navigation (Home page + Run page)
Where: the breadcrumb bar at the top (shows "Home" and the Go to... input)
How to test:
aria-label="Breadcrumb navigation"tabIndex=0,aria-label="Close navigation")Tabto reach it,Enterto close- Dropdown keyboard navigation (Run page → Timeline tab)
Where: URL click any run (e.g. BasicFlow / 3) → click Timeline tab → look at the dropdowns at the top: Mode (Workflow/Task), Order by (Started at), Group by step checkbox
How to test:
Tabto the Mode dropdown (shows "Workflow")ArrowDownorEnterorSpace→ dropdown opensArrowDown/ArrowUp→ options highlight with background colorEnterorSpace→ selects the highlighted optionEscape→ closes without selecting- Modal focus trap (Run page → Task page → Artifact Table)
Where: URL click BasicFlow / 3 → click Timeline tab → click a task (e.g. 520362) on the left → scroll down to see the Artifacts section → click an artifact value link to open the Modal
Tab→ the X close button in the top-right corner gets focus (it now hastabIndex={0},aria-label="Close fullscreen")Enter→ closes fullscreenEscape→ also closes- Notifications aria-live (Task page → copy logs)
Where: URL → click BasicFlow / 3 → click Timeline tab → click a task → scroll to the stdout log section → click the copy button (clipboard icon)
How to test:
aria-live="polite"andaria-label="Notifications"Release Notes
Added accessibility support across core UI components: keyboard navigation for Dropdown, focus trapping in Modal, screen reader announcements for Notifications, and ARIA attributes throughout — bringing the UI closer to WCAG 2.1 AA compliance.