diff --git a/zddc/internal/apps/embedded/archive.html b/zddc/internal/apps/embedded/archive.html
index 801e6e9..e713d6b 100644
--- a/zddc/internal/apps/embedded/archive.html
+++ b/zddc/internal/apps/embedded/archive.html
@@ -2717,7 +2717,7 @@ td[data-field="trackingNumber"] {
diff --git a/zddc/internal/apps/embedded/browse.html b/zddc/internal/apps/embedded/browse.html
index 4b5a028..db8d2bf 100644
--- a/zddc/internal/apps/embedded/browse.html
+++ b/zddc/internal/apps/embedded/browse.html
@@ -2824,7 +2824,7 @@ li.CodeMirror-hint-active {
diff --git a/zddc/internal/apps/embedded/classifier.html b/zddc/internal/apps/embedded/classifier.html
index 34d3f83..b68d291 100644
--- a/zddc/internal/apps/embedded/classifier.html
+++ b/zddc/internal/apps/embedded/classifier.html
@@ -2421,7 +2421,7 @@ input.tfile__name:focus { border-color: var(--primary); background: var(--bg); o
@@ -10083,33 +10083,39 @@ X.B(E,Y);return E}return J}())
var visible = null; // { folders, files } while filtering, else null
function computeVisible() {
var c = window.app.modules.classify;
- var folders = Object.create(null), files = Object.create(null);
+ var folders = Object.create(null), files = Object.create(null), counts = Object.create(null);
var nf = filterActive();
function walk(folder, ancMatched) {
var selfMatch = nf && nameHit(folder.path || folder.name);
var matched = ancMatched || selfMatch;
var show = false, hasFile = false, descMatch = false;
+ // Post-filter counts for the row's "direct+total" badge: direct =
+ // immediate visible children/files, total = visible across the subtree.
+ var dDir = 0, tDir = 0, dFile = 0, tFile = 0;
(folder.children || []).forEach(function (ch) {
var r = walk(ch, matched);
- if (r.show) show = true;
+ if (r.show) { show = true; dDir++; tDir += 1 + r.tDir; }
if (r.hasFile) hasFile = true;
if (r.subtreeMatch) descMatch = true; // a child leads to a match
+ tFile += r.tFile;
});
(folder.files || []).forEach(function (f) {
hasFile = true;
if (!classifyAllows(f)) return;
var fileMatch = nf && nameHit(c.srcKeyForFile(f));
- if (!nf || matched || fileMatch) { files[c.srcKeyForFile(f)] = true; show = true; }
+ if (!nf || matched || fileMatch) { files[c.srcKeyForFile(f)] = true; show = true; dFile++; }
if (fileMatch) descMatch = true; // a match sits directly in this folder
});
+ tFile += dFile;
if (matched) show = true;
// "Show Empty" off → hide folders whose whole subtree holds no files.
if (!hasFile && !showEmpty && !matched) show = false;
if (show) folders[folder.path] = true;
- return { show: show, hasFile: hasFile, subtreeMatch: descMatch || selfMatch };
+ counts[folder.path] = { dDir: dDir, tDir: tDir, dFile: dFile, tFile: tFile };
+ return { show: show, hasFile: hasFile, subtreeMatch: descMatch || selfMatch, tDir: tDir, tFile: tFile };
}
(window.app.folderTree || []).forEach(function (root) { walk(root, false); });
- return { folders: folders, files: files };
+ return { folders: folders, files: files, counts: counts };
}
function folderShown(folder) { return !visible || !!visible.folders[folder.path]; }
function fileShown(file) {
@@ -10183,8 +10189,13 @@ X.B(E,Y);return E}return J}())
const done = st === 'done';
// When fully scanned both numbers are blue; .done turns the labels blue too.
if (done) el.classList.add('done');
- const dDir = folder.subdirCount || 0, tDir = folder.runDirs || 0;
- const dFile = folder.fileCount || 0, tFile = folder.runFiles || 0;
+ // While a filter (autofilter or a Show checkbox) is narrowing the tree,
+ // the badge counts what's VISIBLE; otherwise the raw scanned totals.
+ const vc = visible && visible.counts && visible.counts[folder.path];
+ const dDir = vc ? vc.dDir : (folder.subdirCount || 0);
+ const tDir = vc ? vc.tDir : (folder.runDirs || 0);
+ const dFile = vc ? vc.dFile : (folder.fileCount || 0);
+ const tFile = vc ? vc.tFile : (folder.runFiles || 0);
const frag = document.createDocumentFragment();
frag.appendChild(document.createTextNode('('));
diff --git a/zddc/internal/apps/embedded/index.html b/zddc/internal/apps/embedded/index.html
index b94ef7c..cc9b1ee 100644
--- a/zddc/internal/apps/embedded/index.html
+++ b/zddc/internal/apps/embedded/index.html
@@ -1793,7 +1793,7 @@ body {