@@ -10083,7 +10083,7 @@ 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), open = Object.create(null);
+ var folders = Object.create(null), files = Object.create(null);
var nf = filterActive();
function walk(folder, ancMatched) {
var selfMatch = nf && nameHit(folder.path || folder.name);
@@ -10106,19 +10106,11 @@ X.B(E,Y);return E}return J}())
// "Show Empty" off → hide folders whose whole subtree holds no files.
if (!hasFile && !showEmpty && !matched) show = false;
if (show) folders[folder.path] = true;
- // Auto-open ONLY the connector folders on the path down to a match —
- // never the matched node itself. Terminal matches and everything
- // off-path keep their real collapse state; the root's expand-all
- // covers the rest. (Search reveals where hits are; it doesn't reshape
- // the tree.)
- if (nf && descMatch) open[folder.path] = true;
return { show: show, hasFile: hasFile, subtreeMatch: descMatch || selfMatch };
}
(window.app.folderTree || []).forEach(function (root) { walk(root, false); });
- return { folders: folders, files: files, open: open };
+ return { folders: folders, files: files };
}
- // True only for folders the search needs opened to expose a hit beneath them.
- function autoOpen(folder) { return !!(visible && visible.open && visible.open[folder.path]); }
function folderShown(folder) { return !visible || !!visible.folders[folder.path]; }
function fileShown(file) {
if (!classifyAllows(file)) return false;
@@ -10274,7 +10266,7 @@ X.B(E,Y);return E}return J}())
// expandable so its files can be revealed and dragged.
|| (classifyOn() && folder.files && folder.files.length > 0);
if (mightHaveChildren) {
- toggle.textContent = (folder.expanded || autoOpen(folder)) ? '▼' : '▶';
+ toggle.textContent = folder.expanded ? '▼' : '▶';
toggle.addEventListener('click', (e) => {
e.stopPropagation();
const recursive = e.ctrlKey || e.metaKey;
@@ -10338,9 +10330,12 @@ X.B(E,Y);return E}return J}())
div.appendChild(item);
- // Children — when expanded, or opened on the path to a search hit below.
- // The Show toggles never force-expand; search opens only connector folders.
- if ((folder.expanded || autoOpen(folder)) && folder.children && folder.children.length > 0) {
+ // Children render ONLY when the user has expanded this folder. The
+ // autofilter and Show toggles never change expand/collapse state — they
+ // hide/show rows in place. A collapsed folder stays collapsed even if it
+ // contains matches (it's still shown, so the user can open it); this lets
+ // you filter within one subtree without the rest expanding.
+ if (folder.expanded && folder.children && folder.children.length > 0) {
const childrenDiv = document.createElement('div');
childrenDiv.className = 'folder-children';
sortedFolders(folder.children).forEach(child => {
@@ -10351,9 +10346,9 @@ X.B(E,Y);return E}return J}())
div.appendChild(childrenDiv);
}
- // Classify mode: list this folder's own files (draggable leaves) when
- // expanded (or opened to reveal a search hit), so they can be dropped.
- if (classifyOn() && (folder.expanded || autoOpen(folder)) && folder.files && folder.files.length > 0) {
+ // Classify mode: list this folder's own files (draggable leaves) only
+ // when the user has expanded it (the filter never force-expands).
+ if (classifyOn() && folder.expanded && folder.files && folder.files.length > 0) {
const filesDiv = document.createElement('div');
filesDiv.className = 'folder-children folder-files';
sortedFiles(folder.files).forEach(function (file) {
diff --git a/zddc/internal/apps/embedded/index.html b/zddc/internal/apps/embedded/index.html
index d613a86..b94ef7c 100644
--- a/zddc/internal/apps/embedded/index.html
+++ b/zddc/internal/apps/embedded/index.html
@@ -1793,7 +1793,7 @@ body {