Skip to content

fix(view): part draw.io neighbours by the router's own corridor - #1688

Merged
HuiJun merged 1 commit into
developfrom
fix/view-layout-sibling-gap
Oct 29, 2026
Merged

HuiJun merged 1 commit into
developfrom
fix/view-layout-sibling-gap

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

What and why

The last genuine no-route case left after #1683: in interconnection-constraints, noise and mix sit 40 px apart with port squares on the facing sides, and the router needs twice its clearance (2 × 16) plus the two half port squares (10) between two boxes before a path fits — 42 is still too tight (the corridor is zero wide), 43 routes. The 40 px was the draw.io writer's own drawioGridGap, used for the grid that lays unplaced nodes out and (as drawioNestedGap) for the members inside a container and their distance from its header. No other form shares it: DOT, D2, PlantUML and Mermaid let their renderers lay out, and the panel's ELK spacing keeps connected nodes in different layers 2 × GAP = 64 apart, so neither moves.

The gap is now derived from the router's constants rather than being a second number: drawioGridGap = 2*route.Clearance + route.PortSize + route.Nudging (50 px) — clearance on both sides, the two half port squares, and one nudging lane for the path — and drawioNestedGap = drawioGridGap. With it the amplifier's noise -> mix.b binding routes and its notice disappears.

Before (develop, draw.io 32.6.1 export; draw.io routes the edge itself, slanted):

before

After (the router's route, with anchors and waypoints):

after

Golden movement, per form: draw.io 34 (every fixture with an unplaced grid or nested members; positions move by multiples of 10 px, routes follow), DOT 0, D2 0, PlantUML 0, Mermaid 0, text 0. No not routed notice remains in any golden. Route parity is untouched: 1108 scenes / 2713 routes.

Dry-merge from current develop (#1683 and #1685 in): feat/drawio-import (#1679, head fc13fdee1) merges with no conflicts.

Changelog: changes/unreleased/drawio-grid-gap.fixed.md.

How it was verified

  • go vet ./internal/ir/view/..., gofmt, go test ./internal/ir/view/... ./tests/hygiene/ (34 draw.io goldens re-recorded, parity 1108/2713), make lint, python3 scripts/changelog.py check.
  • A scratch replay of the amplifier scene through route.Routes at gaps 40–60: 40–42 leave the edge unrouted, 43 and above route all five.
  • Before/after export of interconnection-constraints.drawio.golden with draw.io desktop 32.6.1 under Xvfb (above).

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

The grid for unplaced nodes and the members inside a container were 40 px
apart, less than the router needs between two boxes with port squares on
their facing sides (twice its clearance plus the two half squares), so such an
edge was left for draw.io to route under a notice. The gap is now derived from
the router's constants: 2*Clearance + PortSize + Nudging, one nudging lane for
the path.

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 14:10

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit eb96507 into develop Oct 29, 2026
30 of 51 checks passed
@HuiJun
HuiJun deleted the fix/view-layout-sibling-gap branch October 29, 2026 15:03
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