diff --git a/app/templates/local_workspace.html b/app/templates/local_workspace.html
index ecd6423..02c6179 100644
--- a/app/templates/local_workspace.html
+++ b/app/templates/local_workspace.html
@@ -392,14 +392,18 @@ document.addEventListener('alpine:init', function() {
toggleExpand(id, btn) {
this.expanded[id] = !(this.expanded[id] || false);
this.expanded = Object.assign({}, this.expanded);
- // For renderChildren static HTML: toggle the sibling
+ chevron rotation
+ // For renderChildren static HTML: toggle chevron + sibling
if (btn) {
btn.classList.toggle('open', this.expanded[id]);
- var li = btn.closest('li');
- if (li) {
- var ul = li.querySelector(':scope > ul.ws-tree');
- if (ul) {
- ul.style.display = this.expanded[id] ? '' : 'none';
+ // Navigate: btn → .ws-tree-item → - →
+ var itemDiv = btn.closest('.ws-tree-item');
+ if (itemDiv && itemDiv.parentElement) {
+ var children = itemDiv.parentElement.children;
+ for (var i = 0; i < children.length; i++) {
+ if (children[i].tagName === 'UL' && children[i].classList.contains('ws-tree')) {
+ children[i].style.display = this.expanded[id] ? '' : 'none';
+ break;
+ }
}
}
}