-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: mermaid diagrams #6455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. I had tried this.
currently mermaid does not support var for colors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nitpick comments but this looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those changes! Bummer that mermaid doesn't support CSS vars.
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.
mermaid
and@panzoom/panzoom
packages.