Skip to content

Export diagram from model to mermaid code#174

Open
cheryl7114 wants to merge 6 commits into
serverlessworkflow:mainfrom
cheryl7114:mermaid-export-150
Open

Export diagram from model to mermaid code#174
cheryl7114 wants to merge 6 commits into
serverlessworkflow:mainfrom
cheryl7114:mermaid-export-150

Conversation

@cheryl7114

Copy link
Copy Markdown
Contributor

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

  • Copy Mermaid Code - copy mermaid string to clipboard
  • Download as Mermaid File - download workflow as a .mmd file

Cheryl Kong added 3 commits June 8, 2026 15:38
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 cheryl7114 requested review from Copilot, fantonangeli, handreyrc, kumaradityaraj and lornakelly and removed request for Copilot and lornakelly June 9, 2026 08:40
@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for swf-editor ready!

Name Link
🔨 Latest commit 449b14a
🔍 Latest deploy log https://app.netlify.com/projects/swf-editor/deploys/6a27fdc57cd94400086f487c
😎 Deploy Preview https://deploy-preview-174--swf-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cheryl7114 cheryl7114 requested a review from Copilot June 9, 2026 08:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 in src/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.

Comment thread packages/serverless-workflow-diagram-editor/src/core/mermaidExport.ts Outdated
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
@cheryl7114 cheryl7114 requested a review from Copilot June 9, 2026 11:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread packages/serverless-workflow-diagram-editor/tests/side-panel/SidePanel.test.tsx Outdated
Comment thread .changeset/mermaid-export.md Outdated
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
@cheryl7114 cheryl7114 requested a review from Copilot June 9, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread packages/serverless-workflow-diagram-editor/tests/side-panel/SidePanel.test.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/core/mermaidExport.ts Outdated
Comment thread .changeset/mermaid-export.md Outdated
@cheryl7114 cheryl7114 requested a review from Copilot June 9, 2026 11:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread packages/serverless-workflow-diagram-editor/src/side-panel/SidePanel.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/side-panel/SidePanel.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/src/core/mermaidExport.ts Outdated
Comment thread packages/serverless-workflow-diagram-editor/tests/side-panel/SidePanel.test.tsx Outdated
Signed-off-by: Cheryl Kong <cherylkong50@gmail.com>
@cheryl7114 cheryl7114 requested a review from Copilot June 9, 2026 11:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

@cheryl7114 cheryl7114 requested a review from lornakelly June 9, 2026 11:59
@handreyrc

Copy link
Copy Markdown
Contributor

@cheryl7114,
I noticed that in the build process we have many warnings related to storybook such as the one below.
image

Could you take a look?

@kumaradityaraj kumaradityaraj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

4 participants