Skip to content

Ensure cad_component.footprinter_string is set when footprint is a string (fix 0402 resistor)#2075

Open
seveibar wants to merge 2 commits intomainfrom
codex/investigate-0402-resistor-bug
Open

Ensure cad_component.footprinter_string is set when footprint is a string (fix 0402 resistor)#2075
seveibar wants to merge 2 commits intomainfrom
codex/investigate-0402-resistor-bug

Conversation

@seveibar
Copy link
Contributor

Motivation

  • Resistors with footprint="0402" were not having their cad_component.footprinter_string populated when a cadModel was provided, which broke footprint tracking and external footprint logic.

Description

  • Always propagate a string footprint into the created cad_component by changing the assignment to footprinter_string: typeof footprint === "string" ? footprint : undefined in NormalComponent.doInitialCadModelRender, and add a regression test tests/components/normal-components/resistor-cad-component-footprinter-string.test.tsx that validates a resistor with footprint="0402" and a cadModel produces a cad_component with footprinter_string: "0402".

Testing

  • Ran bun test tests/components/normal-components/resistor-cad-component-footprinter-string.test.tsx and bun test tests/footprint/footprint-library-map-cadmodel.test.tsx (both passed), ran bunx tsc --noEmit (passed), and ran bun run format.

Codex Task

@vercel
Copy link

vercel bot commented Mar 26, 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 Mar 26, 2026 1:28am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant