x icon indicating copy to clipboard operation
x copied to clipboard

feat: Replace x/Actions in Mermaid and HighlightCode component

Open Rain120 opened this issue 4 months ago • 12 comments

中文版模板 / Chinese template

🤔 This is a ...

  • [x] 🆕 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

close https://github.com/ant-design/x/issues/1283

💡 Background and Solution

Use x/Actions instead of the direct button component with mermaid operate component

📝 Change Log

Language Changelog
🇺🇸 English Replaced x/Actions within the Mermaid component. 
🇨🇳 Chinese 使用 x/Actions 替换 mermaid中的功能按钮

Rain120 avatar Oct 31 '25 08:10 Rain120

Preview is ready

github-actions[bot] avatar Oct 31 '25 08:10 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 Oct 31 '25 08:10 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 standardizes the interactive controls within the Mermaid component by migrating from a collection of individual Ant Design Button components to the custom x/Actions component. This change enhances code consistency, simplifies the management of UI actions such as copy, zoom, reset, and download, and aligns the component with the project's internal component library.

Highlights

  • Component Refactoring: The action buttons within the Mermaid component have been refactored to utilize the x/Actions component from @ant-design/x.
  • Code Simplification: Individual Button, Space, and Tooltip components from antd have been replaced by a single, unified Actions component, streamlining the UI code.
  • New Icon: The UndoOutlined icon has been introduced and integrated for the zoom reset functionality.
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 Oct 31 '25 08:10 gemini-code-assist[bot]

Bundle Report

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

Bundle name Size Change
x-markdown-array-push 4.15MB 3.98MB (2248.57%) :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:
~~x-markdown.min.js~~ (Deleted) -174.15kB 0 bytes -100.0% :wastebasket:
~~x-markdown.min.css~~ (Deleted) -2.75kB 0 bytes -100.0% :wastebasket:

codecov[bot] avatar Oct 31 '25 08:10 codecov[bot]

标题需要遵守规范同时需要 关联issue gemini-code-assist 提的问题需要看下

kimteayon avatar Oct 31 '25 08:10 kimteayon

标题需要遵守规范同时需要 关联issue gemini-code-assist 提的问题需要看下

  • [ ] 标题规范在哪里看呀
  • [x] related issue了
  • [x] assist的评论是因为翻译错误导致误导我的问题 image image

Rain120 avatar Oct 31 '25 08:10 Rain120

标题需要遵守规范同时需要 关联issue gemini-code-assist 提的问题需要看下

  • [ ] 标题规范在哪里看呀
  • [x] related issue了
  • [x] assist的评论是因为翻译错误导致误导我的问题

image image

kimteayon avatar Oct 31 '25 09:10 kimteayon

更新日志 需要补齐中英文 列表上可以看其他的pr参照命名

kimteayon avatar Oct 31 '25 09:10 kimteayon

需要确保 checks 全部通过

Div627 avatar Nov 02 '25 14:11 Div627

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 94.21%. Comparing base (7010ca4) to head (0275fb9).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #1291      +/-   ##
==========================================
+ Coverage   94.06%   94.21%   +0.14%     
==========================================
  Files         144      144              
  Lines        3708     3731      +23     
  Branches     1023     1048      +25     
==========================================
+ Hits         3488     3515      +27     
+ Misses        218      214       -4     
  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 03 '25 06:11 codecov[bot]

需要合并下最新的next分支,并且代码高亮插件(HighlightCode)也需要替换哈

Div627 avatar Nov 06 '25 06:11 Div627

@Div627 done

Rain120 avatar Nov 17 '25 13:11 Rain120