fix: add aria-labelledby to checkbox for better a11y#1004
Conversation
|
@aojunhao123 is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
Summary of ChangesHello @aojunhao123, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the accessibility of the tree component by implementing the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
演进说明通过在 TreeNode 组件顶部计算 getTreeNodeId(treeId, eventKey) 来引入稳定的节点标识符,并在整个组件中重复使用,同时改进复选框的可访问性属性和依赖项管理。 变更概览
估算代码审查工作量🎯 2 (Simple) | ⏱️ ~10 minutes 可能相关的 PR
推荐审查人
兔子的贺诗
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1004 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 14 14
Lines 1295 1295
Branches 396 396
=======================================
Hits 1293 1293
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces aria-labelledby to the checkbox elements within the TreeNode component, significantly improving accessibility for users who rely on assistive technologies. The nodeId is correctly generated and used, and the useMemo dependency array has been updated to reflect this change. The refactoring of nodeId declaration to an earlier, more appropriate scope is also a good improvement.
修一下antd那边挂掉的a11y test case。主要是在这个pr里把checkbox的aria-label给去掉了,但是发现这个其实不能去掉。因为checkbox需要提供文本内容给读屏器播报,使用aria-labelledby来解。测了一下不会重复播报,antd那边测试也没问题
Summary by CodeRabbit
发布说明
无障碍访问改进
代码优化
✏️ Tip: You can customize this high-level summary in your review settings.