Skip to content

Conversation

@kimteayon
Copy link
Collaborator

@kimteayon kimteayon commented Jan 4, 2026

中文版模板 / 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

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English
🇨🇳 Chinese

Summary by CodeRabbit

发布说明

  • Chores
    • 更新主题样式生成配置,移除 layer 配置中的依赖声明,简化样式层级配置。
  • Tests
    • 精简样式相关单元测试,移除一条关于头部样式字符串的断言,保留其它样式输出校验。
  • Documentation
    • 调整若干文档排序元数据(order 值),新增“样式兼容 / Layer 使用”中英文指南,包含使用示例与兼容性说明。

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

Preview failed

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

移除 theme 生成工具中图层配置的 dependencies: ['antd'] 条目;删减了一个测试断言;调整两份文档的排序元数据;新增中英文“兼容样式”文档,介绍 @layer 用法与示例(均为文档与测试类变更)。

Changes

Cohort / File(s) 变更说明
图层配置调整
packages/x/components/theme/genStyleUtils.ts
从图层配置中移除 dependencies: ['antd'] 条目
测试更新
packages/x/components/theme/__tests__/theme.test.tsx
删除对 document.head 中字符串 @layer antd,antdx; 的断言(保留其他样式断言)
文档元数据调整
packages/x/docs/react/common-props.en-US.md, packages/x/docs/react/common-props.zh-CN.md
修改 front matter 中 order 值从 12
新增兼容样式文档
packages/x/docs/react/compatible-style.en-US.md, packages/x/docs/react/compatible-style.zh-CN.md
添加新文档,说明使用 @layer 降级样式优先级的用法、示例代码与兼容性说明

Sequence Diagram(s)

(此变更未引入需可视化的多组件顺序控制流,故略)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 分钟

🐰 我在代码林中跳,轻拂一片层,
去掉一行依赖词,测试少了一个层,
文档新开两页页,示例清晰又暖,
胡萝卜一小段,改动如春暖。

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive 标题"fix: layer"过于简洁且通用,虽然与改动相关(移除layer依赖、更新文档),但未能清晰表达主要变更意图。 建议将标题改为更具描述性的内容,例如"fix: remove antd dependency from layer configuration"或"fix: update layer configuration and related documentation",以更清楚地传达主要改动。
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch layer-fix

📜 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 a210fbf and ff0b160.

📒 Files selected for processing (1)
  • packages/x/docs/react/compatible-style.zh-CN.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/x/docs/react/compatible-style.zh-CN.md
⏰ 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). (5)
  • GitHub Check: size
  • GitHub Check: build preview
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: Cloudflare Pages

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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 4, 2026

Deploying ant-design-x with  Cloudflare Pages  Cloudflare Pages

Latest commit: ff0b160
Status: ✅  Deploy successful!
Preview URL: https://fa1d86d0.ant-design-x.pages.dev
Branch Preview URL: https://layer-fix.ant-design-x.pages.dev

View logs

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kimteayon, 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 related to the 'layer' component or utility by refining its dependency configuration. The change specifically removes an unnecessary or incorrect 'antd' dependency declaration within the theme generation utilities, aiming to ensure more accurate and efficient dependency management for the 'layer' feature.

Highlights

  • Dependency Management: The explicit declaration of 'antd' as a dependency for the 'layer' configuration has been removed from the genStyleUtils.ts file. This change likely streamlines dependency handling for the 'layer' component.

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

@dosubot dosubot bot added the bug Something isn't working label Jan 4, 2026
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 removes the antd dependency from the CSS cascade layer configuration for antdx. This is a potentially breaking change that could affect style precedence and cause antd styles to override antdx styles. A test in theme.test.tsx seems to rely on this dependency and will likely fail. The pull request description is empty, which makes it difficult to understand the rationale behind this change. I have left a critical comment detailing the potential issues and suggesting to restore the dependency.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

size-limit report 📦

Path Size
packages/x/dist/antdx.min.js 441.36 KB (+45 B 🔺)
packages/x-sdk/dist/x-sdk.min.js 7.58 KB
packages/x-markdown/dist/x-markdown.min.js 28.77 KB
packages/x-markdown/dist/plugins/latex.min.js 61.95 KB

@codecov
Copy link

codecov bot commented Jan 5, 2026

Bundle Report

