Skip to content

feat(docs): add click-to-zoom modal with panzoom for mermaid flowcharts#136

Merged
JusterZhu merged 2 commits into
mainfrom
docs/core-execution-flow
Jun 21, 2026
Merged

feat(docs): add click-to-zoom modal with panzoom for mermaid flowcharts#136
JusterZhu merged 2 commits into
mainfrom
docs/core-execution-flow

Conversation

@JusterZhu

@JusterZhu JusterZhu commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

之前 PR #135 的外置滚动条方案体验不够好,用户需求是「可以放大查看」。改用 Panzoom 交互式放大查看器

实现方案

通过 Docusaurus theme shadowing 自定义 @theme/Mermaid 组件:

文件 作用
src/theme/Mermaid/index.js 完全替换 Mermaid 渲染组件,添加点击弹窗 + Panzoom 交互
src/theme/Mermaid/styles.module.css 弹窗、工具栏、缩放容器样式 (CSS Modules)
src/css/custom.css 移除旧的外置滚动条 CSS
package.json 新增依赖 @panzoom/panzoom

交互体验

  • 点击流程图 - 弹出全屏遮罩层
  • 鼠标滚轮 - 放大/缩小
  • 拖拽 - 平移视图
  • 工具栏按钮:放大/缩小/重置/关闭
  • 键盘快捷键:Esc 关闭,+/= 放大,- 缩小
  • 深色/浅色主题适配
  • 遮罩背景模糊 + 平滑动画

JusterZhu and others added 2 commits June 21, 2026 13:14
…charts

The Core-flow page has 11 wide horizontal mermaid flowcharts that
were squished into the content column, making them unreadable.

- Set .docusaurus-mermaid-container to overflow-x: auto
- Let SVG keep natural width (min-width: 600px)
- Add styled scrollbar for desktop
- Subtle hover shadow for visual feedback

Co-Authored-By: Claude <noreply@anthropic.com>
Replace the basic scrollbar approach with a full interactive viewer:
- Click any mermaid diagram to open a fullscreen modal overlay
- Pan (drag) and zoom (scroll/+/- buttons) to freely explore
- Toolbar with zoom in/out/reset/close buttons
- Escape key to close, +/=/- keyboard shortcuts
- Dark/light theme support
- Smooth overlay animation

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 21, 2026 05:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants