feat: mermaid diagrams#6455
Conversation
basic mermaid js implementation add panzoom and change color theme variables
👷 Deploy request for continuedev pending review.Visit the deploys page to approve it
|
2257c73 to
b090f04
Compare
|
@uinstinct this is beautiful 🤩 Seems like a couple of tests failing, maybe just with import problems? Super excited to get this merged, and you should demo it next week! Edit: I think you just need to run |
| return ( | ||
| <> | ||
| {isLoading && ( | ||
| <div className="text-vsc-foreground text-sm">Generating diagram...</div> |
There was a problem hiding this comment.
| <div className="text-vsc-foreground text-sm">Generating diagram...</div> | |
| <div className="text-vsc-foreground text-xs">Generating diagram...</div> |
nitpick
| setIsLoading(true); | ||
| }, [code]); | ||
|
|
||
| useDebouncedEffect( |
There was a problem hiding this comment.
Could we use async/await here for readability/consistency with the rest of the codebase?
|
|
||
| const MINIMUM_ZOOM_STEP = 0.05; | ||
|
|
||
| const MERMAID_THEME_COLORS = { |
There was a problem hiding this comment.
Could we pull in any of the theme variables from our tailwind config here? At least for some things like background, primaryColor, etc, it should map pretty cleanly.
There was a problem hiding this comment.
you are right. I had tried this.
currently mermaid does not support var for colors

Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Few nitpick comments but this looks great!
Patrick-Erichsen
left a comment
There was a problem hiding this comment.
Thanks for making those changes! Bummer that mermaid doesn't support CSS vars.
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Render mermaid diagrams into chat area.
Checklist
Screenshots
feat.mp4
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Added support for rendering Mermaid diagrams in the chat area, including zoom and pan controls.
mermaidand@panzoom/panzoompackages.