You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For requesting to pull a new feature or bugfix, please send it from a feature/bugfix branch based on the `master` branch.
6
+
Before submitting your pull request, please make sure the checklist below is confirmed.
7
+
Your pull requests will be merged after one of the collaborators approve.
8
+
Thank you!
9
+
-->
10
+
11
+
[中文版模板 / Chinese template](https://github.com/ant-design/x/blob/master/.github/PULL_REQUEST_TEMPLATE_CN.md?plain=1)
12
+
13
+
### 🤔 This is a ...
14
+
15
+
-[ ] 🆕 New feature
16
+
-[ ] 🐞 Bug fix
17
+
-[ ] 📝 Site / documentation improvement
18
+
-[ ] 📽️ Demo improvement
19
+
-[ ] 💄 Component style improvement
20
+
-[ ] 🤖 TypeScript definition improvement
21
+
-[ ] 📦 Bundle size optimization
22
+
-[ ] ⚡️ Performance optimization
23
+
-[ ] ⭐️ Feature enhancement
24
+
-[ ] 🌐 Internationalization
25
+
-[x] 🛠 Refactoring
26
+
-[ ] 🎨 Code style optimization
27
+
-[x] ✅ Test Case
28
+
-[ ] 🔀 Branch merge
29
+
-[ ] ⏩ Workflow
30
+
-[ ] ⌨️ Accessibility improvement
31
+
-[ ] ❓ Other (about what?)
32
+
33
+
### 🔗 Related Issues
34
+
35
+
<!-- If there's a related issue, please link it here. If not, you can remove this section. -->
36
+
37
+
### 💡 Background and Solution
38
+
39
+
**Background:** Refactor Mermaid component to use the unified `Actions` component for operation buttons, replacing custom button implementations to improve code consistency and maintainability.
40
+
41
+
**Solution:**
42
+
43
+
- Use `@ant-design/x/es/actions` component to render operation buttons (copy, zoom in, zoom out, reset, download)
44
+
- Dynamically display different action items based on render mode (image/code)
45
+
- Update test cases to adapt to Actions component's DOM structure (use `getByLabelText` to find icons, then locate clickable container via `closest`)
46
+
- Add Chinese localization for Mermaid component
47
+
48
+
**Changes:**
49
+
50
+
- Replace custom button implementation with Actions component
51
+
- Fix test case element queries (Actions renders `div` instead of `button`)
52
+
- Update localization files with Mermaid-related Chinese translations
53
+
54
+
### 📝 Change Log
55
+
56
+
> - Read [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) like a cat tracks a laser pointer.
57
+
> - Describe the impact of the changes on developers, not the solution approach.
58
+
> - Reference: https://x.ant.design/changelog
59
+
60
+
| Language | Changelog |
61
+
| --- | --- |
62
+
| 🇺🇸 English | Refactor Mermaid component to use Actions component for operation buttons, improving code consistency and maintainability. |
63
+
| 🇨🇳 Chinese | 重构 Mermaid 组件,使用 Actions 组件统一渲染操作按钮,提升代码一致性和可维护性。 |
0 commit comments