Skip to content

fix: update undefined padding to 0#56564

Merged
meet-student merged 1 commit intomasterfrom
mentions-undefined
Jan 11, 2026
Merged

fix: update undefined padding to 0#56564
meet-student merged 1 commit intomasterfrom
mentions-undefined

Conversation

@li-jia-nan
Copy link
Member

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

image
Language Changelog
🇺🇸 English 修复无效的 CSS 属性值
🇨🇳 Chinese 修复无效的 CSS 属性值

Copilot AI review requested due to automatic review settings January 11, 2026 07:17
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @li-jia-nan, 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 addresses a bug where the Mentions component was incorrectly applying undefined as a padding value in its CSS styles. The change ensures that padding is explicitly set to 0 for both large and small input variants, resolving potential rendering issues or unexpected layout behavior caused by invalid CSS property values.

Highlights

  • CSS Property Fix: Corrected invalid padding: undefined values to padding: 0 within the Mentions component's styling for both large and small input styles.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

👁 Visual Regression Report for PR #56564 Failed ❌

🎯 Target branch: master (f324de2)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 1 changed

Expected (Branch master) Actual (Current PR) Diff
table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png table-sticky.dark.png

Important

There are 1 diffs found in this PR: 🔄 1 changed.
Please check all items:

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

Preview is ready

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 11, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • 修复了Mentions输入框的样式填充问题,为不同尺寸的组件明确设置了填充值,改进了输入框的布局一致性。

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

更新Mentions组件样式生成逻辑,为largeStyle和smallStyle的padding属性显式设置为0,替换之前的undefined值,以调整控制项布局的计算样式。

Changes

Cohort / 文件 改动摘要
提及组件样式配置
components/mentions/style/index.ts
将largeStyle和smallStyle中的padding属性从undefined设置为0,影响渲染输入框时的间距计算

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

小兔子跳跳,样式改改,
填补空白处,数字零来,
提及组件美,间距更开怀!🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 标题简洁准确地总结了主要改动,即将undefined的padding更新为0。
Description check ✅ Passed 描述与变更集相关,明确指出这是一个Bug修复,用于解决无效的CSS属性值问题。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mentions-undefined

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f324de2 and ee97f51.

📒 Files selected for processing (1)
  • components/mentions/style/index.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Always use TypeScript with strict type checking
Never use any type - define precise types instead
Use interfaces (not type aliases) for object structures
Export all public interface types
Prefer union types over enums, use as const for constants
Use early returns to improve readability
Support tree shaking
Follow import order: React → dependencies → antd components → custom components → types → styles
Prefer antd built-in components over external dependencies
Pass all ESLint and TypeScript checks
No console errors or warnings

**/*.{ts,tsx}: Use TypeScript and React to develop, with function-based components and hooks instead of class components
Use early returns to improve code readability
Component names should use PascalCase
Property names should use camelCase
Use React.memo, useMemo, and useCallback appropriately to optimize performance
All components and functions must provide accurate type definitions; avoid using any type and use interfaces instead of type aliases for object structures
Component props should use interface definition with naming convention ComponentNameProps; define separate interfaces for component state like ComponentNameState
Use React.ForwardRefRenderFunction for component ref types and explicitly define all callback function parameters and return values
Use generics appropriately to enhance type flexibility; use union types and as const instead of enum; rely on TypeScript's type inference and minimize type assertions
Internationalization: obtain locale configuration via useLocale hook from components/locale/index.tsx; ensure new locale configurations have corresponding type definitions

Files:

  • components/mentions/style/index.ts
components/**/style/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

components/**/style/*.ts: Use @ant-design/cssinjs for all styling
Generate styles with functions named gen[ComponentName]Style
Use design tokens from the Ant Design token system
Support both light and dark themes
Use CSS logical properties for RTL support (e.g., margin-inline-start instead of margin-left)
Respect prefers-reduced-motion for animations

Files:

  • components/mentions/style/index.ts
components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Never hardcode colors, sizes, or spacing values

Files:

  • components/mentions/style/index.ts
**/*.{ts,tsx,md}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use 2-space indentation

Files:

  • components/mentions/style/index.ts
**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Maintain cross-browser compatibility

Files:

  • components/mentions/style/index.ts
