Repository navigation
feat(core): prefer an interior corridor over the canvas-edge gutter - #2368
Merged
Merged
Conversation
4 tasks done
kompiro
force-pushed
the
feat/routing-shorter-detours
branch
from
August 5, 2026 23:10
ed231f5 to
92f6964
Compare
kompiro
force-pushed
the
feat/routing-shorter-detours
branch
from
August 7, 2026 13:23
92f6964 to
e60ed74
Compare
A blocked edge went straight out to a side gutter at the canvas edge, so on a wide diagram reaching a node two rows down meant crossing the whole layout twice. Offer a vertical lane beside each card first, nearest to the midpoint between the endpoints, and fall through to the gutters when none is clear. Unlike a gutter route, an interior corridor lets each endpoint attach on the side facing it, which is what makes a lane *between* the endpoints usable. Scoped to ungrouped canvases. P2c's gutter is penetration-safe by construction -- every lane x lies beyond all content -- and `distributeGutterLanes` widens lanes on that assumption. An interior corridor has neither property, so rather than weaken the grouped guarantee it is offered only where no frames exist, which is where the long detours were observed. For the same reason the router claims interior lanes as it routes: they cannot be lane-separated afterwards. Measured over the bundled examples (ungrouped): total edge length 45,780 -> 42,883 (-6.3%), crossings 42 -> 39, total width 12,707 -> 12,627. Best single case is ec-platform/04-annotations at -42% edge length. Grouped output is byte-identical. hr-tool is unchanged -- its rows overlap in x across every row its detours traverse, so no interior lane is clear and the gutter route stands. Closes #2365 Co-Authored-By: Claude Fable 5 <[email protected]>
kompiro
force-pushed
the
feat/routing-shorter-detours
branch
from
August 7, 2026 13:31
e60ed74 to
888ca37
Compare
This was referenced Aug 7, 2026
This branch was successfully deployed
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.
Purpose
Closes #2365 — slice D of #2330. Stack 2/4, builds on #2367.
Summary
A blocked edge used to run straight out to a gutter at the canvas edge, so reaching a node two rows down meant crossing the whole diagram twice. Offer a vertical lane beside each card first, nearest to the midpoint between the endpoints, and fall through to the gutters when none is clear.
Changes
tryCorridorRoute: unlike a gutter route, each endpoint attaches on the side facing the corridor, which is what makes a lane between the endpoints usable at all.distributeGutterLaneswidens lanes on that assumption. An interior corridor has neither property. Applying it to grouped canvases broke five existing P2c tests and introduced collinear overlaps, so rather than weaken the grouped guarantee it is offered only where no frames exist — which is where the long detours were observed.distributeGutterLanesonly relocates corridors outside the content, so an interior collision cannot be fixed afterwards (TPL-1954).Measured
Ungrouped, over the bundled examples: total edge length 45,780 → 42,883 (−6.3%), crossings 42 → 39, total width 12,707 → 12,627. Best single case
ec-platform/04-annotationsat −42% edge length and 5 → 2 crossings. Grouped output is byte-identical.hr-toolis unchanged — the case that motivated the slice. Its rows overlap in x across every row its detours traverse, so no interior lane is clear and the gutter route correctly stands. Interior corridors help where a lane exists and do nothing where it does not; they are not a general fix for diagram width.Preview URL
Scope filter (new-feature PRs only)
Dependency & license impact
Manual Verification Checklist
examples/en/client-mcpandexamples/en/ec-platform/04-annotations.krsand confirm detours read as shorter, not more tangledTPL impact
Related Docs
🤖 Generated with Claude Code