// Toggle expand/collapse for file-tree folder rows. HTMX handles the // initial fetch (hx-trigger="click once"); this script handles every // subsequent click without re-fetching. (function () { document.addEventListener("click", function (event) { const button = event.target.closest(".file-tree-toggle"); if (!button) return; const expanded = button.getAttribute("aria-expanded") === "true"; button.setAttribute("aria-expanded", expanded ? "false" : "true"); const children = button.nextElementSibling; if (children && children.classList.contains("file-tree-children")) { children.hidden = expanded; } }); })();