From d163a6bbaf26ccdf6089c77f1b369f0bf61e0505 Mon Sep 17 00:00:00 2001 From: EminY <57416756+emincan2000@users.noreply.github.com> Date: Sun, 25 Oct 2026 18:01:06 +0300 Subject: [PATCH] Warn in the save menu when the bom table is filtered Saving or copying the bom table exports only the visible rows. Filter, ref lookup and the front/back side buttons all hide rows, but the side filter in particular is easy to miss, so an exported bom can silently be incomplete. Show a warning below the csv/txt buttons listing what is filtering the table. The side filter is only reported when the other side actually has components. Fixes #481 --- InteractiveHtmlBom/web/ibom.css | 9 +++++++++ InteractiveHtmlBom/web/ibom.html | 1 + InteractiveHtmlBom/web/ibom.js | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/InteractiveHtmlBom/web/ibom.css b/InteractiveHtmlBom/web/ibom.css index cbd0e38..1bc0d3a 100644 --- a/InteractiveHtmlBom/web/ibom.css +++ b/InteractiveHtmlBom/web/ibom.css @@ -603,6 +603,15 @@ mark.highlight { border-top: 1px solid #ccc; } +.menu-warning { + margin: 5px 5px 0 5px; + color: #c00; +} + +.dark .menu-warning { + color: #f66; +} + .menu-textbox { float: left; height: 24px; diff --git a/InteractiveHtmlBom/web/ibom.html b/InteractiveHtmlBom/web/ibom.html index a6e5a6d..3a71bdc 100644 --- a/InteractiveHtmlBom/web/ibom.html +++ b/InteractiveHtmlBom/web/ibom.html @@ -280,6 +280,7 @@ +
diff --git a/InteractiveHtmlBom/web/ibom.js b/InteractiveHtmlBom/web/ibom.js index d88a6f8..3c69b02 100644 --- a/InteractiveHtmlBom/web/ibom.js +++ b/InteractiveHtmlBom/web/ibom.js @@ -821,9 +821,29 @@ function highlightNextRow() { smoothScrollToRow(currentHighlightedRowId); } +function updateBomFilterWarning() { + var reasons = []; + var front = settings.canvaslayout == "F"; + // Only warn about the side when the other side has components + if (settings.bommode != "netlist" && settings.canvaslayout != "FB" && + pcbdata.bom[front ? "B" : "F"].length > 0) { + reasons.push(front ? "front side only" : "back side only"); + } + if (filter) { + reasons.push("filter"); + } + if (reflookup && settings.bommode != "netlist") { + reasons.push("ref lookup"); + } + var warning = document.getElementById("bom-filter-warning"); + warning.textContent = "Table is filtered (" + reasons.join(", ") + "), saved file will not contain all rows"; + warning.style.display = reasons.length ? "" : "none"; +} + function populateBomTable() { populateBomHeader(); populateBomBody(); + updateBomFilterWarning(); setBomHandlers(); resizableGrid(bomhead); }