Export diagram from model to mermaid code#174
Conversation
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
✅ Deploy Preview for swf-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds Mermaid export capabilities to the diagram editor, exposing “copy” and “download” actions from the SidePanel and providing a core utility to generate Mermaid code.
Changes:
- Add
exportToMermaid+ clipboard/file download helpers insrc/core - Expose “Copy Mermaid Code” and “Download as Mermaid File” buttons in
SidePanel - Add i18n strings and tests for both core export and SidePanel rendering states
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/serverless-workflow-diagram-editor/tests/side-panel/SidePanel.test.tsx | Adds UI-state tests for Mermaid export buttons visibility. |
| packages/serverless-workflow-diagram-editor/tests/core/mermaidExport.test.ts | Adds a unit test for Mermaid conversion output shape. |
| packages/serverless-workflow-diagram-editor/src/side-panel/SidePanel.tsx | Adds export buttons + handlers wired to new Mermaid export helpers. |
| packages/serverless-workflow-diagram-editor/src/i18n/locales/en.ts | Adds English strings for Mermaid export UI. |
| packages/serverless-workflow-diagram-editor/src/core/mermaidExport.ts | Introduces Mermaid export, clipboard copy, and download helpers. |
| packages/serverless-workflow-diagram-editor/src/core/index.ts | Re-exports the new Mermaid export module. |
| .changeset/mermaid-export.md | Declares a minor release for the new functionality. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
|
@cheryl7114, Could you take a look? |
fantonangeli
left a comment
There was a problem hiding this comment.
@cheryl7114 I only added one comment in addition to other's comments.
Can you please also add the issue link in the description?
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
| const [isCopied, setIsCopied] = React.useState(false); | ||
| const copyTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null); |
| copyTimeoutRef.current = setTimeout(() => { | ||
| setIsCopied(false); | ||
| copyTimeoutRef.current = null; | ||
| }, 2000); |
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>

Closes #150
Changes Made
Added two buttons to export diagram model (JSON/YAML) to Mermaid: