Repository navigation
Kit: no route around the cards is a result; DI draws the least-overlapping one and reports it - #107
Merged
Merged
Conversation
…pping one and reports it boxEdge threw one Error for impossible geometry and for a link no route can take around the cards, and the dependency injection renderer caught both by rerouting with no obstacles, so an edge could run through unrelated cards looking successful. The kit's routeBoxEdge now returns a BlockedBoxEdge for a blocked link, with the candidate that overlaps the cards least (fewest crossed, then the shortest stretch inside them) and which cards it crosses; boxes with non-finite coordinates throw a RangeError, and boxEdge throws NoRouteError for a blocked link. DI draws the least-overlapping route, marks it data-projections-route=crossing with the cards it crosses, and the new link-routes renderer check reports it. Code review, finding 13. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot stopped reviewing on behalf of
agorischek due to an error
November 20, 2026 22:14
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
5 open issues
Importing from anode_modules/.cache/...path is brittle and likely to fail in clean installs/CI… · New Using only 4 spline samples to decidecrossed/insidecan miss intersections (a curve can pass… · New Using only 4 spline samples to decidecrossed/insidecan miss intersections (a curve can pass… · New Ifdriver.measure('routes')returnsundefined(e.g., when running against a driver/probe bundle… · New These loop variables shadow thetarget: ArrowBoxparameter name, which makes the control flow… · New
What changed in this PR
Adds a new renderer QA check for link routing (“link-routes”), including DOM measurement plumbing and renderer-kit support for reporting “blocked” routes when no path can avoid cards.
Changes:
- Introduces a new
routesprobe call +linkRoutesDOM measurement and a newlink-routesframe check. - Extends renderer-kit edge routing with
routeBoxEdge,NoRouteError, andBlockedBoxEdgeto expose “no clear route” details. - Updates the dependency-injection renderer to annotate routed links in the DOM (
data-projections-route*) and adds tests/docs.
| File | Description |
|---|---|
| packages/renderers/testing/test/helpers.test.mjs | Updates check count and adds coverage for the new link-routes check behavior. |
| packages/renderers/testing/src/types.ts | Adds routes probe call, RouteMeasurement, and link-routes to CheckId. |
| packages/renderers/testing/src/probe.ts | Wires the routes probe call to the new linkRoutes() measurement. |
| packages/renderers/testing/src/measure/routes.ts | Implements DOM measurement for routed links and crossings. |
| packages/renderers/testing/src/measure.ts | Exports linkRoutes from the measurement barrel. |
| packages/renderers/testing/src/checks/frame/routes.ts | Implements the link-routes check logic (fail on crossings, skip if none). |
| packages/renderers/testing/src/checks/frame.ts | Registers link-routes as a built-in frame check. |
| packages/renderers/testing/src/checks/catalog.ts | Adds title/description strings for link-routes. |
| packages/renderers/testing/README.md | Documents the new link-routes check contract. |
| packages/renderers/kit/test/blocked-routes.test.mjs | Adds tests for “no clear route” behavior and error semantics. |
| packages/renderers/kit/src/index.ts | Exports new route primitives/types (routeBoxEdge, NoRouteError, etc.). |
| packages/renderers/kit/src/edge-arrows/box-edge.ts | Adds routeBoxEdge API + blocked-route selection and new error types. |
| packages/renderers/dependency-injection/test/blocked-routes.test.mjs | Adds renderer-level test verifying crossing annotation behavior. |
| packages/renderers/dependency-injection/src/card.tsx | Switches to routeBoxEdge, annotates crossings in DOM attributes, and exposes LinkRoute. |
| docs/reference/renderer-kit.md | Documents new types/APIs (BoxEdge, BlockedBoxEdge, NoRouteError, routeBoxEdge) and updates boxEdge signature. |
Review effort: Lite
… that can't measure them The least-overlapping candidates are sampled at a named spacing (overlapSpacing, 2 px along the curve) and the contact loops no longer shadow the target box. link-routes skips, with a reason, when the probe returns no routes measurement. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.



From a code review, finding 13: routing failure silently drops every obstacle. The user approved the fix with the least-overlapping-route fallback ("Yup, I agree with your proposal for that one, the least overlapping route").
Evidence
packages/renderers/dependency-injection/src/card.tsx:112-157: the DI renderer promises to route each link around every other card. When the kit router threw, a broadcatchimmediately reran it with an empty obstacle list. The result could look successful while sending an edge through unrelated cards. Unexpected programming errors took the same fallback path as a geometrically impossible route.Change
Kit (
edge-arrows/box-edge.ts):routeBoxEdge(...)takesboxEdge's arguments and returns aBoxEdge, or a typedBlockedBoxEdgewhen no route around the cards exists. A blocked result carriesleast, the candidate that overlaps the obstacles least: fewest cards crossed, then the shortest stretch inside them, chosen from the direct arrow and the arrows from each other side. It also carriescrossed, the indices of the cardsleastcrosses.RangeErrorup front, so it can't be mistaken for a blocked route.boxEdgekeeps its signature for existing callers and now throwsNoRouteError, which carries the blocked result, instead of a bareError.BoxEdge,BlockedBoxEdge,routeBoxEdgeandNoRouteErrorare exported, anddocs/reference/renderer-kit.mdis regenerated.DI (
card.tsx):routeLinksusesrouteBoxEdge. On a blocked link, the policy is to draw the least-overlapping route and record which cards it crosses (LinkRoute.crossing, as card IDs). It no longer catches anything.LinkViewmarks every routed linkdata-projections-route="around", or"crossing"withdata-projections-route-crosses.Renderer checks (
@githubnext/projections-renderer-testing): a newlink-routescheck ("Links routed around cards"), with aroutesprobe call that measures the marks. It runs in the diff and at the end of the animation, fails naming each link drawn across cards and the cards it crosses, and skips renderers that route no links. That makes the degradation visible in the Inspector's checks and the harness, not silent. The README documents it.Tests
test/blocked-routes.test.mjs: a target inside a closed ring of cards is blocked,leastcrosses only the ring's top,boxEdgethrowsNoRouteErrorwith it, and a way around is still a plain route. Non-finite boxes throw aRangeError.test/blocked-routes.test.mjs:routeLinksgives the obstructed linkcrossing: ['top'], and once the ring is open on one side it goes around and crosses nothing.helpers.test.mjs:link-routespasses with clear routes, fails naming a crossing link, and skips a renderer that routes none.Local: those tests,
tools check --fastandcheck:tsdoc. The existing kit and DI route suites need the built engine, and the renderer harness runslink-routeson every scenario, so both run in CI. If a built-in DI scenario does have a blocked link,link-routeswill report it there, which is the point.#81 has merged and #82 doesn't touch these files.