mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 04:02:21 +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[] = [];
|
const stack: StackItem[] = [];
|
||||||
|
|
||||||
// Add roots in reverse order
|
// 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--) {
|
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) {
|
while (stack.length > 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue