From 16bec055923ca42e1089f90a9ea1b51ad416ebc3 Mon Sep 17 00:00:00 2001 From: oliver Date: Mon, 15 Jun 2026 19:06:39 -0300 Subject: [PATCH] pivot --- app.js | 17 +++++++++++++++++ index.html | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/app.js b/app.js index cb188ad..01b100d 100644 --- a/app.js +++ b/app.js @@ -1496,6 +1496,23 @@ function crmRender() { ? `${total} contact${total !== 1 ? "s" : ""}` : `${filtered.length} / ${total} contacts`; + // Compute category counts from all records (unfiltered) + const catCounts = {}; + for (const r of crmRecords) { + const cat = (r.category || "Uncategorized").trim(); + catCounts[cat] = (catCounts[cat] || 0) + 1; + } + const catContainer = document.getElementById("crm-category-counts"); + if (catContainer) { + catContainer.innerHTML = Object.entries(catCounts) + .sort((a, b) => b[1] - a[1]) + .map( + ([cat, cnt]) => + `${escHtml(cat)}: ${cnt}`, + ) + .join(""); + } + // Reset check-all state const checkAll = document.getElementById("crm-check-all"); if (checkAll) checkAll.checked = false; diff --git a/index.html b/index.html index 2c6c91c..b40df2f 100644 --- a/index.html +++ b/index.html @@ -796,6 +796,16 @@ Delete Checked +