Repository navigation
feat: Mentions reduce dom strcuture and support size - #55638
Conversation
|
|
👁 Visual Regression Report for PR #55638 Failed ❌
Warning There are more diffs not shown in the table. Please check the Full Report for details. Important There are 139 diffs found in this PR: 🔄
|
Summary of ChangesHello @zombieJ, 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 introduces a substantial refactoring of the Mentions component, focusing on a cleaner DOM structure and enhanced styling capabilities. The primary goal is to provide better support for component sizing and semantic styling of its suffix elements, ultimately offering more flexibility and consistency for developers using the component. 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
|
|
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)
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.
Code Review
The pull request effectively refactors the Mentions component's DOM structure and introduces support for the size prop and suffix semantic structure. The changes are well-implemented, improving both the component's flexibility and maintainability. The styling logic has been significantly refactored, utilizing CSS variables for better control over sizing, and the new size prop is correctly integrated. Documentation and demo updates are consistent with the new features. No issues of medium, high, or critical severity were found.
size-limit report 📦
|
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 8.04MB (214.08%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
Files in
Files in
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Deploying ant-design-next with
|
| Latest commit: |
7cea1ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://63f05204.ant-design-next.pages.dev |
| Branch Preview URL: | https://mentions-refactor.ant-design-next.pages.dev |
|
酱, 还有 CI 没过 |
Deploying ant-design with
|
| Latest commit: |
7cea1ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1ee96943.ant-design.pages.dev |
| Branch Preview URL: | https://mentions-refactor.ant-design.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #55638 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 796 796
Lines 14697 14703 +6
Branches 3899 3901 +2
=========================================
+ Hits 14697 14703 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
visual diff 看下 |
|
@meet-student 你的 demo |
There was a problem hiding this comment.
Pull Request Overview
This PR adds size support to the Mentions component, aligning it with other Ant Design form components. It also refactors the component's styling to use CSS variables for better maintainability and updates the underlying @rc-component/mentions dependency.
Key changes:
- Added
sizeprop support with small, default, and large variants - Refactored styling to use CSS custom properties for padding and control height
- Updated
@rc-component/mentionsfrom ~1.4.0 to ~1.5.5 - Separated dropdown styles from main component styles for better code organization
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated @rc-component/mentions dependency to ~1.5.5 to support new features |
| mako.config.json | Added @rc-component/.* to watch regex for development workflow |
| components/mentions/style/index.ts | Major refactoring: split styles into genMentionsStyle and genDropdownStyle, implemented CSS variables for size support |
| components/mentions/index.tsx | Added size prop, useSize hook, and size-specific class names (ant-mentions-sm/lg) |
| components/mentions/index.en-US.md | Added size demo reference with version="6.0.0", removed version tag from variant demo |
| components/mentions/index.zh-CN.md | Added size demo reference with version="6.0.0", removed version tag from variant demo |
| components/mentions/demo/size.tsx | New demo showcasing small, default, and large size options |
| components/mentions/demo/size.md | Documentation for size demo in both English and Chinese |
| components/mentions/demo/style-class.tsx | Enhanced demo with resize styling example |
| components/mentions/demo/style-class.md | Updated description to mention textarea resizability example |
| components/mentions/demo/_semantic.tsx | Added suffix semantic element documentation and enhanced demo display |
| components/mentions/tests/snapshots/*.snap | Updated snapshots reflecting new class names and structure changes |
| components/input/style/index.ts | Enhanced genBasicInputStyle to accept optional largeStyle and smallStyle overrides |
| components/input/demo/size.tsx | Refactored to use Flex layout instead of manual elements |
| components/input/tests/snapshots/*.snap | Updated snapshots for Input size demo refactoring |
| components/form/tests/snapshots/*.snap | Updated snapshots reflecting Mentions component structure changes |
对的对的 之前有问题 |



























中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
resolve #55618
💡 Background and Solution
📝 Change Log
suffixsemantic andsizeprops.suffix语义化结构以及size属性。