Skip to content

repro: Circuit JSON import loses rectangular pad and silkscreen rotation - #4945

Open
anil08607 wants to merge 2 commits into
tscircuit:mainfrom
anil08607:repro/circuit-json-rectangle-rotation-loss
Open

anil08607 wants to merge 2 commits into
tscircuit:mainfrom
anil08607:repro/circuit-json-rectangle-rotation-loss

Conversation

@anil08607

@anil08607 anil08607 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Importing a Circuit JSON footprint loses two existing rotation fields. With an unrotated top-layer chip, pcb_plated_hole.rect_ccw_rotation for circular_hole_with_rect_pad and pcb_silkscreen_rect.ccw_rotation both change from 35° in the input to 0° in the emitted JSON.

This PR adds reproductions only; production code is unchanged.

  • Two .test.tsx files use explicit JSX for every chip, footprint, and label, without map, Fragment, or conditional rendering. They exercise the public <chip footprint={circuitJson}> import path with concrete Circuit JSON record types.
  • Each SVG shows native JSX beside imported JSON at 35°, 0°, 90°, 180°, and 270°, on top and bottom placements.
  • Desired rotation preservation is asserted in test.failing. Fixture validation, input immutability, and snapshot checks run in beforeAll, outside the expected failure. Once fixed, remove .failing and update the snapshots.

Validation:

  • Both repros plus the existing rotated plated-hole, parent-rotated silkscreen, and imported courtyard tests: 5 passed (the two repros are expected failures).
  • Temporarily removing .failing produces exactly two failures: Expected: 35, Received: 0. Restored .failing afterward.
  • Full tsc --noEmit and formatting checks passed; both snapshots were visually inspected.

Run the reproductions:

bun test tests/repros/repro-circuit-json-circular-hole-rect-pad-rotation.test.tsx tests/repros/repro-circuit-json-silkscreen-rect-rotation.test.tsx

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tscircuit-core-benchmarks Ready Ready Preview Oct 27, 2026 5:21am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 4d2307a0 Deployed Oct 27, 2026 by vercel[bot]
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