Skip to content

Conversation

kimteayon
Copy link
Collaborator

中文版模板 / 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 修复 onRequest 数据处理,接收数组处理数组,以及修复isResqesting 的多实例状态错误问题 同时优化 ,requestPlaceholder & requestFallback回调的入参

Copy link

codecov bot commented Oct 21, 2025

Bundle Report

Changes will increase total bundle size by 10.04kB (0.24%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
x-markdown-array-push 3.94MB 10.04kB (0.26%) ⬆️

Affected Assets, Files, and Routes:

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

Assets Changed:

Asset Name Size Change Total Size Change (%)
mermaid.min.js 10.04kB 3.94MB 0.26%

@dosubot dosubot bot added the bug Something isn't working label Oct 21, 2025
Copy link

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 focuses on enhancing the x-chat functionality by refining how messages are processed during requests, ensuring accurate state management for concurrent chat instances, and providing richer contextual information to custom callback functions. These improvements contribute to a more robust and adaptable chat component, backed by extensive new tests and updated user documentation.

Highlights

  • Enhanced onRequest Message Handling: The transformLocalMessage function now supports processing arrays of messages, allowing the onRequest mechanism to handle multiple messages simultaneously for greater flexibility.
  • Improved isRequesting State Management: A new IsRequestingMap has been introduced to accurately track the isRequesting status across multiple useXChat instances, resolving previous multi-instance state errors and ensuring correct loading indicators.
  • Enriched Callbacks for requestPlaceholder and requestFallback: The callback functions for requestPlaceholder and requestFallback now receive more comprehensive context, including the full requestParams and the original message, enabling more powerful and context-aware custom logic.
  • Expanded Test Coverage: A significant number of new unit tests have been added for OpenAIChatProvider's message transformation functions, covering various scenarios like streaming, non-streaming, function calls, and edge cases, thereby improving reliability.
  • Updated Documentation: The useXChat documentation has been revised to reflect the new function signatures and parameters for requestPlaceholder and requestFallback.
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.

Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

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.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sdk-fix

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

github-actions bot commented Oct 21, 2025

Preview is ready

Copy link

cloudflare-workers-and-pages bot commented Oct 21, 2025

Deploying ant-design-x with  Cloudflare Pages  Cloudflare Pages

Latest commit: 74c6de8
Status: ✅  Deploy successful!
Preview URL: https://bacb17dd.ant-design-x.pages.dev
Branch Preview URL: https://sdk-fix.ant-design-x.pages.dev

View logs

Copy link

@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 several important fixes and enhancements to the useXChat hook, including per-conversation request state management, improved callback signatures for requestPlaceholder and requestFallback, and support for handling arrays of messages from transformLocalMessage. The significant expansion of test coverage is also a commendable improvement. However, I have identified two critical issues in packages/x-sdk/src/x-chat/index.ts that could lead to runtime errors and should be addressed. Additionally, there are a couple of minor documentation errors that need correction.

Copy link
Contributor

github-actions bot commented Oct 21, 2025

size-limit report 📦

Path Size
packages/x/dist/antdx.min.js 66.75 KB
packages/x-sdk/dist/x-sdk.min.js 7.31 KB (+45 B 🔺)
packages/x-markdown/dist/x-markdown.min.js 43.51 KB
packages/x-markdown/dist/plugins/code-high-light.min.js 278.82 KB
packages/x-markdown/dist/plugins/latex.min.js 61.94 KB
packages/x-markdown/dist/plugins/mermaid.min.js 850.92 KB

Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.95%. Comparing base (485b4a4) to head (74c6de8).
⚠️ Report is 1 commits behind head on next.

Files with missing lines Patch % Lines
packages/x-sdk/src/x-chat/index.ts 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1254      +/-   ##
==========================================
+ Coverage   94.89%   94.95%   +0.06%     
==========================================
  Files         138      138              
  Lines        3586     3590       +4     
  Branches     1011     1016       +5     
==========================================
+ Hits         3403     3409       +6     
+ Misses        182      180       -2     
  Partials        1        1              

☔ 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 Oct 21, 2025
@kimteayon kimteayon merged commit d51be74 into next Oct 21, 2025
12 of 13 checks passed
@kimteayon kimteayon deleted the sdk-fix branch October 21, 2025 12:00
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

Development

Successfully merging this pull request may close these issues.

2 participants