Skip to content

Use female CAD footprints for pinheader components with gender="female"#2330

Merged
rushabhcodes merged 2 commits into
tscircuit:mainfrom
rushabhcodes:fix/pinheader-female-cad-footprint
May 23, 2026
Merged

Use female CAD footprints for pinheader components with gender="female"#2330
rushabhcodes merged 2 commits into
tscircuit:mainfrom
rushabhcodes:fix/pinheader-female-cad-footprint

Conversation

@rushabhcodes
Copy link
Copy Markdown
Contributor

Summary

This PR fixes a core rendering bug where pinheader components with gender="female" did not propagate that gender into the implied CAD
footprint selection.

PinHeader now appends _female to the generated footprinter_string, so female headers resolve to the correct CAD model instead of
reusing the default male footprint.

Why this matters

This is a subtle but important core modeling/rendering fix:

  • It corrects the CAD footprint chosen for female pin headers.
  • It improves data modeling accuracy in @tscircuit/core.
  • It prevents incorrect 3D/CAD output for a supported component variant.

Reproduction and test coverage

This PR includes a regression test that reproduces the issue and verifies the fix:

  • Adds tests/components/normal-components/pin-header-female-cad-model.test.tsx
  • Renders a board with
  • Asserts that the generated cad_component.footprinter_string contains _female

Copilot AI review requested due to automatic review settings May 23, 2026 17:24
@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment May 23, 2026 5:29pm

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes implied CAD footprint selection for <pinheader gender="female" /> so that the generated footprinter_string differentiates female headers from the default (male) variant, preventing incorrect CAD model reuse.

Changes:

  • Update PinHeader._getImpliedFootprintString() to append "_female" when gender === "female".
  • Add a regression test asserting cad_component.footprinter_string contains "_female" for a female pinheader.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/components/normal-components/PinHeader.ts Appends "_female" to the implied footprinter string when the pinheader gender is female.
tests/components/normal-components/pin-header-female-cad-model.test.tsx Regression test ensuring female gender impacts the generated CAD footprinter string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rushabhcodes rushabhcodes merged commit 9124fb7 into tscircuit:main May 23, 2026
12 of 13 checks passed
@rushabhcodes rushabhcodes deleted the fix/pinheader-female-cad-footprint branch May 23, 2026 17:35
@tscircuitbot
Copy link
Copy Markdown
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

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.

4 participants