diff --git a/templates/index.html b/templates/index.html index 3adc216..3363890 100644 --- a/templates/index.html +++ b/templates/index.html @@ -356,6 +356,7 @@

5. Detail & Output

cb.id = 'part_' + shown; cb.addEventListener('change', () => { if (cb.checked) excludedParts.delete(name); else excludedParts.add(name); + updatePartCount(); }); const label = document.createElement('label'); label.setAttribute('for', cb.id); @@ -364,6 +365,14 @@

5. Detail & Output

row.appendChild(label); box.appendChild(row); }); + updatePartCount(shown); +} + +function updatePartCount(shown) { + if (shown === undefined) { + const filterText = document.getElementById('part_filter').value.toLowerCase(); + shown = allPartNames.filter(n => !filterText || n.toLowerCase().includes(filterText)).length; + } document.getElementById('part_count').textContent = shown + ' of ' + allPartNames.length + ' shown, ' + (allPartNames.length - excludedParts.size) + ' included';