🧠 Learnings (4)
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/style/*.ts : Generate styles with functions named `gen[ComponentName]Style`

Applied to files:

  • components/mentions/style/index.ts
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/*.{ts,tsx} : Never hardcode colors, sizes, or spacing values

Applied to files:

  • components/mentions/style/index.ts
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/style/*.ts : Use design tokens from the Ant Design token system

Applied to files:

  • components/mentions/style/index.ts
📚 Learning: 2026-01-04T15:16:45.886Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-04T15:16:45.886Z
Learning: Applies to **/*.tsx : Use CSS-in-JS and avoid hardcoded colors, sizes, and spacing values; base component styles on global and component-level design tokens

Applied to files:

  • components/mentions/style/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: Agent
  • GitHub Check: CodeQL analysis (javascript-typescript)
  • GitHub Check: test-react-latest (dom, 2/2)
  • GitHub Check: visual-diff snapshot (1/2)
  • GitHub Check: test-react-legacy (18, 1/2)
  • GitHub Check: lint
  • GitHub Check: test lib/es module (es, 2/2)
  • GitHub Check: visual-diff snapshot (2/2)
  • GitHub Check: test-react-latest (dom, 1/2)
  • GitHub Check: test lib/es module (es, 1/2)
  • GitHub Check: test-node
  • GitHub Check: test-react-legacy (18, 2/2)
  • GitHub Check: build
  • GitHub Check: build preview
  • GitHub Check: size
  • GitHub Check: build
  • GitHub Check: Analyze (javascript)
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages: ant-design-next
🔇 Additional comments (1)
components/mentions/style/index.ts (1)

155-160: 说明 Mentions 组件中 padding: 0 硬编码的设计意图

将 padding 从 undefined 更新为 0 修复了无效的 CSS 属性值。但请注意,这个 padding: 0 的硬编码覆盖可能违反指导方针中「永远不要硬编码间距值」的要求。

Mentions 组件在大小尺寸变体中明确设置 padding: 0 来覆盖从 Input 基础样式继承的设计令牌。请确认这是该组件的有意设计,还是应该使用设计令牌系统(如新增的组件级令牌)来管理这个值。如果是有意设计,建议添加注释说明原因。


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a bug where an invalid CSS property padding: undefined; was being generated for the Mentions component in large and small sizes. By changing the value from undefined to 0, the padding is correctly overridden, resolving the issue. The change is correct and effectively addresses the problem.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes invalid CSS property values in the mentions component where padding: undefined was incorrectly used in style overrides for large and small size variants. The fix properly sets these to padding: 0.

Changes:

  • Updated mentions component styles to use valid CSS value (0) instead of invalid undefined for padding overrides

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
dist/antd.min.js 523.42 KB (-7 B 🔽)
dist/antd-with-locales.min.js 617.36 KB (-4 B 🔽)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 11, 2026

@cloudflare-workers-and-pages
Copy link

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: ee97f51
Status: ✅  Deploy successful!
Preview URL: https://eeac8579.ant-design.pages.dev
Branch Preview URL: https://mentions-undefined.ant-design.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

Deploying ant-design-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: ee97f51
Status: ✅  Deploy successful!
Preview URL: https://2fb9fd8e.ant-design-next.pages.dev
Branch Preview URL: https://mentions-undefined.ant-design-next.pages.dev

View logs

@codecov
Copy link

codecov bot commented Jan 11, 2026

Bundle Report

Changes will decrease total bundle size by 20 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.86MB -20 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js -10 bytes 2.12MB -0.0%
antd.min.js -10 bytes 1.74MB -0.0%

Files in antd-with-locales.min.js:

  • ./components/mentions/style/index.ts → Total Size: 8.2kB

Files in antd.min.js:

  • ./components/mentions/style/index.ts → Total Size: 8.2kB

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f324de2) to head (ee97f51).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #56564   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          805       805           
  Lines        14903     14903           
  Branches      3919      3919           
=========================================
  Hits         14903     14903           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 11, 2026
@meet-student meet-student merged commit 4a88f6a into master Jan 11, 2026
56 checks passed
@meet-student meet-student deleted the mentions-undefined branch January 11, 2026 07:34
@zombieJ zombieJ mentioned this pull request Jan 13, 2026
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants