320
parts.push(`${indent.join('')}${prefix}${displayLabelOf[i]}`.padEnd(w));
321
} else {
322
>
// Cross-lane continuation. Draw `│` at each slot occupied by
executionGraph.ts
323
>
// an active ancestor (lastChild > i). Also show a `|` placeholder
324
>
// at the slot of the next upcoming event if it's a non-last child.
325
>
const activeSlots: number[] = [];
326
>
for (const a of stack) {
327
>
if (lastChildOf[a] > i) { activeSlots.push(slotOf[a]); }
328
>
}
329
>
const maxSlot = Math.max(...activeSlots, -1);
330
>
const chars: string[] = new Array(Math.max(maxSlot + 1, 0)).fill(' ');
331
>
for (const s of activeSlots) { chars[s] = '│ '; }
332
>
333
>
// Find the next event in root r strictly after i.
334
>
let nextJ = -1;
335
>
for (let j = i + 1; j < n; j++) {
336
>
if (events[j].root === r) { nextJ = j; break; }
337
>
}
338
>
if (nextJ >= 0 && parentOf[nextJ] >= 0) {
339
>
const s = slotOf[nextJ];
340
>
// Reserve slot if next event will open a new branch (├─).
341
>
if (!isLastChild[nextJ]) {
342
>
while (chars.length <= s) { chars.push(' '); }
343
>
if (chars[s] === ' ') { chars[s] = '| '; }
344
>
}
345
>
}
346
>
347
>
// Trim trailing empty cells.
348
>
while (chars.length > 0 && chars[chars.length - 1] === ' ') { chars.pop(); }
349
>
parts.push(chars.join('').padEnd(w));
350
>
}
351
}
352