Skip to content

FE-1703: Route square automatic arcs around nodes - #9687

Draft
kube wants to merge 2 commits into
mainfrom
codex/fe-1409-square-obstacle-arcs
Draft

kube wants to merge 2 commits into
mainfrom
codex/fe-1409-square-obstacle-arcs

Conversation

@kube

@kube kube commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

Experimental
Behind the Automatic arc connections feature flag.

Summary

Adds square automatic arcs with horizontal and vertical segments. The router chooses attachment sides and detours around nearby nodes, including while creating an arc.

Curved remains the default. User Settings > Viewport offers Square and an Avoid nodes toggle; moving a blocking node updates the route.

Also fixes UUID generation over HTTP on local networks, including when automatic arc connections are disabled.

Links

Changes

  • Choose among four attachment sides using a local orthogonal grid and A* search with a cost for bends
  • Keep clearance around place, transition, and subnet bounds, with separate attachment lanes for reciprocal arcs
  • Reuse routes across hover and focus updates; recompute when node geometry changes
  • Bound the search and fall back to a square path when a clear route cannot be found
  • Add Square and Square With Obstacles stories, user documentation, and a patch changeset

Known issues

  • Arcs and labels can overlap or cross each other
  • Overlapping nodes, blocked endpoints, or search limits can produce a fallback that crosses nodes
  • Routes can switch sides while dragging; stable routes and crossing reduction need further work

Test coverage

The UUID fix passes Petrinaut build, unit tests, types, lint, and formatting. A regression test covers rendering without crypto.randomUUID(). Verified Simulation Settings and scenario creation in Handle Spike With AI over LAN HTTP, with no UUID errors. The UUID fix requires no user-guide or screenshot changes.

After extraction onto main, all 96 focused tests passed, along with editor build, TypeScript, lint, and formatting. The Settings-test conflict retains the square-arc persistence tests. Both the routing and UUID patches preserve their added and removed lines. The earlier integrated stack passed full editor, core, website, and architecture checks; browser checks below predate extraction.

  • Router tests cover attachment directions, detours, blocked sides, reciprocal arcs, moving obstacles, drag endpoints, fallback paths, and distant nodes
  • Integration tests verify rerouting after obstacle movement, route reuse on hover, and unchanged subnet port arcs
  • Settings tests verify persistence and preservation of the previous arc style
  • Passed build, unit tests, TypeScript, and ESLint for Petrinaut and its website, plus repository formatting and the architecture check
  • Manually verified in Storybook: shape switching, avoidance toggle, blocker movement and undo, and creating a square arc by dragging
  • CI website integration and HASH Playwright integration stop before tests because Docker cannot pull minio/mc; each job's three attempts fail with access denied

How to test

  • Run PORT=6017 mise x -- yarn workspace @hashintel/petrinaut dev --ci
  • Open Square With Obstacles
  • Move Obstacle away from the Waiting → Begin service arc, then undo

    The detour becomes straight when clear and returns after undo.

  • Open User Settings > Viewport and switch Avoid nodes off and on

    The square path crosses the blocker when avoidance is off and detours when on.

  • Drag Waiting's outgoing handle onto Finish service

    A new square arc connects the nodes.

  • Switch Automatic arc shape to Curved

    The existing automatic curves return.

@kube
kube added this pull request to stack #9688 September 12, 2026 01:27
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Sep 15, 2026 10:17pm UTC
petrinaut Ready Ready Preview Sep 15, 2026 10:17pm UTC
petrinaut-docs Ready Ready Preview Sep 15, 2026 10:17pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 15, 2026 10:17pm UTC

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps > hash.design Affects the `hash.design` design site (app) labels Sep 12, 2026
@kube kube self-assigned this Sep 12, 2026
@kube kube changed the title Route square automatic arcs around nearby nodes FE-1409: Route square automatic arcs around nodes Sep 12, 2026
@kube kube changed the title FE-1409: Route square automatic arcs around nodes FE-1703: Route square automatic arcs around nodes Sep 13, 2026
@kube
kube removed this pull request from stack #9688 September 13, 2026 22:49
@kube
kube force-pushed the codex/fe-1409-automatic-arc-connections branch from 3510b40 to f23d6bb Compare September 13, 2026 22:52
@kube
kube force-pushed the codex/fe-1409-square-obstacle-arcs branch from bbfb1f4 to a679dd2 Compare September 13, 2026 22:52
@kube
kube added this pull request to stack #9699 September 13, 2026 22:54
@kube
kube removed this pull request from stack #9699 September 15, 2026 01:16
@kube
kube added this pull request to stack #9730 September 15, 2026 01:18
@kube
kube removed this pull request from stack #9730 September 15, 2026 02:00
@kube
kube added this pull request to stack #9731 September 15, 2026 02:02
@kube
kube removed this pull request from stack #9731 September 15, 2026 02:30
@kube
kube changed the base branch from codex/fe-1409-automatic-arc-connections to claude/bottombar-optimization-variations-7b5e3d September 15, 2026 02:30
@github-actions github-actions Bot removed the area/apps > hash.design Affects the `hash.design` design site (app) label Sep 15, 2026
@github-actions github-actions Bot added the area/apps > hash.design Affects the `hash.design` design site (app) label Sep 15, 2026
@kube
kube added this pull request to stack #9733 September 15, 2026 02:31
@kube
kube removed this pull request from stack #9733 September 15, 2026 14:48
@kube
kube added this pull request to stack #9740 September 15, 2026 14:48
@kube
kube force-pushed the codex/fe-1409-square-obstacle-arcs branch from d254821 to a2c3adc Compare September 15, 2026 20:00
@kube
kube force-pushed the claude/bottombar-optimization-variations-7b5e3d branch from 2fcab7d to 5f61b5c Compare September 15, 2026 20:00
@kube
kube force-pushed the codex/fe-1409-square-obstacle-arcs branch from a2c3adc to beeb366 Compare September 15, 2026 20:39
@kube
kube force-pushed the claude/bottombar-optimization-variations-7b5e3d branch from 5f61b5c to d105f41 Compare September 15, 2026 20:39
@kube
kube force-pushed the claude/bottombar-optimization-variations-7b5e3d branch from d105f41 to dfffea9 Compare September 15, 2026 21:19
@kube
kube force-pushed the codex/fe-1409-square-obstacle-arcs branch from beeb366 to bcdd7b5 Compare September 15, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

1 participant