Fix/31701 interactions panel accessibility#34110
Fix/31701 interactions panel accessibility#34110anchmelev wants to merge 3 commits intostorybookjs:nextfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactors component-testing UI: Interaction renders as semantic list items with updated ARIA, icons, hover/disabled behavior, and error styling; InteractionsPanel gains an accessible sectioned list, sr-only heading, live status announcements, and an optional id prop; tests added for rendering and accessibility behaviors. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
code/core/src/component-testing/components/InteractionsPanel.test.tsx (1)
98-122: Consider adding test coverage for remaining status values.The test covers 'playing' and 'errored' statuses but the
StatusAnnouncementMappingalso includes 'rendering', 'completed' (without errors), and 'aborted'. Consider adding assertions for these states to ensure comprehensive coverage of the live region announcements.Example additional assertions
// Test 'aborted' status announcement rerender( <ThemeProvider theme={convert(themes.light)}> <InteractionsPanel {...createProps({ status: 'aborted', interactions: getInteractions(CallStates.DONE), })} /> </ThemeProvider> ); expect(screen.getByRole('status')).toHaveTextContent('Component test was aborted.');🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@code/core/src/component-testing/components/InteractionsPanel.test.tsx` around lines 98 - 122, Add assertions for the remaining statuses defined in StatusAnnouncementMapping so the live-region announcements are fully covered: after the initial 'playing' and 'errored' assertions, call rerender with InteractionsPanel (using createProps) for 'rendering', 'completed' (successful), and 'aborted' statuses using appropriate getInteractions(CallStates.*) values, then assert the role="status" or role="alert" contains the expected messages for each status; update the test in InteractionsPanel.test.tsx near the existing rerender blocks so assertions for 'rendering', 'completed', and 'aborted' are included and use the ThemeProvider/convert(themes.light) wrapper as done currently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@code/core/src/component-testing/components/InteractionsPanel.test.tsx`:
- Around line 98-122: Add assertions for the remaining statuses defined in
StatusAnnouncementMapping so the live-region announcements are fully covered:
after the initial 'playing' and 'errored' assertions, call rerender with
InteractionsPanel (using createProps) for 'rendering', 'completed' (successful),
and 'aborted' statuses using appropriate getInteractions(CallStates.*) values,
then assert the role="status" or role="alert" contains the expected messages for
each status; update the test in InteractionsPanel.test.tsx near the existing
rerender blocks so assertions for 'rendering', 'completed', and 'aborted' are
included and use the ThemeProvider/convert(themes.light) wrapper as done
currently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4782b256-22fd-457a-8a55-016b4fdf2478
📒 Files selected for processing (3)
code/core/src/component-testing/components/Interaction.tsxcode/core/src/component-testing/components/InteractionsPanel.test.tsxcode/core/src/component-testing/components/InteractionsPanel.tsx
Closes #31701
What I did
Improved accessibility in the Interactions panel by making the steps list semantic and improving screen reader support.
This PR:
olandli)aria-expandedaria-busywhile interactions are rendering or runningReact.useId()so the component remains compatible with React 17Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
cd code && yarn task compile && yarn storybook:uihttp://localhost:6006/?path=/story/core-component-test-basics--steparia-expandedDocumentation
MIGRATION.MD
Summary by CodeRabbit
New Features
Improvements
Tests