fix(coding-agent): treat multiple roots as children of virtual branching root

This commit is contained in:
Mario Zechner 2025-12-29 14:55:11 +01:00
parent 7c103ddc55
commit 32ec1fa883

View file

@ -81,8 +81,11 @@ class TreeList implements Component {
const stack: StackItem[] = [];
// Add roots in reverse order
// If multiple roots, treat them as children of a virtual root that branches
// So they start at indent 1 with justBranched=true
const multipleRoots = roots.length > 1;
for (let i = roots.length - 1; i >= 0; i--) {
stack.push([roots[i], 0, roots.length > 1]);
stack.push([roots[i], multipleRoots ? 1 : 0, multipleRoots]);
}
while (stack.length > 0) {