x icon indicating copy to clipboard operation
x copied to clipboard

refactor(x-markdown): 使用 Actions 组件替换按钮组

Open Samoy opened this issue 3 months ago • 8 comments

🤔 This is a ...

  • [ ] 🆕 New feature
  • [ ] 🐞 Bug fix
  • [ ] 📝 Site / documentation improvement
  • [ ] 📽️ Demo improvement
  • [x] 💄 Component style improvement
  • [ ] 🤖 TypeScript definition improvement
  • [ ] 📦 Bundle size optimization
  • [ ] ⚡️ Performance optimization
  • [ ] ⭐️ Feature enhancement
  • [ ] 🌐 Internationalization
  • [x] 🛠 Refactoring
  • [ ] 🎨 Code style optimization
  • [ ] ✅ Test Case
  • [ ] 🔀 Branch merge
  • [ ] ⏩ Workflow
  • [ ] ⌨️ Accessibility improvement
  • [ ] ❓ Other (about what?)

🔗 Related Issues

fix #1283

💡 Background and Solution

Resolve the issue where the toolbar icons of HighlightCode and Mermaid do not comply with ant-design/x standards

📝 Change Log

Language Changelog
🇺🇸 English Resolve the issue where the toolbar icons of HighlightCode and Mermaid do not comply with ant-design/x standards
🇨🇳 Chinese 解决HighlightCode和Mermaid的操作栏图标不符合ant-design/x规范的问题

Samoy avatar Nov 11 '25 01:11 Samoy

Preview is ready

github-actions[bot] avatar Nov 11 '25 01: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

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 11 '25 01:11 coderabbitai[bot]

Summary of Changes

Hello @Samoy, 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!

此拉取请求旨在通过将 x-markdown 库中 HighlightCodeMermaid 插件的工具栏操作按钮替换为 Actions 组件,来重构和标准化用户界面。这一更改确保了这些组件的图标和交互符合 ant-design/x 的设计规范,从而提升了整体的用户体验和代码一致性。

Highlights

  • 组件替换: 将 HighlightCodeMermaid 插件中的按钮组替换为统一的 Actions 组件。
  • 符合规范: 解决 HighlightCodeMermaid 工具栏图标不符合 ant-design/x 规范的问题。
  • 代码优化: 简化了相关代码,提高了组件的一致性和可维护性。
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 11 '25 01:11 gemini-code-assist[bot]

Bundle Report

Changes will increase total bundle size by 2.78MB (203.25%) :arrow_up::warning:, exceeding the configured threshold of 5%.

