Repository navigation
fix(view): route flush header pins and outside members, name unrouted draw.io edges, round waypoints, carry edge fqn - #1683
Merged
Conversation
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>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…y fqn, anchor inward ports inward Co-Authored-By: jason.han <hanhuijun@gmail.com>
…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>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
6 tasks done
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.
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:
edgeStyle=orthogonalEdgeStyleedge 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 exactexit*/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) joinsTestDrawioRoutesUnroutedEdges.tree,abstract-mixed,interconnection-constraints):routingPinPositionsdrops 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 withnode tools/route-goldens.mjs: 1108 scenes, 2713 routes (theflush-header-pin-to-member-portscene 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.abstract-mixed'smassbesideVehicle) 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.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.Edge.Route, and anchor fractions to a ten-thousandth of a cell, instead of131.00000008000004; a statedRoutepasses 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.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 asfqnon its<object>—PumpStation::station::fluidfor the fixture's connection — matching the render'sedges[].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 preferfqnand 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).Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink 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