Repository navigation
Display board variant in the BOM header - #574
Merged
qu1ck merged 3 commits intoOct 2, 2026
Merged
Conversation
Member
|
I don't like how inefficiently the space is used in your last screenshot. Especially since with new kicad there will always be variant: default, which has 0 useful information if you don't have any other variant, which is majority of cases. I think if we want to cram more info into the header block it should have some sort of dynamic layout: use more rows, maybe shrink the fonts when window is so narrow, utilize unused space for missing fields like company. |
Contributor
Author
Member
|
This is much better, thanks! |
qu1ck
pushed a commit
that referenced
this pull request
Oct 7, 2026
Since #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>
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.





KiCad native variants are already exported as
pcbdata.metadata.variant, but the generated iBOM page does not display that value. This change addsVariant: <name>beside the board title and revision, making it possible to identify which variant a generated BOM represents without relying on its filename.For example, an export for
SPI_no_INT_pull_updisplaysVariant: SPI_no_INT_pull_up. The label describes the variant recorded at generation time; it does not switch variants or track subsequent changes in KiCad.The implementation changes three frontend files:
InteractiveHtmlBom/web/ibom.html: adds Variant as an initially hidden third<td class="title">in the existing metadata table, alongside the board title and revision, and moves the title/revision column widths into CSS.InteractiveHtmlBom/web/ibom.css: reuses the existing table-cell typography and ellipsis styling for Variant. When Variant is visible, a fixed table layout distributes the title, revision, and variant across three equal-width columns. During window-width changes, the variant label behaves the same way as the board name and revision: it stays on the same metadata row and truncates with an ellipsis (...) when space is limited, rather than wrapping to a second row. As the window widens, more of the text becomes visible again. When the variant is hidden, the original title/revision layout is retained.InteractiveHtmlBom/web/ibom.js: populates the label from the optional metadata field, sets its full text as a hover tooltip, and toggles its visibility and layout. It usestextContentso special characters in variant names are displayed literally. Repeated metadata population also clears stale text and layout state when the field becomes unavailable.Display behavior depends on the exported data, without requiring ECAD-specific logic in the browser:
metadata.variantVariant: <exact name>Variant: Defaultnullor another non-string valueFor older KiCad versions without native variants, the current KiCad parser normally exports an empty string from the default configuration, so the label reads
Variant: Default. Older data that omits the field renders without the label. The change introduces no new KiCad API calls or version requirements; the existing capability checks in the parser remain unchanged.Defaultis the display fallback for an empty value, not an indication that the installed KiCad version supports native variants.Other supported ECAD inputs retain their existing behavior:
metadata.variantfield. That title remains unchanged, and the new label stays hidden, avoiding duplicate variant information.metadata.variant. Inputs that provide it receive the label; inputs that omit it keep the original header. No schema changes or additional required fields are introduced.This is a display-only change. Parsers, component selection, DNP filtering, legacy field-based variant filters, and BOM generation are unchanged. Existing standalone HTML exports must be regenerated to include the new header.
Validation covered named, default, missing, invalid, long, Unicode, and HTML-like variant values in headless Edge; matching revision typography; full-text tooltips; both themes; all three BOM layouts; header collapse/expand; print visibility; and repeated metadata population. At widths from 375 to 2564 pixels, the variant stays on the metadata row and truncates without adding horizontal overflow or overlapping the toolbar. Missing-field header geometry matches the original committed frontend.
Fresh examples were generated from
STK8321_devboard.kicad_pcbusing installed KiCad 10, with--kicad-variant SPI_no_INT_pull_upand--dnp-field kicad_dnp. Browser checks verified that the named variant contains only C1, C2, J1, R1, and U1, with R2-R8 skipped and absent from the displayed BOM. Tracks were excluded from these examples to keep verification independent of the separate via-rendering work.JavaScript syntax and whitespace checks passed. Older KiCad and other ECAD applications were not executed directly: their compatibility was assessed through parser/schema inspection and frontend checks with the corresponding optional or missing metadata shapes.
Examples:
What was before:
Named variant:
Missing variant:
Default variant:
Variant name behavior with Unicode, quotes, and HTML-like text display:
Variant long name:
Header behavior with narrow layout: