Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kimteayon
Copy link
Collaborator

@kimteayon kimteayon commented Jan 13, 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

发布说明

  • 新功能

    • Copilot 现已支持多语言历史消息预加载,每个对话可自动填充相应的预设消息。
  • 改进

    • 历史消息加载功能现更加稳定,能够优雅处理网络错误和非浏览器环境问题。
  • 依赖更新

    • 更新相关依赖版本以支持新功能。

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

Preview is ready

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

Warning

Rate limit exceeded

@kimteayon has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 316118a and 5b1c4e9.

📒 Files selected for processing (2)
  • packages/x/docs/x-sdk/demos/x-chat/async-defaultMessages.tsx
  • packages/x/docs/x-sdk/demos/x-conversations/async-defaultMessages.tsx

Note

Other AI code review bot(s) detected

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

📝 Walkthrough

Walkthrough

向 Copilot 组件添加了基于语言环境的历史消息预填充功能。新增历史消息生成和工厂函数,将预定义消息按会话标识符分类存储,并在提供程序中作为默认消息应用。增强了错误处理和构建环境检测。

Changes

内聚组 / 文件 变更摘要
Copilot 历史消息集成
packages/x/docs/playground/copilot.tsx
新增 generateHistoryMessages(locale) 生成预填充消息映射,新增 historyMessageFactory(conversationKey) 获取对应会话历史。通过 defaultMessages 属性将历史消息传入 Copilot 提供程序;更新类型导入(AttachmentsPropsDefaultMessageInfoXModelMessage)。
语言环境数据扩展
packages/x/docs/playground/_utils/local.ts
zhCNenUS 语言环境对象中新增 historyMessages 属性,包含 5 个预定义对话场景(新建会话、功能升级、混合接口、快速安装、组件介绍)。修正 aiMessage_2 内容链接目标和格式。
历史消息加载韧性增强
packages/x/docs/x-sdk/demos/x-chat/async-defaultMessages.tsx, packages/x/docs/x-sdk/demos/x-conversations/async-defaultMessages.tsx
getHistoryMessageList 函数中添加非浏览器环境检测(返回空数组),并用 try/catch 包装网络请求,确保失败时安全降级至空数组并记录警告。
依赖版本调整
packages/x/package.json
@antv/infographic 从固定版本 0.2.7 升级至版本范围 ^0.2.9
开发依赖重排
package.json
调整 @testing-library/reactdevDependencies 中的位置(无功能变更)。

Sequence Diagram(s)

sequenceDiagram
    participant App as 应用程序
    participant Copilot as Copilot 组件
    participant Factory as 历史消息工厂
    participant Locale as 语言环境数据
    participant Provider as Copilot 提供程序

    App->>Copilot: 挂载(activeConversationKey)
    Copilot->>Factory: historyMessageFactory(activeConversationKey)
    Factory->>Locale: 查询 historyMessages[conversationKey]
    Locale-->>Factory: 返回预定义消息数组
    Factory-->>Copilot: 返回消息(或空数组)
    Copilot->>Provider: 设置 defaultMessages
    Provider-->>Copilot: 初始化会话历史
    Copilot-->>App: 渲染预填充消息
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 长长的耳朵一竖起
历史消息被唤醒,
会话复苏新生机,
语言环境驱动它,
韧性编码心欢喜!✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive 标题中存在拼写错误("playround"应为"playground"),且标题过于简洁,未能充分反映主要变更内容。 建议修正拼写错误并明确标题,例如:"docs: add default messages for copilot playground",使其更清晰地反映变更内容。
✅ 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 fix-playground

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.

@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 enhances the Copilot playground by incorporating predefined conversation histories. These histories serve as default messages, providing immediate context and example interactions when a user accesses the playground. This improves the demonstration of the Copilot feature by showcasing typical conversation flows and making the documentation more illustrative.

Highlights

  • Default Conversation Messages: Introduced a new constant, HISTORY_MESSAGES, to define predefined conversation histories for the Copilot playground. These messages provide example interactions for different conversation keys.
  • Integration with useXChat Hook: The useXChat hook in the Copilot playground now utilizes a historyMessageFactory to load these predefined messages as defaultMessages based on the active conversation key, ensuring the playground starts with relevant historical context.

