fix: bind converted KiCad reference text to the instance name - #4710
billythompsons wants to merge 3 commits into
Conversation
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
Still active and ready for review. All six checks are green; the e2e test builds two instances of the converted footprint and verifies the silkscreen refs resolve to U1/U2 instead of the REF** placeholder. |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
Status update: the focused regression fix for the requested CLI behavior remains green in CI and ready for review. I can rebase or make any requested changes promptly. |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
Status update: the focused CLI regression fix remains green in CI and ready for review. I can rebase or make any requested changes promptly. |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
Rechecked against current main (fcbf759): the branch still merges cleanly and #4708 still reproduces on main - |
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
Fixes #4708.
Problem
tsci convertcopies the KiCadfp_text referenceplaceholder into a literaltext="REF**", so every placed instance of the converted footprint prints "REF**" instead of its reference designator.Fix
After
convertCircuitJsonToTscircuitruns, the KiCad reference placeholder (text="REF**"on asilkscreentext) is rebound to the component instance:text={props.name ?? "REF**"}. Ordinary user text stays literal, and the rewrite only applies when the generated component haspropsin scope.Kept this in the CLI's convert path since the placeholder is a KiCad artifact known at conversion time; happy to move it into
circuit-json-to-tscircuitif you'd rather handle it there.Tests
convert-kicad-mod-reference-text.test.ts: converts the issue's two-pad.kicad_modplus anfp_text usercontrol - asserts the reference placeholder is rebound and user text stays literal.convert-kicad-mod-reference-e2e.test.ts: builds a board with two instances (U1, U2) and asserts the emittedpcb_silkscreen_textvalues are exactly["U1", "U2"](the issue's failing scenario).Full
tests/cli/convertsuite passes.