Feat: XMarkdown footer node
ไธญๆ็ๆจกๆฟ / 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.
๐ Change Log
| Language | Changelog |
|---|---|
| ๐บ๐ธ English | React component for customizing the rendering of footer content during streaming rendering |
| ๐จ๐ณ Chinese | ็จไบๅจๆตๅผๆธฒๆ่ฟ็จไธญ่ชๅฎไนๆธฒๆๅฐพ้จๅ ๅฎน็ React ็ปไปถ |
[!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.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein 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_instructionssetting.- Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.Example instruction:
"Divide the high-level summary into five sections:
- ๐ Description โ Summarize the main change in 50โ60 words, explaining what was done.
- ๐ References โ List relevant issues, discussions, documentation, or related PRs.
- ๐ฆ Dependencies & Requirements โ Mention any new/updated dependencies, environment variable changes, or configuration updates.
- ๐ Contributor Summary โ Include a Markdown table showing contributions:
| Contributor | Lines Added | Lines Removed | Files Changed |- โ๏ธ 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
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
Spincomponent, during streaming rendering. -
Documentation and Build System Overhaul: The entire documentation site infrastructure (
.dumifiles), 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.mdandCHANGELOG.mdfiles have been updated to reflect the new monorepo structure, including new package badges and local development instructions. Additionally, a new.husky/commit-msghook has been added for commit message enforcement, andbiome.jsonhas 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.
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
footerprop to theXMarkdowncomponent, allowing developers to specify a custom React component or intrinsic HTML element to be rendered as a footer. -
Streaming Integration: The specified
footercomponent is now dynamically inserted into the rendered output specifically whenXMarkdownis 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 thefooterprop with aSpincomponent, 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.
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 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.
ๅๅนถไธๆๆฐ็ next ๅๆฏๅ
@Div627 done
ๆต่ฏ่ฆ็็ๆฒกๆ้่ฟ