🧠 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 documentation Improvements or additions to documentation label Jan 13, 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 introduces default messages for the Copilot playground by adding a HISTORY_MESSAGES constant and a factory function. The changes are then integrated into the useXChat hook.

My review includes suggestions to improve type safety by replacing any[] with more specific types for the message history. I've also pointed out the use of hardcoded strings that should be moved to a locale file for better internationalization.

Additionally, there's a small typo in the pull request title ('playround' should be 'playground').

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: 0

🧹 Nitpick comments (1)
packages/x/docs/playground/copilot.tsx (1)

73-135: 类型安全和国际化一致性问题

  1. 类型定义过于宽松: 使用 any[] 会丢失类型信息,建议使用更具体的类型定义。

  2. 国际化不一致: 部分消息内容使用了 locale 引用,但第 84、120、130 行包含硬编码的中文字符串,这与项目支持中英双语文档的做法不一致。

♻️ 建议的改进
-const HISTORY_MESSAGES: {
-  [key: string]: any[];
-} = {
+interface HistoryMessage {
+  message: { role: 'user' | 'assistant'; content: string };
+  status: 'success' | 'loading' | 'error';
+}
+
+const HISTORY_MESSAGES: Record<string, HistoryMessage[]> = {

对于硬编码的中文字符串,建议将它们迁移到 locale 文件中,例如:

-        content: `${locale.helloImAntDesignX}!${locale.baseOnAntDesign} 我可以帮助你:写报告、画图、查看知识,或者回答关于 Ant Design X 的任何问题。`,
+        content: locale.assistantWelcomeMessage,
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f62d52 and 6636978.

📒 Files selected for processing (1)
  • packages/x/docs/playground/copilot.tsx
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
⏰ 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: Cloudflare Pages
🔇 Additional comments (2)
packages/x/docs/playground/copilot.tsx (2)

137-139: 逻辑正确

工厂函数实现简洁,空数组作为默认值是合理的安全回退。如果上面的类型定义得到改进,此处的返回类型也会相应受益。


325-328: 无需修改 - defaultMessages 在会话切换时会正确更新

useXChat 通过将 conversationKey 作为依赖项传给 useChatStore (第 134 行),当会话切换时会自动重新初始化消息。当 activeConversationKey 变化时,conversationKey 属性变化触发 useEffect (第 111-115 行) 更新内部状态,进而重新执行 useChatStore 的初始化回调,使用新的 defaultMessages 重新加载历史消息。当前实现是正确的。

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1646   +/-   ##
=======================================
  Coverage   97.17%   97.17%           
=======================================
  Files         140      140           
  Lines        4288     4288           
  Branches     1198     1216   +18     
=======================================
  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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2026

size-limit report 📦

Path Size
packages/x/dist/antdx.min.js 441.53 KB
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 13, 2026

Bundle Report

Changes will decrease total bundle size by 1.26MB (-40.34%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
x-markdown-array-push 106.64kB -1.26MB (-92.21%) ⬇️

Affected Assets, Files, and Routes:

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

Assets Changed:

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

@cloudflare-workers-and-pages
Copy link

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

Deploying ant-design-x with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b1c4e9
Status: ✅  Deploy successful!
Preview URL: https://a7395752.ant-design-x.pages.dev
Branch Preview URL: https://fix-playground-zslp.ant-design-x.pages.dev

View logs

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: 2

🤖 Fix all issues with AI agents
In `@packages/x/docs/playground/_utils/local.ts`:
- Around line 182-189: The assistant string for the whatHasAntDesignXUpgraded
entry contains a malformed Markdown link "induction})"; locate the
whatHasAntDesignXUpgraded property in the exported object and fix the assistant
value by removing the stray brace so the link reads "induction)". Ensure you
only change the string content for whatHasAntDesignXUpgraded.assistant and keep
surrounding formatting intact.
- Around line 83-90: Fix malformed Markdown link syntax by removing stray
closing braces in the message strings: update the URL fragments in the
whatHasAntDesignXUpgraded.assistant and newAgiHybridInterface.assistant values
(and also aiMessage_1 and aiMessage_2) so `introduce-cn})` becomes
`introduce-cn)` and `introduce-cn}/)` becomes `introduce-cn/)`; ensure no extra
braces remain in those template strings so the Markdown links parse correctly.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6636978 and fbbf130.

📒 Files selected for processing (2)
  • packages/x/docs/playground/_utils/local.ts
  • packages/x/docs/playground/copilot.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/x/docs/playground/copilot.tsx
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
⏰ 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: test
  • GitHub Check: size
  • GitHub Check: build preview
  • GitHub Check: test
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
packages/x/docs/playground/_utils/local.ts (1)

75-101: 数据结构设计合理

historyMessages 的结构设计清晰,使用会话键作为索引,包含 userassistant 配对消息,便于在 Copilot 中按会话预填充历史记录。中英双语内容保持了一致的结构。

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@kimteayon
Copy link
Collaborator Author

site 构建问题以同步给antv

@socket-security
Copy link

socket-security bot commented Jan 15, 2026

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 `@package.json`:
- Around line 85-87: Remove the redundant root dependency declaration for
"@antv/infographic" in the root package.json (the entry under "dependencies")
since the package is only used in
packages/x/docs/x-markdown/demo/components/infographic.tsx and is already
declared with the correct version in packages/x/package.json; delete the
"@antv/infographic": "^0.2.0" line from the root package.json and then run your
workspace install (e.g., pnpm install) to ensure the lockfile and node_modules
are consistent with the workspace-only declaration.
♻️ Duplicate comments (1)
packages/x/docs/playground/_utils/local.ts (1)

83-90: Markdown 链接语法错误:多余的 } 字符

第 85 行的链接 /docs/spec/introduce-cn}) 中存在多余的 } 字符,会导致链接无法正常解析。应为 /docs/spec/introduce-cn)

