@vpxa/aikit 0.1.162 → 0.1.164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,8 +167,8 @@
167
167
  svg {
168
168
  display: block;
169
169
  width: 100%;
170
- height: min(78vh, 980px);
171
- min-height: 480px;
170
+ height: auto;
171
+ min-height: 600px;
172
172
  }
173
173
 
174
174
  .empty-state {
@@ -235,7 +235,7 @@
235
235
  }
236
236
 
237
237
  svg {
238
- min-height: 420px;
238
+ min-height: 500px;
239
239
  }
240
240
  }
241
241
  </style>
@@ -271,17 +271,17 @@
271
271
  const themeButton = document.getElementById('theme-button');
272
272
  const themes = ['auto', 'dark', 'light'];
273
273
  const monoFont = '"JetBrains Mono", "SFMono-Regular", Consolas, ui-monospace, monospace';
274
- const phaseGap = 260;
275
- const batchGap = 100;
276
- const taskGap = 80;
277
- const sequentialTaskGap = 112;
278
- const taskWidth = 200;
279
- const taskHeight = 72;
280
- const phaseHeaderHeight = 60;
281
- const canvasPadding = 64;
282
- const phasePaddingX = 28;
283
- const phasePaddingBottom = 34;
284
- const batchLabelHeight = 26;
274
+ const phaseGap = 300;
275
+ const batchGap = 120;
276
+ const taskGap = 100;
277
+ const sequentialTaskGap = 140;
278
+ const taskWidth = 260;
279
+ const taskHeight = 88;
280
+ const phaseHeaderHeight = 72;
281
+ const canvasPadding = 80;
282
+ const phasePaddingX = 36;
283
+ const phasePaddingBottom = 44;
284
+ const batchLabelHeight = 32;
285
285
  const phasePalette = [
286
286
  '--dt-cyan',
287
287
  '--tp-indigo',
@@ -531,9 +531,9 @@
531
531
  }
532
532
 
533
533
  function measureTask(task) {
534
- const titleLines = wrapText(task.title || task.id, 22, 2);
535
- const agentLines = wrapText(task.agent || 'Unassigned', 18, 1);
536
- const height = taskHeight + Math.max(0, titleLines.length - 1) * 18;
534
+ const titleLines = wrapText(task.title || task.id, 28, 2);
535
+ const agentLines = wrapText(task.agent || 'Unassigned', 24, 1);
536
+ const height = taskHeight + Math.max(0, titleLines.length - 1) * 20;
537
537
  return {
538
538
  width: taskWidth,
539
539
  height,
@@ -579,59 +579,61 @@
579
579
  function layout(model) {
580
580
  const phaseLayouts = [];
581
581
  const taskBoxes = new Map();
582
- let currentX = canvasPadding;
583
- let maxBottom = 0;
582
+ let currentY = canvasPadding;
583
+ let maxWidth = 0;
584
584
 
585
585
  model.phases.forEach((phase, phaseIndex) => {
586
- const phaseX = currentX;
587
- const phaseY = canvasPadding;
588
- let batchX = phaseX + phasePaddingX;
589
- let batchY = phaseY + phaseHeaderHeight + 18;
586
+ const phaseX = canvasPadding;
587
+ const phaseY = currentY;
588
+ let batchCursorX = phaseX + phasePaddingX;
589
+ const batchBaseY = phaseY + phaseHeaderHeight + 18;
590
590
  let rightEdge = phaseX + 320;
591
+ let maxBatchBottom = batchBaseY;
591
592
  const batchLayouts = [];
592
593
 
593
594
  phase.batches.forEach((batch) => {
594
- const batchLayout = layoutBatch(batch, batchX, batchY);
595
+ const batchLayout = layoutBatch(batch, batchCursorX, batchBaseY);
595
596
  batchLayout.boxes.forEach((box) => {
596
597
  taskBoxes.set(box.task.id, box);
597
598
  });
598
599
  batchLayouts.push({
599
600
  batch,
600
- x: batchX,
601
- y: batchY,
601
+ x: batchCursorX,
602
+ y: batchBaseY,
602
603
  width: batchLayout.width,
603
604
  height: batchLayout.height,
604
605
  boxes: batchLayout.boxes,
605
606
  });
606
- rightEdge = Math.max(rightEdge, batchX + batchLayout.width + phasePaddingX);
607
- batchY += batchLayout.height + batchGap;
608
- batchX += Math.max(taskWidth, batchLayout.width) + 108;
607
+ rightEdge = Math.max(rightEdge, batchCursorX + batchLayout.width + phasePaddingX);
608
+ maxBatchBottom = Math.max(maxBatchBottom, batchBaseY + batchLayout.height);
609
+ batchCursorX += Math.max(taskWidth, batchLayout.width) + batchGap;
609
610
  });
610
611
 
612
+ const phaseWidth = Math.max(600, rightEdge - phaseX);
611
613
  const phaseHeight = Math.max(
612
614
  phaseHeaderHeight + 120,
613
- batchY - phaseY - batchGap + phasePaddingBottom,
615
+ maxBatchBottom - phaseY + phasePaddingBottom,
614
616
  );
615
617
 
616
618
  phaseLayouts.push({
617
619
  phase,
618
620
  x: phaseX,
619
621
  y: phaseY,
620
- width: Math.max(360, rightEdge - phaseX),
622
+ width: phaseWidth,
621
623
  height: phaseHeight,
622
624
  color: phaseColor(phaseIndex),
623
625
  batches: batchLayouts,
624
626
  });
625
627
 
626
- currentX += Math.max(360, rightEdge - phaseX) + phaseGap;
627
- maxBottom = Math.max(maxBottom, phaseY + phaseHeight);
628
+ maxWidth = Math.max(maxWidth, phaseX + phaseWidth + canvasPadding);
629
+ currentY += phaseHeight + phaseGap;
628
630
  });
629
631
 
630
632
  return {
631
633
  phases: phaseLayouts,
632
634
  taskBoxes,
633
- width: Math.max(1160, currentX - phaseGap + canvasPadding),
634
- height: Math.max(700, maxBottom + canvasPadding),
635
+ width: Math.max(1200, maxWidth),
636
+ height: Math.max(600, currentY - phaseGap + canvasPadding),
635
637
  };
636
638
  }
637
639
 
@@ -1008,6 +1010,7 @@
1008
1010
  const layoutResult = layout(model);
1009
1011
  svg.innerHTML = '';
1010
1012
  svg.setAttribute('viewBox', '0 0 ' + layoutResult.width + ' ' + layoutResult.height);
1013
+ svg.style.height = layoutResult.height + 'px';
1011
1014
  svg.setAttribute('aria-label', model.title + ' with ' + totalTasks + ' tasks');
1012
1015
  svg.appendChild(renderDefs());
1013
1016
  svg.appendChild(node('title', { id: 'diagram-title' }, model.title || 'Task execution plan'));