From ff5222df2c170255e6b90695c68cf1bbab7a0608 Mon Sep 17 00:00:00 2001 From: Drew Dibble Date: Sun, 2 Aug 2026 11:14:15 -0600 Subject: [PATCH] Follow insertion_direction rename to top/bottom Circuit JSON renamed the +/-Y insertion directions from "from_front"/"from_back" to "from_top"/"from_bottom" and added "from_below" (-Z). Update the mapping to match, treating "from_below" like "from_above": neither constrains an in-plane facing direction, so both yield null. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lib/check-connector-accessible-orientation.ts | 5 +++-- package.json | 2 +- tests/lib/check-connector-accessible-orientation.test.tsx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/check-connector-accessible-orientation.ts b/lib/check-connector-accessible-orientation.ts index 0bbcb18..0637a7e 100644 --- a/lib/check-connector-accessible-orientation.ts +++ b/lib/check-connector-accessible-orientation.ts @@ -17,11 +17,12 @@ function getFacingDirectionFromInsertionDirection( return "x-" case "from_right": return "x+" - case "from_front": + case "from_top": return "y+" - case "from_back": + case "from_bottom": return "y-" case "from_above": + case "from_below": return null default: return null diff --git a/package.json b/package.json index a022eb1..d826ff8 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@types/bun": "^1.2.8", "@types/debug": "^4.1.12", "bun-match-svg": "^0.0.11", - "circuit-json": "^0.0.457", + "circuit-json": "^0.0.461", "circuit-json-to-connectivity-map": "^0.0.27", "circuit-to-svg": "^0.0.388", "debug": "^4.3.5", diff --git a/tests/lib/check-connector-accessible-orientation.test.tsx b/tests/lib/check-connector-accessible-orientation.test.tsx index f688acc..1584225 100644 --- a/tests/lib/check-connector-accessible-orientation.test.tsx +++ b/tests/lib/check-connector-accessible-orientation.test.tsx @@ -194,7 +194,7 @@ test("connector orientation check uses insertion_direction when present", () => height: 4, layer: "top", rotation: 0, - insertion_direction: "from_back", + insertion_direction: "from_bottom", obstructs_within_bounds: true, }, ]