Skip to content

fix(via): initialize layer ports after board attachment so inner layers are exposed (#4530) - #4877

Open
ducanh3005 wants to merge 1 commit into
tscircuit:mainfrom
ducanh3005:fix/via-inner-layer-ports-4530
Open

ducanh3005 wants to merge 1 commit into
tscircuit:mainfrom
ducanh3005:fix/via-inner-layer-ports-4530

Conversation

@ducanh3005

Copy link
Copy Markdown

Summary

Initializes layer ports in doInitialInitializePortsFromChildren() after the via is attached to the board tree so multilayer boards expose inner-layer source_port and pcb_port entries (inner1, inner2, etc.).

Details

  • Previously, Via initialized its ports inside constructor, before his.parent was assigned, causing _getLayers() to fall back to layerCount = 2 and only register op and �ottom ports even on 4+ layer boards.
  • Moving port creation into doInitialInitializePortsFromChildren() resolves the subcircuit's actual layer count (_getSubcircuitLayerCount()) and exposes ports for every occupied layer in the via span.
  • Added regression test ests/repros/repro4530-via-inner-layer-ports.test.tsx and updated the
    epro-via-inner2-ports snapshot.

Fixes #4530
/claim #4530

@vercel

vercel Bot commented Oct 23, 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 23, 2026 4:26pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — dec7990c Deployed Oct 23, 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.

Through-hole via components omit inner-layer source and PCB ports

1 participant