Changes will increase total bundle size by 1.26MB (67.61%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
x-markdown-array-push 1.37MB 1.26MB (1184.43%) ⬆️⚠️

Affected Assets, Files, and Routes:

view changes for bundle: x-markdown-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
latex.min.js (New) 268.81kB 268.81kB 100.0% 🚀
static/KaTeX_AMS-Regular.*.ttf (New) 63.63kB 63.63kB 100.0% 🚀
static/KaTeX_Main-Regular.*.ttf (New) 53.58kB 53.58kB 100.0% 🚀
static/KaTeX_Main-Bold.*.ttf (New) 51.34kB 51.34kB 100.0% 🚀
static/KaTeX_Main-Italic.*.ttf (New) 33.58kB 33.58kB 100.0% 🚀
static/KaTeX_AMS-Regular.*.woff (New) 33.52kB 33.52kB 100.0% 🚀
static/KaTeX_Main-BoldItalic.*.ttf (New) 32.97kB 32.97kB 100.0% 🚀
static/KaTeX_Math-Italic.*.ttf (New) 31.31kB 31.31kB 100.0% 🚀
static/KaTeX_Math-BoldItalic.*.ttf (New) 31.2kB 31.2kB 100.0% 🚀
static/KaTeX_Main-Regular.*.woff (New) 30.77kB 30.77kB 100.0% 🚀
static/KaTeX_Main-Bold.*.woff (New) 29.91kB 29.91kB 100.0% 🚀
static/KaTeX_AMS-Regular.*.woff2 (New) 28.08kB 28.08kB 100.0% 🚀
static/KaTeX_Typewriter-Regular.*.ttf (New) 27.56kB 27.56kB 100.0% 🚀
static/KaTeX_Main-Regular.*.woff2 (New) 26.27kB 26.27kB 100.0% 🚀
static/KaTeX_Main-Bold.*.woff2 (New) 25.32kB 25.32kB 100.0% 🚀
static/KaTeX_SansSerif-Bold.*.ttf (New) 24.5kB 24.5kB 100.0% 🚀
latex.min.css (New) 24.32kB 24.32kB 100.0% 🚀
static/KaTeX_SansSerif-Italic.*.ttf (New) 22.36kB 22.36kB 100.0% 🚀
static/KaTeX_Main-Italic.*.woff (New) 19.68kB 19.68kB 100.0% 🚀
static/KaTeX_Fraktur-Bold.*.ttf (New) 19.58kB 19.58kB 100.0% 🚀
static/KaTeX_Fraktur-Regular.*.ttf (New) 19.57kB 19.57kB 100.0% 🚀
static/KaTeX_SansSerif-Regular.*.ttf (New) 19.44kB 19.44kB 100.0% 🚀
static/KaTeX_Main-BoldItalic.*.woff (New) 19.41kB 19.41kB 100.0% 🚀
static/KaTeX_Math-Italic.*.woff (New) 18.75kB 18.75kB 100.0% 🚀
static/KaTeX_Math-BoldItalic.*.woff (New) 18.67kB 18.67kB 100.0% 🚀
static/KaTeX_Main-Italic.*.woff2 (New) 16.99kB 16.99kB 100.0% 🚀
static/KaTeX_Main-BoldItalic.*.woff2 (New) 16.78kB 16.78kB 100.0% 🚀
static/KaTeX_Script-Regular.*.ttf (New) 16.65kB 16.65kB 100.0% 🚀
static/KaTeX_Math-Italic.*.woff2 (New) 16.44kB 16.44kB 100.0% 🚀
static/KaTeX_Math-BoldItalic.*.woff2 (New) 16.4kB 16.4kB 100.0% 🚀
static/KaTeX_Typewriter-Regular.*.woff (New) 16.03kB 16.03kB 100.0% 🚀
static/KaTeX_SansSerif-Bold.*.woff (New) 14.41kB 14.41kB 100.0% 🚀
static/KaTeX_SansSerif-Italic.*.woff (New) 14.11kB 14.11kB 100.0% 🚀
static/KaTeX_Typewriter-Regular.*.woff2 (New) 13.57kB 13.57kB 100.0% 🚀
static/KaTeX_Fraktur-Bold.*.woff (New) 13.3kB 13.3kB 100.0% 🚀
static/KaTeX_Fraktur-Regular.*.woff (New) 13.21kB 13.21kB 100.0% 🚀
static/KaTeX_Caligraphic-Bold.*.ttf (New) 12.37kB 12.37kB 100.0% 🚀
static/KaTeX_Caligraphic-Regular.*.ttf (New) 12.34kB 12.34kB 100.0% 🚀
static/KaTeX_SansSerif-Regular.*.woff (New) 12.32kB 12.32kB 100.0% 🚀
static/KaTeX_Size1-Regular.*.ttf (New) 12.23kB 12.23kB 100.0% 🚀
static/KaTeX_SansSerif-Bold.*.woff2 (New) 12.22kB 12.22kB 100.0% 🚀
static/KaTeX_SansSerif-Italic.*.woff2 (New) 12.03kB 12.03kB 100.0% 🚀
static/KaTeX_Size2-Regular.*.ttf (New) 11.51kB 11.51kB 100.0% 🚀
static/KaTeX_Fraktur-Bold.*.woff2 (New) 11.35kB 11.35kB 100.0% 🚀
static/KaTeX_Fraktur-Regular.*.woff2 (New) 11.32kB 11.32kB 100.0% 🚀
static/KaTeX_Script-Regular.*.woff (New) 10.59kB 10.59kB 100.0% 🚀
static/KaTeX_Size4-Regular.*.ttf (New) 10.36kB 10.36kB 100.0% 🚀
static/KaTeX_SansSerif-Regular.*.woff2 (New) 10.34kB 10.34kB 100.0% 🚀
static/KaTeX_Script-Regular.*.woff2 (New) 9.64kB 9.64kB 100.0% 🚀
static/KaTeX_Caligraphic-Bold.*.woff (New) 7.72kB 7.72kB 100.0% 🚀
static/KaTeX_Caligraphic-Regular.*.woff (New) 7.66kB 7.66kB 100.0% 🚀
static/KaTeX_Size3-Regular.*.ttf (New) 7.59kB 7.59kB 100.0% 🚀
static/KaTeX_Caligraphic-Bold.*.woff2 (New) 6.91kB 6.91kB 100.0% 🚀
static/KaTeX_Caligraphic-Regular.*.woff2 (New) 6.91kB 6.91kB 100.0% 🚀
static/KaTeX_Size1-Regular.*.woff (New) 6.5kB 6.5kB 100.0% 🚀
static/KaTeX_Size2-Regular.*.woff (New) 6.19kB 6.19kB 100.0% 🚀
static/KaTeX_Size4-Regular.*.woff (New) 5.98kB 5.98kB 100.0% 🚀
static/KaTeX_Size1-Regular.*.woff2 (New) 5.47kB 5.47kB 100.0% 🚀
static/KaTeX_Size2-Regular.*.woff2 (New) 5.21kB 5.21kB 100.0% 🚀
static/KaTeX_Size4-Regular.*.woff2 (New) 4.93kB 4.93kB 100.0% 🚀
static/KaTeX_Size3-Regular.*.woff (New) 4.42kB 4.42kB 100.0% 🚀
static/KaTeX_Size3-Regular.*.woff2 (New) 3.62kB 3.62kB 100.0% 🚀
x-markdown.min.js (Deleted) -103.89kB 0 bytes -100.0% 🗑️
x-markdown.min.css (Deleted) -2.75kB 0 bytes -100.0% 🗑️

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.17%. Comparing base (25c2e95) to head (ff0b160).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1616   +/-   ##
=======================================
  Coverage   97.17%   97.17%           
=======================================
  Files         140      140           
  Lines        4288     4288           
  Branches     1193     1199    +6     
=======================================
  Hits         4167     4167           
  Misses        119      119           
  Partials        2        2           

☔ 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @packages/x/docs/react/compatible-style.zh-CN.md:
- Line 48: The sentence contains duplicated wording ("需要调整" twice); update the
line so it reads succinctly by removing the duplicate, e.g. change "使用时需要手动调整
`@layer` 来控制样式的覆盖顺序需要调整" to "使用时需要手动调整 `@layer` 来控制样式的覆盖顺序" or "使用时需要手动调整
`@layer` 以控制样式覆盖顺序", ensuring the snippet `@layer` remains unchanged.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2c6bee and a210fbf.

📒 Files selected for processing (2)
  • packages/x/docs/react/compatible-style.en-US.md
  • packages/x/docs/react/compatible-style.zh-CN.md
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: YumoImer
Repo: ant-design/x PR: 223
File: package.json:224-224
Timestamp: 2024-11-23T15:50:20.802Z
Learning: `rc-drawer` 依赖在 `.dumi/theme/layouts/SidebarLayout` 文件中被使用,是项目中的必要依赖,今后不应建议移除。
🪛 LanguageTool
packages/x/docs/react/compatible-style.en-US.md

[grammar] ~17-~17: Ensure spelling is correct
Context: ...fied priority demotion. After demotion, antdx styles will always have lower priority ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~68-~68: Ensure spelling is correct
Context: ...mponents; @tailwind utilities; ``` ### TailwindCSS v4 In global.css, adjust @layer to con...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ 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). (4)
  • GitHub Check: build preview
  • GitHub Check: test
  • GitHub Check: size
  • GitHub Check: test
🔇 Additional comments (3)
packages/x/docs/react/compatible-style.en-US.md (2)

1-78: 文档内容结构良好

英文文档的内容和结构与中文版本保持一致,代码示例正确,TailwindCSS 集成说明清晰。静态分析工具标记的 "antdx" 和 "TailwindCSS" 是误报,它们是正确的产品/品牌名称。


11-14: 澄清版本号指代的产品包

版本号 >=5.17.0 应当明确指代 Ant Design (antd) 的版本要求,而非 Ant Design X 本身。当前项目的 antd 版本要求为 ^6.1.1,已满足条件。建议在文档中补充说明,例如改为:"Ant Design 支持版本:>=5.17.0" 或 "antd 版本:>=5.17.0",以避免混淆。

Chrome 99 的最低支持版本信息准确无误。

packages/x/docs/react/compatible-style.zh-CN.md (1)

11-14: 浏览器兼容性信息准确无误

已验证相关信息的准确性。Chrome 99 是 CSS @layer 特性获得完整、无需标志位支持的最低版本(发布于 2022 年 3 月)。版本 >=5.17.0 指的是 Ant Design 添加此特性的版本。文档中的数据准确,不会误导用户。

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 12, 2026
@kimteayon kimteayon merged commit 97bf2da into main Jan 12, 2026
16 checks passed
@kimteayon kimteayon deleted the layer-fix branch January 12, 2026 09:24
@kimteayon kimteayon linked an issue Jan 12, 2026 that may be closed by this pull request
@yoyo837
Copy link
Contributor

yoyo837 commented Jan 14, 2026

搓手等版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

4 participants