Repository navigation
Pass Eagle/Fusion board variant as metadata instead of in the title - #590
Merged
qu1ck merged 2 commits intoOct 7, 2026
Merged
Conversation
Since openscopeproject#574 the BOM header shows the variant from pcbdata.metadata.variant, and the %v/%V name format substitutions read the same key. The Eagle and Fusion parser never set it and instead appended ", Variant: X" to the title, so the variant header stayed hidden, the title got truncated and %V always produced "default". Put the current variant into metadata.variant like the KiCad parser does and keep the title as the file name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Does eagle/fusion always specify a variant even if user didn't customize anything? If there is a distinction between variant that is empty string and no variant I'd like to keep it reflected in the data, even if it shows up on the page the same at the moment. |
Eagle and Fusion never store a variant with an empty name: variantdef names are required and the default assembly variant is implicit. Leave metadata.variant out when no variant is current instead of setting it to an empty string, so "no variant" stays distinguishable in the data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
No, Eagle/Fusion don't always specify a variant, and a variant never has an empty name. Per the DTD, So the only distinction is a named variant vs no variant. I've updated the PR (772b2ae) to omit |
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.
Follow-up to #574.
Since #574 the BOM header shows the board variant from
pcbdata.metadata.variant(seepopulateMetadatainweb/ibom.js), and the%v/%Voutput name format substitutions incore/ibom.pyread the same key. The KiCad parser sets it, but the Eagle/Fusion parser never did. It appended the current variant to the title instead:So for Eagle/Fusion boards with a current
<variantdef>:%Vin--name-formatalways produceddefault, and%vwas empty.This change stores the current variant in
metadata['variant']and leaves the title as the file name. When no variant is current, thevariantkey is omitted rather than set to an empty string: Eagle/Fusion variant names are required and the default assembly variant is implicit, so there is never an empty-named variant (details in the comment below).Testing
Eagle test boards generated with
--name-format "%f_%V":<variantdef name="LITE" current="yes"/>:metadata.titlewithvariant.brd, Variant: LITEwithvariant.brdmetadata.variantLITEwithvariant_default.htmlwithvariant_LITE.html<variantdefs/>novariant_default.htmlvariantkey omittednocurrent_default.htmlvariantkey omittedChecked the generated pages in a browser: the header renders correctly and there are no console errors.
Note for reviewers
The page's local storage key prefix is derived from the title. For Eagle/Fusion boards with an active variant the title changes, so checkbox state saved in BOMs generated before this change won't be picked up by BOMs generated after it.
🤖 Generated with Claude Code