mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 23:01:30 +00:00
fix(coding-agent): treat multiple roots as children of virtual branching root
This commit is contained in:
parent
7c103ddc55
commit
32ec1fa883
1 changed files with 4 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue