feat(alert): add a close button element for semantic#55815
feat(alert): add a close button element for semantic#55815afc163 merged 2 commits intoant-design:featurefrom
Conversation
|
|
👁 Visual Regression Report for PR #55815 Passed ✅
🎊 Congrats! No visual-regression diff found.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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 of ChangesHello @coding-ice, 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 enhances the Ant Design Alert component by adding semantic styling capabilities for its close button. This change allows for greater customization, enabling developers to apply specific class names and styles to the close button, thereby improving the component's flexibility and adherence to design systems. The update includes modifications to the component's type definitions, internal rendering logic, and corresponding test and demo updates. Highlights
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
|
There was a problem hiding this comment.
Code Review
This pull request successfully adds a close semantic element to the Alert component, which is a great enhancement for customization via the classNames and styles props. The implementation is clean, and the changes are consistently applied across the component, tests, and documentation. I have one minor suggestion to improve the robustness of the new test case.
| expect(titleElement).toHaveClass(customClassNames.title!); | ||
| expect(descriptionElement).toHaveClass(customClassNames.description!); | ||
| expect(actionElement).toHaveClass(customClassNames.actions!); | ||
| expect(closeElement).toHaveClass(customClassNames.close!); |
There was a problem hiding this comment.
To improve test robustness and provide clearer error messages, it's good practice to first assert that an element exists in the document before making further assertions on its properties. If closeElement were null, this test would fail with a less informative TypeError when checking for classes or styles.
| expect(closeElement).toHaveClass(customClassNames.close!); | |
| expect(closeElement).toBeInTheDocument(); | |
| expect(closeElement).toHaveClass(customClassNames.close!); |
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 8.31MB (212.43%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature #55815 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 803 803
Lines 14804 14804
Branches 3913 3913
=========================================
Hits 14804 14804 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| { name: 'title', desc: locale.title, version: '6.0.0' }, | ||
| { name: 'description', desc: locale.description, version: '6.0.0' }, | ||
| { name: 'actions', desc: locale.actions, version: '6.0.0' }, | ||
| { name: 'close', desc: locale.close, version: '6.0.0' }, |


中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
#55133
💡 Background and Solution
📝 Change Log