Skip to content

Add excludeRefs to PCB keepout props - #772

Merged
seveibar merged 1 commit into
mainfrom
agent/add-keepout-exclude-refs
Aug 1, 2026
Merged

Add excludeRefs to PCB keepout props#772
seveibar merged 1 commit into
mainfrom
agent/add-keepout-exclude-refs

Conversation

@seveibar

@seveibar seveibar commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an optional excludeRefs: string[] prop to circular and rectangular PCB keepouts
  • accept component selectors such as ".ANT1" and preserve them unchanged in parsed props
  • add tests covering both keepout shapes
  • regenerate the repository's required documentation artifacts

Why

Keepouts need a way to identify selected components that may occupy the keepout region, such as allowing an antenna component inside its own RF keepout.

This PR adds the props-layer contract only. @tscircuit/core will need a follow-up change to resolve the selectors and apply the exclusions while rendering routing obstacles.

API behavior

  • accepted input: an optional array of selector strings
  • canonical parsed output: the same string array
  • default: omitted / undefined
  • aliases or conflicts: none
  • migration: fully additive and backward compatible

Generated documentation note

Running the generators required by AGENTS.md also synchronized pre-existing generated documentation drift for BusProps.routingPhaseIndex.

Validation

  • bun test — 400 passing
  • bun run typecheck
  • bun run format:check
  • bun run build
  • bun run check-circular-deps
  • git diff --check

@seveibar
seveibar marked this pull request as ready for review August 1, 2026 00:10
@seveibar
seveibar merged commit 70bd038 into main Aug 1, 2026
5 checks passed
Comment thread tests/pcb-keepout.test.ts
Comment on lines +34 to +49
test("should parse keepout excludeRefs selectors", () => {
const rectProps: PcbKeepoutProps = {
shape: "rect",
width: "5mm",
height: "2mm",
excludeRefs: [".ANT1", ".C1"],
}
const circleProps: PcbKeepoutProps = {
shape: "circle",
radius: "1mm",
excludeRefs: [".ANT1"],
}

expect(pcbKeepoutProps.parse(rectProps).excludeRefs).toEqual([".ANT1", ".C1"])
expect(pcbKeepoutProps.parse(circleProps).excludeRefs).toEqual([".ANT1"])
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A *.test.ts file may have AT MOST one test(...) call. This file already contains a prior test(...) block (ending at line 32), and the newly added test("should parse keepout excludeRefs selectors", ...) (lines 34–49) is a second test in the same file. Per the style guide, once a file has one test, any additional tests must be split into separate, numbered files — e.g., pcb-keepout1.test.ts and pcb-keepout2.test.ts. Please move the new test to its own file.

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating:
Impact: Tiny

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

2 participants