fix: make row expand controls accessible - #1509
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough行展开图标从 Changes行展开控件无障碍支持
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This PR makes expandable row controls keyboard-accessible and exposes their open or closed state without changing row-expansion behavior. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages. 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 |
Summary
aria-expandedand update the accessible name when the row opens or closesWhy
The default per-row expand control is currently a
<span onClick>, so direct@rc-component/tableconsumers cannot reach or operate it from the keyboard, and assistive technology receives neither a button role nor the expanded state. The header-level “expand all” control already uses the native-button pattern; this makes row controls consistent with it. Non-expandable placeholder icons remain non-interactive spans.On the exact base commit
7977f2b45a501728dddf0853466c1a013a7190dc, the new regression failed because Testing Library could not find any accessible button named “Expand row”. It passes after this change and verifies both collapsed and expanded states.I searched the repository's open issues and open PR changed files before implementation and found no duplicate accessibility fix for
src/utils/expandUtil.tsx.Validation
npm test— 21 files, 237 testsnpm run tscnpm run lint— 0 errors; 23 existing warningsnpx prettier --check src/utils/expandUtil.tsx tests/ExpandRow.spec.jsx tests/Table.spec.jsxnpm run compile— ESM, CJS, declarations, and Lessgit diff --checkAI assistance disclosure: Codex was used to trace the default expand-control path, audit overlap, draft the regression test and implementation, and run the validation listed above. The behavior and results were verified locally against the cited exact base and PR head.
Summary by CodeRabbit
新功能
测试