feat: support bound arrows via skeleton API start/end format#32
Open
sammcj wants to merge 4 commits intoexcalidraw:mainfrom
Open
feat: support bound arrows via skeleton API start/end format#32sammcj wants to merge 4 commits intoexcalidraw:mainfrom
sammcj wants to merge 4 commits intoexcalidraw:mainfrom
Conversation
|
@sammcj is attempting to deploy a commit to the Excalidraw Team on Vercel. A member of the Team first needs to authorize it. |
Author
Author
|
Sorry to ping you directly but @dwelle any chance this could be considered for merging as it significantly improves the quality of the output generated with this MCP server. |
|
Was this implemented? |
Author
|
Nope, no response from the maintainers |
Author
|
@antonpk1 maybe? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes issues where agents using the MCP server would create diagrams but not correctly connect / anchor arrows and lines to objects, leading to them floating where if you move an object the line or arrow would not remain connected. #33
Summary
start/endarrow binding format, which lets agents create connected arrows without computing coordinates manuallyresolveArrowPositionspost-processing step that computes arrow geometry from bound shape edges, fixing the gap whereconvertToExcalidrawElementscreates binding metadata but leaves arrows unpositioned!= nullinstead ofisNaNcheck, avoiding false positives when arrow coordinates are legitimately0Problem
AI agents consistently produced diagrams with floating arrows because:
startBinding/endBinding(inert output metadata) instead of the skeleton API'sstart/endinput formatconvertToExcalidrawElementssets up bidirectional binding metadata but does not compute arrow x/y/points — arrows are left at undefined coordinatesexportToSvg(used for all rendering) cannot render arrows without coordinatesChanges
src/server.ts— Cheat sheet updates:start/endby target element IDstartBinding/endBindingdocs with skeletonstart/endformatsrc/mcp-app.tsx— Arrow position resolution:resolveArrowPositions(): computes arrow x/y/points from bound shape edge midpoints using closest-cardinal-point geometrycontextElementsparameter toconvertRawElementsso arrows can resolve binding targets from checkpoint base elementsCLAUDE.md— Correct project documentation to reflect skeleton API usage