fix: missing board labels (A0, SCL, DIGITAL-PWM~) after subcircuit inflation from imported KiCad PCB#2452
Open
rushabhcodes wants to merge 3 commits into
Conversation
…flation from imported KiCad PCB Two bugs in inflateStandalonePcbPrimitives prevented standalone pcb_silkscreen_text and pcb_copper_text elements from being inflated when their pcb_component_id was an empty string (as emitted by the KiCad converter) rather than null/undefined. Also adds pcb_copper_text to the standalonePrimitiveTypes list, which was missing entirely. Reproduces and fixes with repro131 test against the Arduino Uno KiCad source. Co-Authored-By: Rushabh Patil <rushabhpatil.dev@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Snapshots now correctly render A0/A1/SCL/SDA/DIGITAL-PWM~ labels after the pcb_silkscreen_text/pcb_copper_text standalone inflation fix. Co-Authored-By: Rushabh Patil <rushabhpatil.dev@gmail.com>
MustafaMulla29
approved these changes
Jun 16, 2026
MustafaMulla29
left a comment
Contributor
There was a problem hiding this comment.
Take approval from rishabh as well before merging
imrishabh18
reviewed
Jun 16, 2026
Member
There was a problem hiding this comment.
Can you add an actual kicad snapshot of this kicad_pcb file? The text is just cluttering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When importing a KiCad PCB (e.g. Arduino Uno) as a
<subcircuit circuitJson={...} />, board labels likeA0,A1,SCL,SDA, andDIGITAL - PWM~were silently dropped from the output. The silkscreen and copper text elements simply never appeared in the inflated circuit.Root Cause (two bugs in
inflateStandalonePcbPrimitives.ts)Bug 1 — Empty-string
pcb_component_idwas not recognized as standalone:The filter that identifies standalone primitives (board-level elements not attached to any component) only accepted
nullorundefinedas "no component":The KiCad converter emits
pcb_component_id: ""for board-level labels, so every one of those elements was filtered out. Fixed by treating any falsy value as "no component":Bug 2 —
pcb_copper_textwas absent fromstandalonePrimitiveTypes:pcb_copper_textwas never included in the list of types eligible for standalone inflation, so copper-layer board labels (e.g. "UNO TH RevC") were unconditionally skipped regardless of theirpcb_component_id.Fix
"pcb_copper_text"tostandalonePrimitiveTypesReproduction & Tests
repro131-arduino-uno-labels-missinginflates the full Arduino Uno circuit JSON and asserts thatA0,A1,SCL,SDA,DIGITAL - PWM~, and the copper-text label are all present in the inflated outputrepro116andsubcircuit-circuit-json08which now correctly render the previously-missing labels