Bundle name Size Change
x-markdown-array-push 4.15MB 2.78MB (203.25%) :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 (%)
mermaid.min.js (New) 4.15MB 4.15MB 100.0% :rocket:
~~latex.min.js~~ (Deleted) -268.76kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_AMS-Regular.*.ttf~~ (Deleted) -63.63kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Regular.*.ttf~~ (Deleted) -53.58kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Bold.*.ttf~~ (Deleted) -51.34kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Italic.*.ttf~~ (Deleted) -33.58kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_AMS-Regular.*.woff~~ (Deleted) -33.52kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-BoldItalic.*.ttf~~ (Deleted) -32.97kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Math-Italic.*.ttf~~ (Deleted) -31.31kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Math-BoldItalic.*.ttf~~ (Deleted) -31.2kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Regular.*.woff~~ (Deleted) -30.77kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Bold.*.woff~~ (Deleted) -29.91kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_AMS-Regular.*.woff2~~ (Deleted) -28.08kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Typewriter-Regular.*.ttf~~ (Deleted) -27.56kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Regular.*.woff2~~ (Deleted) -26.27kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Bold.*.woff2~~ (Deleted) -25.32kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Bold.*.ttf~~ (Deleted) -24.5kB 0 bytes -100.0% :wastebasket:
~~latex.min.css~~ (Deleted) -24.32kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Italic.*.ttf~~ (Deleted) -22.36kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Italic.*.woff~~ (Deleted) -19.68kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Fraktur-Bold.*.ttf~~ (Deleted) -19.58kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Fraktur-Regular.*.ttf~~ (Deleted) -19.57kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Regular.*.ttf~~ (Deleted) -19.44kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-BoldItalic.*.woff~~ (Deleted) -19.41kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Math-Italic.*.woff~~ (Deleted) -18.75kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Math-BoldItalic.*.woff~~ (Deleted) -18.67kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-Italic.*.woff2~~ (Deleted) -16.99kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Main-BoldItalic.*.woff2~~ (Deleted) -16.78kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Script-Regular.*.ttf~~ (Deleted) -16.65kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Math-Italic.*.woff2~~ (Deleted) -16.44kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Math-BoldItalic.*.woff2~~ (Deleted) -16.4kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Typewriter-Regular.*.woff~~ (Deleted) -16.03kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Bold.*.woff~~ (Deleted) -14.41kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Italic.*.woff~~ (Deleted) -14.11kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Typewriter-Regular.*.woff2~~ (Deleted) -13.57kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Fraktur-Bold.*.woff~~ (Deleted) -13.3kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Fraktur-Regular.*.woff~~ (Deleted) -13.21kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Caligraphic-Bold.*.ttf~~ (Deleted) -12.37kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Caligraphic-Regular.*.ttf~~ (Deleted) -12.34kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Regular.*.woff~~ (Deleted) -12.32kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size1-Regular.*.ttf~~ (Deleted) -12.23kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Bold.*.woff2~~ (Deleted) -12.22kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Italic.*.woff2~~ (Deleted) -12.03kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size2-Regular.*.ttf~~ (Deleted) -11.51kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Fraktur-Bold.*.woff2~~ (Deleted) -11.35kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Fraktur-Regular.*.woff2~~ (Deleted) -11.32kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Script-Regular.*.woff~~ (Deleted) -10.59kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size4-Regular.*.ttf~~ (Deleted) -10.36kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_SansSerif-Regular.*.woff2~~ (Deleted) -10.34kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Script-Regular.*.woff2~~ (Deleted) -9.64kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Caligraphic-Bold.*.woff~~ (Deleted) -7.72kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Caligraphic-Regular.*.woff~~ (Deleted) -7.66kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size3-Regular.*.ttf~~ (Deleted) -7.59kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Caligraphic-Bold.*.woff2~~ (Deleted) -6.91kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Caligraphic-Regular.*.woff2~~ (Deleted) -6.91kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size1-Regular.*.woff~~ (Deleted) -6.5kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size2-Regular.*.woff~~ (Deleted) -6.19kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size4-Regular.*.woff~~ (Deleted) -5.98kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size1-Regular.*.woff2~~ (Deleted) -5.47kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size2-Regular.*.woff2~~ (Deleted) -5.21kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size4-Regular.*.woff2~~ (Deleted) -4.93kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size3-Regular.*.woff~~ (Deleted) -4.42kB 0 bytes -100.0% :wastebasket:
~~static/KaTeX_Size3-Regular.*.woff2~~ (Deleted) -3.62kB 0 bytes -100.0% :wastebasket:

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

测试用例没有通过

Div627 avatar Nov 21 '25 01:11 Div627

测试用例没有通过

以修改测试用例以适配新的实现方式

Samoy avatar Nov 21 '25 02:11 Samoy

#1283

Samoy avatar Nov 21 '25 07:11 Samoy

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 94.17%. Comparing base (b755ae9) to head (d0b024a). :warning: Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1320      +/-   ##
==========================================
+ Coverage   94.07%   94.17%   +0.10%     
==========================================
  Files         144      144              
  Lines        3710     3693      -17     
  Branches     1041     1041              
==========================================
- Hits         3490     3478      -12     
+ Misses        218      213       -5     
  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 21 '25 14:11 codecov[bot]