Skip to content

feat: generate courtyardrect from pcb_courtyard_rect#20

Open
makaiachildress-web wants to merge 5 commits intotscircuit:mainfrom
makaiachildress-web:fix/kicad-courtyards
Open

feat: generate courtyardrect from pcb_courtyard_rect#20
makaiachildress-web wants to merge 5 commits intotscircuit:mainfrom
makaiachildress-web:fix/kicad-courtyards

Conversation

@makaiachildress-web
Copy link
Copy Markdown

@makaiachildress-web makaiachildress-web commented Feb 17, 2026

Summary

Adds support for converting pcb_courtyard_rect circuit JSON elements into TSX elements during footprint code generation. This completes the circuit-json-to-tscircuit part of the courtyard pipeline for KiCad-imported components.

/claim #1081

Changes

Feature: courtyard rect generation (lib/generate-footprint-tsx.tsx)

  • Filters pcb_courtyard_rect elements from the input circuit JSON
  • Generates TSX with pcbX, pcbY, width, height (via mmStr) and optional layer attribute
  • Follows the same pattern as existing element generators (cutout, silkscreen, etc.)

Tests: test7-courtyard-rect.test.tsx (new)

  • Test 1: courtyard rect with layer attribute - verifies correct coordinate and layer mapping
  • Test 2: courtyard rect without layer - verifies layer attribute is omitted when not present
  • Both use inline snapshot assertions

Fix: CI test timeout (test5, test6)

  • Tests using runTscircuitCode were timing out at the default 5s in GitHub Actions
  • Added 30s per-test timeout for affected tests

Test plan

  • All 12 tests pass locally and in CI
  • Format check passes
  • Type check passes

Makaia Taye Childress and others added 5 commits February 17, 2026 10:27
Generate <courtyardrect /> TSX elements from pcb_courtyard_rect
circuit-json elements, supporting the courtyard feature for KiCad
component footprints.

Related: tscircuit/tscircuit#1081

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds test7-courtyard-rect.test.tsx with two test cases:
- Courtyard rect with layer attribute
- Courtyard rect without layer (omits layer prop)

Both verify correct pcbX, pcbY, width, height, and layer mapping
from pcb_courtyard_rect circuit JSON to <courtyardrect /> TSX.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests using runTscircuitCode were timing out at the default 5s in
GitHub Actions. Set per-test timeout to 30s for tests that invoke
the tscircuit code evaluator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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