feat(router): add minMargin option to rightAngle router to suppress margin-overlap detours#3266
Draft
Geliogabalus wants to merge 8 commits intoclientIO:masterfrom
Draft
feat(router): add minMargin option to rightAngle router to suppress margin-overlap detours#3266Geliogabalus wants to merge 8 commits intoclientIO:masterfrom
Geliogabalus wants to merge 8 commits intoclientIO:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new minMargin option to the rightAngle router to reduce unnecessary “detour around margin” routes when elements are adjacent and their margin zones only minimally overlap, and introduces a new JS playground example to demonstrate the behavior.
Changes:
- Add
minMarginoption torightAngleRouterand thread it through allrouteBetweenPointscalls. - Add “ignore overlapping margin” logic in
routeBetweenPointsfor opposite-side routing cases. - Add a new
examples/right-angle-playground-jsworkspace demo (and lockfile entry).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds the new @joint/demo-right-angle-playground-js workspace entry. |
| packages/joint-core/src/routers/rightAngle.mjs | Implements minMargin option and new margin-overlap suppression logic. |
| examples/right-angle-playground-js/src/styles.css | Styling for the new playground demo. |
| examples/right-angle-playground-js/src/main.js | Demo setup showcasing rightAngle routing with minMargin. |
| examples/right-angle-playground-js/package.json | Declares the new example workspace package and its scripts/deps. |
| examples/right-angle-playground-js/index.html | HTML entrypoint for the new Vite demo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kumilingus
previously approved these changes
Apr 14, 2026
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.
Summary
minMarginoption torightAngleRouterminMarginthrough to everyrouteBetweenPointscall (all four anchor-side combinations: top→bottom, bottom→top, left→right, right→left)routeBetweenPoints, deriveignoreOverlappingMargin = (sourceMargin + targetMargin) - 2 * minMargin— when the margin zones of two adjacent elements overlap by at most this threshold the router skips the detour-around-margin logic and routes directly between the anchorsright-angle-playground-jsexample that demonstrates the option in actionTest plan
minMarginis set and the margin overlap is within the thresholdminMargin(defaultnull) preserves existing routing behaviour🤖 Generated with Claude Code