Skip to content

Conversation

@Rain120
Copy link
Contributor

@Rain120 Rain120 commented Nov 4, 2025

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

related #1284

💡 Background and Solution

Custom footer component in XMarkdown, for example, Spin.

image

📝 Change Log

Language Changelog
🇺🇸 English React component for customizing the rendering of footer content during streaming rendering
🇨🇳 Chinese 用于在流式渲染过程中自定义渲染尾部内容的 React 组件

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

Preview is ready

@Rain120 Rain120 changed the base branch from main to next November 4, 2025 03:56
@dosubot dosubot bot added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 4, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 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

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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 @Rain120, 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 represents a substantial architectural shift for the project, transitioning to a monorepo setup to better manage its growing suite of components and tools. Alongside this significant restructuring, a new feature has been added to XMarkdown, enabling custom footer components for streaming content. The migration involved a comprehensive overhaul of the documentation infrastructure, build processes, and development tooling, ensuring consistency and maintainability across the newly defined packages.

Highlights

  • Monorepo Migration: The project has undergone a significant architectural change, migrating to a monorepo structure. This involves reorganizing components into separate packages such as @ant-design/x, @ant-design/x-markdown, and @ant-design/x-sdk.
  • XMarkdown Footer Node Feature: A new feature has been introduced to XMarkdown, enabling the use of a custom footer component, such as a Spin component, during streaming rendering.
  • Documentation and Build System Overhaul: The entire documentation site infrastructure (.dumi files), build configuration (.fatherrc.ts), and testing setup (.jest.js) have been extensively refactored or removed to align with the new monorepo architecture.
  • Updated Project Metadata and Tooling: The README.md and CHANGELOG.md files have been updated to reflect the new monorepo structure, including new package badges and local development instructions. Additionally, a new .husky/commit-msg hook has been added for commit message enforcement, and biome.json has been updated for monorepo paths and new linting rules.
Ignored Files
  • Ignored by pattern: .github/workflows/** (5)
    • .github/workflows/main.yml
    • .github/workflows/preview-build.yml
    • .github/workflows/preview-deploy.yml
    • .github/workflows/site-deploy.yml
    • .github/workflows/size-limit.yml
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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Rain120, 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 significant enhancement to the XMarkdown component by providing a dedicated footer prop. This new feature allows users to define and render a custom React component at the end of the markdown content, particularly useful for displaying dynamic elements like loading indicators during streaming rendering. This improves the user experience by offering more control over the visual feedback during content delivery.

Highlights

  • Custom Footer Prop: Introduced a new footer prop to the XMarkdown component, allowing developers to specify a custom React component or intrinsic HTML element to be rendered as a footer.
  • Streaming Integration: The specified footer component is now dynamically inserted into the rendered output specifically when XMarkdown is in streaming mode, enabling custom loading indicators or other dynamic content at the end of the stream.
  • Demo and Documentation: A new demo (md-footer.tsx) has been added to showcase the usage of the footer prop with a Spin component, and the API documentation (English and Chinese) has been updated to reflect this new feature.
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

@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 a new footer prop to the XMarkdown component, allowing a custom component to be displayed during streaming rendering. The implementation is mostly correct, but there are a few issues to address. I've found a couple of bugs in the main component logic related to memoization dependencies and when the footer is displayed. There's also a bug in the streaming simulation logic in the new demo component that could lead to resource leaks. Finally, there's a small documentation error in the English API docs. I've left detailed comments with suggestions for fixes.

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 a new footer prop to the XMarkdown component, allowing for custom content to be displayed during streaming rendering. The implementation is generally on the right track, but there are a few areas that need attention. The useMemo hook for constructing components has an inefficient dependency array, and the footer element is appended unconditionally. More critically, the new demo component for this feature contains significant logic flaws, including a stale closure and an infinite re-render loop, which should be addressed. Additionally, there's a minor error in the English documentation for the new prop's type. My review includes suggestions to fix these issues.

@codecov
Copy link

codecov bot commented Nov 4, 2025

Bundle Report

Changes will increase total bundle size by 244.17kB (17.83%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
x-markdown-array-push 1.61MB 244.17kB (17.83%) ⬆️⚠️

Affected Assets, Files, and Routes:

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

Assets Changed:

Asset Name Size Change Total Size Change (%)
latex.js (New) 512.93kB 512.93kB 100.0% 🚀
latex.css (New) 24.32kB 24.32kB 100.0% 🚀
latex.min.js (Deleted) -268.76kB 0 bytes -100.0% 🗑️
latex.min.css (Deleted) -24.32kB 0 bytes -100.0% 🗑️

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 85.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.95%. Comparing base (7010ca4) to head (c4d1b91).

Files with missing lines Patch % Lines
packages/x-markdown/src/XMarkdown/core/Renderer.ts 61.53% 5 Missing ⚠️
packages/x-markdown/src/XMarkdown/index.tsx 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1296      +/-   ##
==========================================
- Coverage   94.06%   93.95%   -0.12%     
==========================================
  Files         144      144              
  Lines        3708     3736      +28     
  Branches     1023     1048      +25     
==========================================
+ Hits         3488     3510      +22     
- Misses        218      224       +6     
  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.

@Div627
Copy link
Contributor

Div627 commented Nov 6, 2025

合并下最新的 next 分支哈

@Rain120
Copy link
Contributor Author

Rain120 commented Nov 17, 2025

@Div627 done

@Div627
Copy link
Contributor

Div627 commented Nov 21, 2025

测试覆盖率没有通过

@Samoy Samoy mentioned this pull request Nov 21, 2025
17 tasks
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 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants