feat(descriptions): Support better customization with semantic classNames/styles#55118
feat(descriptions): Support better customization with semantic classNames/styles#55118thinkasany merged 24 commits intoant-design:nextfrom
Conversation
|
|
👁 Visual Regression Report for PR #55118 Failed ❌
Important There are 5 diffs found in this PR: 🔄
|
Summary of ChangesHello @tanjiahao24, 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 customization capabilities of the 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 introduces a valuable enhancement to the Descriptions component, allowing classNames and styles props to be functions for more dynamic customization. The implementation is clean, leveraging a useMergeSemantic hook to centralize the logic. The changes are well-supported with new tests and a demo. I've identified a minor redundancy in the code and some duplication in the documentation that should be addressed.
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 13.13kB (0.11%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
|
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 Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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 |
Signed-off-by: 遇见同学 <[email protected]>
Signed-off-by: 遇见同学 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #55118 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 796 798 +2
Lines 14673 14716 +43
Branches 3890 3893 +3
=========================================
+ Hits 14673 14716 +43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: 遇见同学 <[email protected]> Signed-off-by: tanjiahao24 <[email protected]>
Co-authored-by: 遇见同学 <[email protected]> Signed-off-by: tanjiahao24 <[email protected]>
Signed-off-by: 遇见同学 <[email protected]>
Signed-off-by: 遇见同学 <[email protected]>
| import type { DescriptionsProps } from 'antd'; | ||
|
|
||
| // Object-based classNames | ||
| const classNamesObject: DescriptionsProps['classNames'] = { |
There was a problem hiding this comment.
demo 参考下这个精简下。样式搭配和谐一些
classNames 使用同一个,然后 styles 根据 props (尽量选择 type、size、variant)做一下区分
Co-authored-by: thinkasany <[email protected]> Signed-off-by: 遇见同学 <[email protected]>
Co-authored-by: thinkasany <[email protected]> Signed-off-by: 遇见同学 <[email protected]>
Co-authored-by: thinkasany <[email protected]> Signed-off-by: 遇见同学 <[email protected]>
Co-authored-by: thinkasany <[email protected]> Signed-off-by: 遇见同学 <[email protected]>
|
同步完可以@review 同学帮忙点一下 ap ci,不然可能会不执行。 |
components/descriptions/__tests__/__snapshots__/demo.test.ts.snap
Outdated
Show resolved
Hide resolved
| classNames: { | ||
| label: classNames(contextClassNames.label, descriptionsClassNames?.label), | ||
| content: classNames(contextClassNames.content, descriptionsClassNames?.content), | ||
| label: classNames(mergedClassNames.label), |
There was a problem hiding this comment.
@zombieJ 这个地方先这样子 classNames 包着吧,等合了以后,我后面排查一下原因,去解一下里面的问题














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