Summary
shouldBeOnEdgeOfBoard is declared on pcbLayoutProps (so every
component that extends those layout props — chips, resistors, caps,
diodes, plated holes, etc.) and shows up in TypeScript completion,
but the runtime never reads it. Setting it on a component is a
no-op today.
$ rg 'shouldBeOnEdgeOfBoard' /path/to/tscircuit/core/lib/
# (no results — the prop is parsed by zod but never consumed)
This is the same shape of bug as #2242 (pcbPositionMode typechecks
but unused, fixed in #2247) and #2270 (<platedhole connectsTo>
typechecks but disconnected) — a documented prop the runtime ignores.
Repro
<board width="40mm" height="14mm">
{/* User declares "this part must end up on the board edge". */}
<chip
name="J_USB"
shouldBeOnEdgeOfBoard
footprint={...usb-c receptacle...}
connections={...}
/>
<resistor name="R1" resistance="10k" footprint="0402" />
<resistor name="R2" resistance="10k" footprint="0402" />
</board>
Expected: the auto-placer constrains J_USB to a position where its
courtyard touches a board edge.
Actual: prop has no observable effect; J_USB packs interior with
the resistors based on the default packPlacementStrategy.
Why it matters
This is the missing knob for the most common manual-placement task on
real boards: connectors and through-holes that must reach the
board edge so cables can plug in or wires can be soldered. Today the
workaround is to hand-place every edge-mounted part with explicit
pcbX/pcbY (we ended up doing this for ~9 components on a 45×14 mm
board); a working shouldBeOnEdgeOfBoard would let users delegate
the X/Y picking to the packer for the parts that don't care about
specific position, only "must be on an edge".
Suggested fix shape
Two-repo change. Sketch:
-
tscircuit/calculate-packing — add mustBeOnBoundary?: boolean
(or similar) to InputComponent. The PackSolver2 candidate-scorer
already considers the board outline; for components flagged this
way, candidate positions whose courtyard doesn't touch the
boundaryOutline are excluded.
-
tscircuit/core — in
Group_doInitialPcbLayoutPack.ts, when building the PackInput
for the solver, propagate _parsedProps.shouldBeOnEdgeOfBoard
from each child onto the corresponding InputComponent entry.
A "nearest of any edge" semantics is the simplest first cut. Future
extension: shouldBeOnEdgeOfBoard: "left" | "right" | "top" | "bottom" | true for finer control.
Workaround until fixed
Set explicit pcbX/pcbY on every edge-anchored part. For boards with
many connectors / through-holes this is the bulk of the manual
placement work.
Summary
shouldBeOnEdgeOfBoardis declared onpcbLayoutProps(so everycomponent that extends those layout props — chips, resistors, caps,
diodes, plated holes, etc.) and shows up in TypeScript completion,
but the runtime never reads it. Setting it on a component is a
no-op today.
This is the same shape of bug as #2242 (
pcbPositionModetypechecksbut unused, fixed in #2247) and #2270 (
<platedhole connectsTo>typechecks but disconnected) — a documented prop the runtime ignores.
Repro
Expected: the auto-placer constrains
J_USBto a position where itscourtyard touches a board edge.
Actual: prop has no observable effect;
J_USBpacks interior withthe resistors based on the default
packPlacementStrategy.Why it matters
This is the missing knob for the most common manual-placement task on
real boards: connectors and through-holes that must reach the
board edge so cables can plug in or wires can be soldered. Today the
workaround is to hand-place every edge-mounted part with explicit
pcbX/pcbY(we ended up doing this for ~9 components on a 45×14 mmboard); a working
shouldBeOnEdgeOfBoardwould let users delegatethe X/Y picking to the packer for the parts that don't care about
specific position, only "must be on an edge".
Suggested fix shape
Two-repo change. Sketch:
tscircuit/calculate-packing— addmustBeOnBoundary?: boolean(or similar) to
InputComponent. The PackSolver2 candidate-scoreralready considers the board outline; for components flagged this
way, candidate positions whose courtyard doesn't touch the
boundaryOutlineare excluded.tscircuit/core— inGroup_doInitialPcbLayoutPack.ts, when building thePackInputfor the solver, propagate
_parsedProps.shouldBeOnEdgeOfBoardfrom each child onto the corresponding
InputComponententry.A "nearest of any edge" semantics is the simplest first cut. Future
extension:
shouldBeOnEdgeOfBoard: "left" | "right" | "top" | "bottom" | truefor finer control.Workaround until fixed
Set explicit
pcbX/pcbYon every edge-anchored part. For boards withmany connectors / through-holes this is the bulk of the manual
placement work.