x icon indicating copy to clipboard operation
x copied to clipboard

Feat: XMarkdown footer node

Open Rain120 opened this issue 4 months ago โ€ข 9 comments

ไธญๆ–‡็‰ˆๆจกๆฟ / Chinese template

๐Ÿค” This is a ...

  • [x] ๐Ÿ†• New feature
  • [ ] ๐Ÿž Bug fix
  • [x] ๐Ÿ“ Site / documentation improvement
  • [x] ๐Ÿ“ฝ๏ธ 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 https://github.com/ant-design/x/issues/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 ็ป„ไปถ

Rain120 avatar Nov 04 '25 03:11 Rain120

Preview is ready

github-actions[bot] avatar Nov 04 '25 03:11 github-actions[bot]

[!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.

coderabbitai[bot] avatar Nov 04 '25 03:11 coderabbitai[bot]

Summary of Changes

Hello @Rain120, I'm Gemini Code Assist[^1]! 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 :thumbsup: and :thumbsdown: 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.

[^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[bot] avatar Nov 04 '25 03:11 gemini-code-assist[bot]

Summary of Changes

Hello @Rain120, I'm Gemini Code Assist[^1]! 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 :thumbsup: and :thumbsdown: 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.

[^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[bot] avatar Nov 04 '25 03:11 gemini-code-assist[bot]

Bundle Report

Changes will increase total bundle size by 244.17kB (17.83%) :arrow_up::warning:, exceeding the configured threshold of 5%.

Bundle name Size Change
x-markdown-array-push 1.61MB 244.17kB (17.83%) :arrow_up::warning:

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% :rocket:
latex.css (New) 24.32kB 24.32kB 100.0% :rocket:
~~latex.min.js~~ (Deleted) -268.76kB 0 bytes -100.0% :wastebasket:
~~latex.min.css~~ (Deleted) -24.32kB 0 bytes -100.0% :wastebasket:

codecov[bot] avatar Nov 04 '25 04:11 codecov[bot]

Codecov Report

:x: Patch coverage is 85.00000% with 6 lines in your changes missing coverage. Please review. :white_check_mark: 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 :warning:
packages/x-markdown/src/XMarkdown/index.tsx 94.11% 1 Missing :warning:
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              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Nov 04 '25 12:11 codecov[bot]

ๅˆๅนถไธ‹ๆœ€ๆ–ฐ็š„ next ๅˆ†ๆ”ฏๅ“ˆ

Div627 avatar Nov 06 '25 06:11 Div627

@Div627 done

Rain120 avatar Nov 17 '25 13:11 Rain120

ๆต‹่ฏ•่ฆ†็›–็އๆฒกๆœ‰้€š่ฟ‡

Div627 avatar Nov 21 '25 01:11 Div627