From 91ad4943df92576db895e9809d3b1d307ee01614 Mon Sep 17 00:00:00 2001 From: "mathmathou@gmail.com" Date: Fri, 10 Jul 2026 16:03:54 +1100 Subject: [PATCH 1/2] Fix part count not updating on individual checkbox toggle --- templates/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/templates/index.html b/templates/index.html index 3adc216..4a27623 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,12 @@

5. Detail & Output

row.appendChild(label); box.appendChild(row); }); + updatePartCount(); +} + +function updatePartCount() { + const filterText = document.getElementById('part_filter').value.toLowerCase(); + const 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'; From 74be3bdfb25e0b8754c31b93b2081e9489ab8810 Mon Sep 17 00:00:00 2001 From: Dirlligafu Date: Fri, 10 Jul 2026 21:25:02 +1100 Subject: [PATCH 2/2] Avoid recomputing shown count when renderPartList already has it --- templates/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/index.html b/templates/index.html index 4a27623..3363890 100644 --- a/templates/index.html +++ b/templates/index.html @@ -365,12 +365,14 @@

5. Detail & Output

row.appendChild(label); box.appendChild(row); }); - updatePartCount(); + updatePartCount(shown); } -function updatePartCount() { - const filterText = document.getElementById('part_filter').value.toLowerCase(); - const shown = allPartNames.filter(n => !filterText || n.toLowerCase().includes(filterText)).length; +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';