Skip to content

fix(view): route flush header pins and outside members, name unrouted draw.io edges, round waypoints, carry edge fqn - #1683

Merged
HuiJun merged 5 commits into
developfrom
fix/drawio-unrouted-edges
Oct 29, 2026
Merged

HuiJun merged 5 commits into
developfrom
fix/drawio-unrouted-edges

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Three draw.io writer follow-ups found by a sweep of develop after the edge router landed, and the two routing defects the first one exposed:

  • No silent fallback. An edge the router found no path for was written as a plain edgeStyle=orthogonalEdgeStyle edge with nothing to say so. It now adds a leading notice naming the edge and its cells (edge Parametrics::Amplifier::noiseIn (n3 -> n6) not routed: the router found no path at this layout; draw.io routes it when the file opens), and an end at a port still carries exact exit*/entry* anchors at the middle of the port's face — the outer face, or the inner one for the end an edge leads into the port's owner through. A fixture for the reported scene (interconnection-header-ports.sysml: two parts under their container's header, ports on their top borders, the connection between them) joins TestDrawioRoutesUnroutedEdges.
  • Two no-route causes, fixed. Making the fallback visible showed three goldens with unrouted edges (tree, abstract-mixed, interconnection-constraints):
    • A flush pin at exactly a quarter, half or three quarters of a side — a container's header pin above a centred member — coincided with one of libavoid's twelve generic pins, and libavoid attached the connector to neither, routing centre to centre instead. The diagram panel's router has the same defect, so routingPinPositions drops the generic pin under a named one on both sides (internal/ir/view/route/route.go, editors/vscode/src/webview/avoid.ts, a unit test each), and the parity goldens are regenerated with node tools/route-goldens.mjs: 1108 scenes, 2713 routes (the flush-header-pin-to-member-port scene that recorded no route now records both), Go == TS point for point. Twelve header→member edges across seven goldens now enter the member at its top border instead of its centre.
    • A member drawn outside its container (abstract-mixed's mass beside Vehicle) was routed inside the container's bounds, which have no path to it; the edge is now routed in the nearest container that geometrically holds both ends.
    • The third (interconnection-constraints, n3 -> n6.1) is genuine: two parts 40 px apart with ports on their facing sides leave no corridor for twice the 16 px clearance plus the 10 px port squares. It keeps the notice and anchors; the layout's sibling gap versus the router's clearance is a separate decision.
  • Coordinate precision. Waypoints the router produced are rounded to a thousandth of a pixel where they are copied into Edge.Route, and anchor fractions to a ten-thousandth of a cell, instead of 131.00000008000004; a stated Route passes through untouched. The parity test compares the router's raw output and is unchanged; the writer-side test reconstructs each edge with a half-pixel tolerance.
  • Edge fqn. An edge that is a declaration of its own (connection, binding, association, flow, succession, transition, require/assume/assert/frame/event, import, dependency, derive, refine, expose, satisfy, verify, allocate, include, perform, exhibit) carries its qualified name as fqn on its <object> — PumpStation::station::fluid for the fixture's connection — matching the render's edges[].fqn. An edge drawn from a member's declaration (composition, reference, typing, specialization, …) carries none, and so does one whose name a drawn cell already has.

Changelog: changes/unreleased/drawio-unrouted-edges.fixed.md. The import side (#1679) is told of the new attribute on its PR so its matcher can prefer fqn and fall back to endpoints.

How it was verified

  • go vet ./internal/ir/view/..., gofmt, go test ./internal/ir/view/... (route parity 1108 scenes / 2713 routes against the regenerated goldens; 35 draw.io goldens re-recorded; the new fixture routed with anchors), make lint, tests/hygiene, python3 scripts/changelog.py check.
  • editors/vscode: npm run typecheck, npm test (420 pass).
  • The nine goldens whose routes moved export to SVG in draw.io desktop 32.6.1 under Xvfb.

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/3f1b939418f644f9a6748f63888daf78
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/3f1b939418f644f9a6748f63888daf78?variant=devin
Requested by: @HuiJun

An edge the router finds no path for was written silently as a plain
orthogonal edge; it now carries a notice naming it and, at a port, the
port's face as its anchor. Routed waypoints and anchor fractions are
rounded (a thousandth of a pixel, a ten-thousandth of a cell). An edge
that is a declaration of its own carries its qualified name as fqn.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 29, 2026 07:00
devin-ai-integration[bot]

This comment was marked as resolved.

…y fqn, anchor inward ports inward

Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits October 29, 2026 07:19
…wn outside their container

A flush pin at a quarter, half or three quarters of a side coincided with one of
libavoid's generic pins and attached to neither, so a container's header pin above
a centred member never routed, in the diagram panel as in the draw.io export; the
generic pin under a named one is dropped on both sides and the parity goldens
re-recorded. A member drawn outside its container is now routed in the nearest
container holding both ends. Fallback anchors follow the edge end's direction,
notices name the edge's cells.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration devin-ai-integration Bot changed the title fix(view): name unrouted draw.io edges, round waypoints, carry edge fqn fix(view): route flush header pins and outside members, name unrouted draw.io edges, round waypoints, carry edge fqn Oct 29, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun merged commit 2ee8aca into develop Oct 29, 2026
30 checks passed
@HuiJun
HuiJun deleted the fix/drawio-unrouted-edges branch October 29, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant