-
Notifications
You must be signed in to change notification settings - Fork 2.6k
add mermaid buttons #4547
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
add mermaid buttons #4547
Conversation
6c00b45 to
11cc721
Compare
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.
mrubens
left a comment
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.
UX-wise, main feedback is that clicking to drag doesn't work like I expect when I zoom in. Are you all seeing the same thing? The zoom buttons zoom you in pretty slow too, and it would be nice to be able to hold them down to keep zooming.
d59524f to
f335fdc
Compare
@mrubens fixed @daniel-lxs I also found a problem, in this commit: |
|
@qdaxb I can fix the issue with the copy button, sorry about that! |
daniel-lxs
left a comment
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.
@qdaxb
I fixed the copy button! now it should copy the actual diagram.
This looks awesome!
|
I just pushed a change to increase the max zoom - at least for the one I tested on I needed more. I'm still struggling to figure out how to copy the image instead of the markup @daniel-lxs - am I missing something? |
|
@mrubens |
|
@mrubens Since I don't think is possible to directly copy the image using the vscode API that doesn't involve copying the datauri or spawning a child process with a command, which in my opinion isn't very clean, I added the save button to directly save the image. Let me know what you think! |
* add mermaid buttons * feat: Add Modal, TabButton, and ZoomControls components * feat: Add error handling messages for image operations and file opening * mermaid: Add drag functionality and support contious zooming * add active color for tabbutton * refactor zoom controls * refactor: Remove unused svgToPng prop and simplify handleCopy function * Move zoom to constants and increase max zoom * feat: add save image functionality and refactor image handling * feat: add translations --------- Co-authored-by: Daniel Riccio <[email protected]> Co-authored-by: Matt Rubens <[email protected]>


Related GitHub Issue
Closes: #4546
Description
Test Procedure
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) has been removed.npm test).mainbranch.npm run changesetif this PR includes user-facing changes or dependency updates.Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
Important
Adds interactive buttons to Mermaid diagrams for zoom, copy, and code view, with clipboard support for images.
MermaidButtoncomponent inMermaidButton.tsxfor interactive buttons on Mermaid diagrams.openImagefunction inopen-file.tsnow supports a "copy" action to copy images to clipboard.webviewMessageHandler.tsupdated to handle "openImage" message with copy action.MermaidBlock.tsxintegratesMermaidButtonfor enhanced diagram interaction.MermaidButton.tsx.This description was created by
for cbf9a6ec49ef909bc2848b2e53b24dd25334760c. You can customize this summary. It will automatically update as commits are pushed.