此外,第 57 行的 aiMessage_1 中也存在相同问题,建议一并修复。

🔧 建议修复
   whatHasAntDesignXUpgraded: {
     user: 'Ant Design X 有哪些升级?',
-    assistant: 'RICH 设计范式 \n [查看详情](/docs/spec/introduce-cn})',
+    assistant: 'RICH 设计范式 \n [查看详情](/docs/spec/introduce-cn)',
   },

同时修复第 57 行:

-  aiMessage_1: `RICH 设计范式 \n [查看详情](/docs/spec/introduce-cn})`,
+  aiMessage_1: `RICH 设计范式 \n [查看详情](/docs/spec/introduce-cn)`,
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d81e37 and e996992.

📒 Files selected for processing (3)
  • package.json
  • packages/x/docs/playground/_utils/local.ts
  • packages/x/mako.config.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。
📚 Learning: 2025-04-11T14:47:09.527Z
Learnt from: afc163
Repo: ant-design/x PR: 0
File: :0-0
Timestamp: 2025-04-11T14:47:09.527Z
Learning: 当评审 ant-design/x 仓库中的 PR 时,需要用中文回复中文评论。该项目的文档支持中英双语。

Applied to files:

  • packages/x/docs/playground/_utils/local.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). (4)
  • GitHub Check: test
  • GitHub Check: size
  • GitHub Check: Cloudflare Pages
  • GitHub Check: test
🔇 Additional comments (3)
packages/x/docs/playground/_utils/local.ts (2)

76-101: 中文历史消息结构设计合理。

historyMessages 对象结构清晰,键名与现有 locale 键保持一致,user/assistant 配对模式便于 Copilot 历史消息预填充功能使用。


175-200: 英文历史消息结构 LGTM!

historyMessages 英文版本与中文版本结构一致,翻译准确,链接格式正确。

packages/x/mako.config.json (1)

9-18: module.rulesexperiments 不是有效的 Mako 配置选项。

@umijs/mako 是一个基于 Rust 的独立打包工具,不兼容 Webpack 的配置格式。module.rulesexperiments.importAttributes 都是 Webpack 特定的选项,Mako 不支持这些配置。如果需要在 Mako 中支持 JSON 导入或导入属性,应该查阅 Mako 的实际配置文档,而非使用 Webpack 风格的配置。

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@Div627 Div627 left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 15, 2026
@kimteayon kimteayon merged commit 61b1761 into main Jan 16, 2026
15 checks passed
@kimteayon kimteayon deleted the fix-playground branch January 16, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

演示页-模型样板间-助手式-示例,无法切换聊天记录

3 participants