@principal-ai/subsystems-react 0.56.20 → 0.56.22

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.
Files changed (54) hide show
  1. package/dist/index.d.ts +4 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/subsystem/C4Graph.d.ts +2 -69
  6. package/dist/subsystem/C4Graph.d.ts.map +1 -1
  7. package/dist/subsystem/C4Graph.js +8 -154
  8. package/dist/subsystem/C4Graph.js.map +1 -1
  9. package/dist/subsystem/C4NodeCard.d.ts +1 -47
  10. package/dist/subsystem/C4NodeCard.d.ts.map +1 -1
  11. package/dist/subsystem/C4NodeCard.js +6 -141
  12. package/dist/subsystem/C4NodeCard.js.map +1 -1
  13. package/dist/subsystem/ContainersPanel.d.ts +33 -0
  14. package/dist/subsystem/ContainersPanel.d.ts.map +1 -0
  15. package/dist/subsystem/ContainersPanel.js +116 -0
  16. package/dist/subsystem/ContainersPanel.js.map +1 -0
  17. package/dist/subsystem/SubsystemComponentGraph.d.ts +27 -1
  18. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  19. package/dist/subsystem/SubsystemComponentGraph.js +147 -21
  20. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  21. package/dist/subsystem/containerCard.d.ts +132 -0
  22. package/dist/subsystem/containerCard.d.ts.map +1 -0
  23. package/dist/subsystem/containerCard.js +167 -0
  24. package/dist/subsystem/containerCard.js.map +1 -0
  25. package/dist/subsystem/graphChrome.d.ts +11 -8
  26. package/dist/subsystem/graphChrome.d.ts.map +1 -1
  27. package/dist/subsystem/graphChrome.js +11 -9
  28. package/dist/subsystem/graphChrome.js.map +1 -1
  29. package/dist/subsystem/graphMorph.d.ts +142 -0
  30. package/dist/subsystem/graphMorph.d.ts.map +1 -0
  31. package/dist/subsystem/graphMorph.js +177 -0
  32. package/dist/subsystem/graphMorph.js.map +1 -0
  33. package/dist/subsystem/model.d.ts +89 -0
  34. package/dist/subsystem/model.d.ts.map +1 -1
  35. package/dist/subsystem/model.js +224 -15
  36. package/dist/subsystem/model.js.map +1 -1
  37. package/dist/subsystem/nodes.d.ts +9 -3
  38. package/dist/subsystem/nodes.d.ts.map +1 -1
  39. package/dist/subsystem/nodes.js +134 -82
  40. package/dist/subsystem/nodes.js.map +1 -1
  41. package/package.json +1 -1
  42. package/src/index.ts +5 -0
  43. package/src/stories/Canvases/Subsystem/ContainerFrames.stories.tsx +132 -0
  44. package/src/subsystem/C4Graph.tsx +20 -180
  45. package/src/subsystem/C4NodeCard.tsx +34 -202
  46. package/src/subsystem/ContainersPanel.tsx +239 -0
  47. package/src/subsystem/SubsystemComponentGraph.tsx +232 -25
  48. package/src/subsystem/containerCard.tsx +264 -0
  49. package/src/subsystem/graphChrome.tsx +11 -9
  50. package/src/subsystem/graphMorph.tsx +212 -0
  51. package/src/subsystem/model.collapse.test.ts +128 -0
  52. package/src/subsystem/model.ts +306 -16
  53. package/src/subsystem/nodes.group.test.tsx +125 -16
  54. package/src/subsystem/nodes.tsx +201 -91
@@ -266,7 +266,41 @@ export interface SubsystemProcessRegion {
266
266
  * membership still read the claim as a process region.
267
267
  */
268
268
  chrome?: 'package';
269
+ /**
270
+ * The technology the boundary is built with (Bun, React, Postgres…), for the
271
+ * frame's technology row — the same slot a C4 container card fills. Host-
272
+ * supplied through `BoundaryFrameOptions.regionDetails`, or derived from the
273
+ * members' `framework` when the host says nothing.
274
+ */
275
+ technology?: string;
276
+ /** One-line responsibility, the way C4 asks every container to state one. */
277
+ description?: string;
278
+ /**
279
+ * A process frame's sort — application or data store — which picks the kind
280
+ * glyph on its header. Defaults to `application`.
281
+ */
282
+ containerKind?: 'application' | 'data-store';
269
283
  }
284
+ /**
285
+ * Host-supplied C4 facts about a boundary region, keyed by region key in
286
+ * `BoundaryFrameOptions.regionDetails`. Everything is optional: a host that
287
+ * accepted a C4 container for a process passes what the container states.
288
+ */
289
+ export type SubsystemRegionDetails = Pick<SubsystemProcessRegion, 'technology' | 'description' | 'containerKind'>;
290
+ /**
291
+ * Whether a frame draws as a container *card* — header rows (label, kind glyph,
292
+ * technology, member count), filled body — rather than as a bare dashed frame
293
+ * with a path badge. Process and package boundaries are containers in the C4
294
+ * sense; module and directory frames are code folders and keep the badge.
295
+ */
296
+ export declare function isCardFrame(region: Pick<SubsystemProcessRegion, 'kind' | 'chrome'>): boolean;
297
+ /**
298
+ * The technology a region is built with, read off its members when the host
299
+ * states none: the most common member `framework` we hold an official mark for.
300
+ * A region whose members name no known framework stays unstated, so the header
301
+ * falls back to the kind rather than inventing a technology.
302
+ */
303
+ export declare function deriveRegionTechnology(members: readonly Pick<SubsystemComponent, 'framework'>[]): string | undefined;
270
304
  /** Options for which boundary frames are kept. */
271
305
  export interface BoundaryFrameOptions {
272
306
  /**
@@ -299,6 +333,14 @@ export interface BoundaryFrameOptions {
299
333
  * only — region identity and issue targeting are unchanged.
300
334
  */
301
335
  codeProcessKeys?: ReadonlySet<string>;
336
+ /**
337
+ * C4 facts for boundary regions, keyed by region key (the `process` value or
338
+ * the package purl key): technology, description, container sort. A card
339
+ * frame draws them in its header the way a C4 container card does. Regions
340
+ * not named here derive a technology from their members' `framework` and
341
+ * otherwise state nothing.
342
+ */
343
+ regionDetails?: Readonly<Record<string, SubsystemRegionDetails>>;
302
344
  }
303
345
  /** React Flow id for a process boundary group node. */
304
346
  export declare function processGroupNodeId(processKey: string): string;
@@ -456,6 +498,13 @@ export interface SubsystemGroupNodeData extends Record<string, unknown> {
456
498
  color?: string;
457
499
  /** Boundary diagnostics badge — see `SubsystemRegionIssue`. */
458
500
  issue?: SubsystemRegionIssue;
501
+ /**
502
+ * Drawn as a closed container card: members folded away, lines rolled up onto
503
+ * it. Set by the layout when the frame is in `collapsedGroupIds`.
504
+ */
505
+ collapsed?: boolean;
506
+ /** Open or close this frame — the header's grow/shrink affordance. */
507
+ onToggleCollapse?: () => void;
459
508
  }
460
509
  export type SubsystemGraphNode = Node<SubsystemGraphNodeData, 'subsystem-component'> | Node<SubsystemGroupNodeData, 'subsystem-group'>;
461
510
  export interface SubsystemGraphEdgeData extends Record<string, unknown> {
@@ -473,6 +522,14 @@ export interface SubsystemGraphEdgeData extends Record<string, unknown> {
473
522
  /** True while another edge is selected — render this edge (and its label)
474
523
  * dimmed to focus the selected relationship. */
475
524
  dimmed?: boolean;
525
+ /**
526
+ * How many edges this line stands for, when a collapsed frame rolled them up
527
+ * (one line per source/target/mechanism). Absent on an ordinary edge.
528
+ */
529
+ rolledUp?: number;
530
+ /** Ids of the edges a rolled-up line stands for, so trail-step highlighting
531
+ * can still light the line when one of them is the focused step. */
532
+ rolledUpIds?: string[];
476
533
  /** ELK-computed label midpoint (from the actual edge path, not node centers). */
477
534
  labelX?: number;
478
535
  labelY?: number;
@@ -714,6 +771,29 @@ export declare function subsystemGraphLayoutKey(doc: Pick<SubsystemModelDocument
714
771
  * members vertically. That containment treatment wins in both modes.
715
772
  */
716
773
  export declare function elkDirectionFor(layoutDirection: SubsystemLayoutDirection, hasEdges: boolean): 'RIGHT' | 'DOWN';
774
+ /**
775
+ * Fold the collapsed boundary frames down to cards.
776
+ *
777
+ * A collapsed frame stops being an ELK parent and becomes a leaf the size of a
778
+ * container card (`NODE_W` × `NODE_H`). Its members — and every frame nested
779
+ * inside it — leave the graph, and the edges that touched them are re-targeted
780
+ * at the card: one line per (source, target, mechanism), so a frame with a
781
+ * dozen calls into another reads as one `calls` line rather than a dozen. A
782
+ * line that starts and ends inside the same collapsed frame folds into nothing.
783
+ *
784
+ * Only card frames (process / package) collapse; a module or directory id in
785
+ * `collapsedIds` is ignored. A frame nested inside a collapsed frame is swallowed
786
+ * by it, whatever its own state — the outer card is the only thing drawn.
787
+ *
788
+ * Pure: hands back new arrays and leaves the inputs alone.
789
+ */
790
+ export declare function collapseBoundaryGroups(nodes: readonly SubsystemGraphNode[], edges: readonly SubsystemGraphEdge[], groups: readonly BoundaryLayoutGroup[], collapsedIds: ReadonlySet<string>): {
791
+ nodes: SubsystemGraphNode[];
792
+ edges: SubsystemGraphEdge[];
793
+ groups: BoundaryLayoutGroup[];
794
+ /** The regions folded to cards, for callers that list every region drawn. */
795
+ collapsedRegions: SubsystemProcessRegion[];
796
+ };
717
797
  /**
718
798
  * Build the full React Flow graph (nodes + edges) using **ELK auto-layout** to
719
799
  * position every node (including external stub targets), so the graph is
@@ -743,6 +823,15 @@ export declare function buildSubsystemGraph(doc: Pick<SubsystemModelDocument, 'c
743
823
  * @default 'horizontal'
744
824
  */
745
825
  layoutDirection?: SubsystemLayoutDirection;
826
+ /**
827
+ * Boundary group node ids (see `boundaryGroupNodeId`) drawn collapsed — as a
828
+ * container card with its members folded away and their lines rolled up
829
+ * onto it. Only card frames (process / package) collapse. With
830
+ * `cardFramesCollapsed`, the set lists the frames drawn *open* instead.
831
+ */
832
+ collapsedGroupIds?: ReadonlySet<string>;
833
+ /** Start every card frame collapsed; `collapsedGroupIds` then names the exceptions. */
834
+ cardFramesCollapsed?: boolean;
746
835
  } & BoundaryFrameOptions): Promise<{
747
836
  nodes: SubsystemGraphNode[];
748
837
  edges: SubsystemGraphEdge[];
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/subsystem/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAEL,KAAK,IAAI,EACT,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EACV,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AAGvC;;;;;;;;;;;;;;;GAeG;AACH,YAAY,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAC1B,6BAA6B,GAC7B,uBAAuB,CAAC;AAE5B,0EAA0E;AAC1E,MAAM,WAAW,2BAA2B;IAC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,KAAK,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,GACjE,MAAM,EAAE,CAIV"}
@@ -16,6 +16,8 @@ import { MarkerType, } from '@xyflow/react';
16
16
  import { computeElkLayout, calculatePathLength } from '../utils/elkLayout';
17
17
  import { EDGE_LABEL_SIDE_PADDING, EDGE_ARROW_INSET } from '../utils/edgeLabel';
18
18
  import { purlOwnerName, purlRepoKey } from './paths';
19
+ import { technologyBrand } from './techIcons';
20
+ import { NODE_H, NODE_W, OPEN_HEADER_PAD, OPEN_SIDE_PAD } from './containerCard';
19
21
  import { getSubsystemProcessRegions as coreGetSubsystemProcessRegions, getSubsystemModuleRegions as coreGetSubsystemModuleRegions, } from '@principal-ai/subsystems-core';
20
22
  /** Stable id for a derived graph edge from a trail step. */
21
23
  export function derivedGraphEdgeId(from, to, mechanism) {
@@ -200,6 +202,39 @@ export function formatPurl(purl) {
200
202
  }
201
203
  return identity;
202
204
  }
205
+ /**
206
+ * Whether a frame draws as a container *card* — header rows (label, kind glyph,
207
+ * technology, member count), filled body — rather than as a bare dashed frame
208
+ * with a path badge. Process and package boundaries are containers in the C4
209
+ * sense; module and directory frames are code folders and keep the badge.
210
+ */
211
+ export function isCardFrame(region) {
212
+ return region.kind === 'process' || region.kind === 'package' || region.chrome === 'package';
213
+ }
214
+ /**
215
+ * The technology a region is built with, read off its members when the host
216
+ * states none: the most common member `framework` we hold an official mark for.
217
+ * A region whose members name no known framework stays unstated, so the header
218
+ * falls back to the kind rather than inventing a technology.
219
+ */
220
+ export function deriveRegionTechnology(members) {
221
+ const counts = new Map();
222
+ for (const m of members) {
223
+ const brand = technologyBrand(m.framework);
224
+ if (!brand)
225
+ continue;
226
+ counts.set(brand.name, (counts.get(brand.name) ?? 0) + 1);
227
+ }
228
+ let best;
229
+ let bestCount = 0;
230
+ for (const [name, count] of counts) {
231
+ if (count > bestCount) {
232
+ best = name;
233
+ bestCount = count;
234
+ }
235
+ }
236
+ return best;
237
+ }
203
238
  /** React Flow id for a process boundary group node. */
204
239
  export function processGroupNodeId(processKey) {
205
240
  return `process:${processKey}`;
@@ -1330,13 +1365,140 @@ export function elkDirectionFor(layoutDirection, hasEdges) {
1330
1365
  return 'DOWN';
1331
1366
  return layoutDirection === 'vertical' ? 'DOWN' : 'RIGHT';
1332
1367
  }
1368
+ /**
1369
+ * Fold the collapsed boundary frames down to cards.
1370
+ *
1371
+ * A collapsed frame stops being an ELK parent and becomes a leaf the size of a
1372
+ * container card (`NODE_W` × `NODE_H`). Its members — and every frame nested
1373
+ * inside it — leave the graph, and the edges that touched them are re-targeted
1374
+ * at the card: one line per (source, target, mechanism), so a frame with a
1375
+ * dozen calls into another reads as one `calls` line rather than a dozen. A
1376
+ * line that starts and ends inside the same collapsed frame folds into nothing.
1377
+ *
1378
+ * Only card frames (process / package) collapse; a module or directory id in
1379
+ * `collapsedIds` is ignored. A frame nested inside a collapsed frame is swallowed
1380
+ * by it, whatever its own state — the outer card is the only thing drawn.
1381
+ *
1382
+ * Pure: hands back new arrays and leaves the inputs alone.
1383
+ */
1384
+ export function collapseBoundaryGroups(nodes, edges, groups, collapsedIds) {
1385
+ const byId = new Map(groups.map((g) => [g.id, g]));
1386
+ const childrenOf = new Map();
1387
+ for (const g of groups) {
1388
+ if (!g.parentId)
1389
+ continue;
1390
+ const list = childrenOf.get(g.parentId) ?? [];
1391
+ list.push(g);
1392
+ childrenOf.set(g.parentId, list);
1393
+ }
1394
+ const isInsideCollapsed = (g) => {
1395
+ let p = g.parentId ? byId.get(g.parentId) : undefined;
1396
+ while (p) {
1397
+ if (collapsedIds.has(p.id) && isCardFrame(p.region))
1398
+ return true;
1399
+ p = p.parentId ? byId.get(p.parentId) : undefined;
1400
+ }
1401
+ return false;
1402
+ };
1403
+ // The outermost collapsed card frames: the ones actually drawn as cards.
1404
+ const roots = groups.filter((g) => collapsedIds.has(g.id) && isCardFrame(g.region) && !isInsideCollapsed(g));
1405
+ if (roots.length === 0) {
1406
+ return { nodes: [...nodes], edges: [...edges], groups: [...groups], collapsedRegions: [] };
1407
+ }
1408
+ // alias (or swallowed group id) → the card that now stands for it.
1409
+ const foldedInto = new Map();
1410
+ const removedGroupIds = new Set();
1411
+ for (const root of roots) {
1412
+ const stack = [root];
1413
+ while (stack.length > 0) {
1414
+ const g = stack.pop();
1415
+ removedGroupIds.add(g.id);
1416
+ foldedInto.set(g.id, root.id);
1417
+ for (const alias of g.memberAliases)
1418
+ foldedInto.set(alias, root.id);
1419
+ for (const child of childrenOf.get(g.id) ?? [])
1420
+ stack.push(child);
1421
+ }
1422
+ }
1423
+ const keptGroups = groups
1424
+ .filter((g) => !removedGroupIds.has(g.id))
1425
+ .map((g) => {
1426
+ // A kept frame that held members of a collapsed card now holds the card.
1427
+ const members = [];
1428
+ const seen = new Set();
1429
+ for (const alias of g.memberAliases) {
1430
+ const id = foldedInto.get(alias) ?? alias;
1431
+ if (seen.has(id))
1432
+ continue;
1433
+ seen.add(id);
1434
+ members.push(id);
1435
+ }
1436
+ return { ...g, memberAliases: members };
1437
+ });
1438
+ const cards = roots.map((root) => ({
1439
+ id: root.id,
1440
+ type: 'subsystem-group',
1441
+ position: { x: 0, y: 0 },
1442
+ width: NODE_W,
1443
+ height: NODE_H,
1444
+ ...(root.parentId && !removedGroupIds.has(root.parentId) ? { parentId: root.parentId } : {}),
1445
+ data: { region: root.region, collapsed: true },
1446
+ draggable: false,
1447
+ }));
1448
+ const keptNodes = nodes.filter((n) => !foldedInto.has(n.id));
1449
+ // Re-target and fold the edges. First occurrence keeps its id when neither
1450
+ // endpoint moved, so an untouched edge stays addressable by its original id
1451
+ // (trail-step highlighting keys off it).
1452
+ const folded = new Map();
1453
+ const out = [];
1454
+ for (const e of edges) {
1455
+ const source = foldedInto.get(e.source) ?? e.source;
1456
+ const target = foldedInto.get(e.target) ?? e.target;
1457
+ if (source === target && (foldedInto.has(e.source) || foldedInto.has(e.target)))
1458
+ continue;
1459
+ const moved = source !== e.source || target !== e.target;
1460
+ if (!moved) {
1461
+ out.push(e);
1462
+ continue;
1463
+ }
1464
+ const mechanism = e.data?.mechanism ?? 'uses';
1465
+ const key = `${source}\0${target}\0${mechanism}`;
1466
+ const existing = folded.get(key);
1467
+ if (existing) {
1468
+ const refs = [...(existing.data?.refs ?? []), ...(e.data?.refs ?? [])];
1469
+ const prev = existing.data;
1470
+ existing.data = {
1471
+ ...prev,
1472
+ refs: refs.length > 0 ? [...new Set(refs)] : undefined,
1473
+ rolledUp: (prev.rolledUp ?? 1) + 1,
1474
+ rolledUpIds: [...(prev.rolledUpIds ?? []), e.id],
1475
+ };
1476
+ continue;
1477
+ }
1478
+ const rolled = {
1479
+ ...e,
1480
+ id: derivedGraphEdgeId(source, target, mechanism),
1481
+ source,
1482
+ target,
1483
+ data: { ...e.data, rolledUp: 1, rolledUpIds: [e.id] },
1484
+ };
1485
+ folded.set(key, rolled);
1486
+ out.push(rolled);
1487
+ }
1488
+ return {
1489
+ nodes: [...keptNodes, ...cards],
1490
+ edges: out,
1491
+ groups: keptGroups,
1492
+ collapsedRegions: roots.map((r) => r.region),
1493
+ };
1494
+ }
1333
1495
  /**
1334
1496
  * Build the full React Flow graph (nodes + edges) using **ELK auto-layout** to
1335
1497
  * position every node (including external stub targets), so the graph is
1336
1498
  * layered with minimized crossings.
1337
1499
  */
1338
1500
  export async function buildSubsystemGraph(doc, opts = {}) {
1339
- const { maxNodeWidth, showEdgeLabels, measuredWidths, measuredHeights, showSingletonFrames, packageFrames, moduleNesting, graphifyRelations, orderByLine = false, layoutDirection = 'horizontal', codeProcessKeys, } = opts;
1501
+ const { maxNodeWidth, showEdgeLabels, measuredWidths, measuredHeights, showSingletonFrames, packageFrames, moduleNesting, graphifyRelations, orderByLine = false, layoutDirection = 'horizontal', codeProcessKeys, regionDetails, collapsedGroupIds, cardFramesCollapsed = false, } = opts;
1340
1502
  const frameOpts = {
1341
1503
  showSingletonFrames,
1342
1504
  packageFrames,
@@ -1356,7 +1518,26 @@ export async function buildSubsystemGraph(doc, opts = {}) {
1356
1518
  }
1357
1519
  }
1358
1520
  }
1359
- const regions = layoutGroups.map((g) => g.region);
1521
+ // Card frames carry C4 facts in their header. The host's word wins; a region
1522
+ // it says nothing about reads its technology off its members.
1523
+ {
1524
+ const componentByAlias = new Map(doc.components.map((c) => [c.alias, c]));
1525
+ for (const g of layoutGroups) {
1526
+ if (!isCardFrame(g.region))
1527
+ continue;
1528
+ const details = regionDetails?.[g.region.key];
1529
+ const technology = details?.technology ??
1530
+ deriveRegionTechnology(g.region.memberAliases
1531
+ .map((alias) => componentByAlias.get(alias))
1532
+ .filter((c) => c != null));
1533
+ g.region = {
1534
+ ...g.region,
1535
+ ...(technology != null && { technology }),
1536
+ ...(details?.description != null && { description: details.description }),
1537
+ ...(details?.containerKind != null && { containerKind: details.containerKind }),
1538
+ };
1539
+ }
1540
+ }
1360
1541
  const regionIds = new Set(layoutGroups.map((g) => g.id));
1361
1542
  const byAlias = new Map(doc.components.map((c) => [c.alias, c]));
1362
1543
  // Resolve leaf parentIds against kept frames: module → process → package.
@@ -1432,6 +1613,21 @@ export async function buildSubsystemGraph(doc, opts = {}) {
1432
1613
  n.height = mh;
1433
1614
  }
1434
1615
  }
1616
+ // Fold the collapsed frames to cards before layout: their members leave the
1617
+ // graph and their lines roll up onto the card, so ELK lays out what is drawn.
1618
+ let collapsedRegions = [];
1619
+ const toggled = collapsedGroupIds ?? new Set();
1620
+ const collapsedSet = new Set(layoutGroups
1621
+ .filter((g) => isCardFrame(g.region) && toggled.has(g.id) !== cardFramesCollapsed)
1622
+ .map((g) => g.id));
1623
+ if (collapsedSet.size > 0) {
1624
+ const folded = collapseBoundaryGroups(nodes, edges, layoutGroups, collapsedSet);
1625
+ nodes.splice(0, nodes.length, ...folded.nodes);
1626
+ edges.splice(0, edges.length, ...folded.edges);
1627
+ layoutGroups.splice(0, layoutGroups.length, ...folded.groups);
1628
+ collapsedRegions = folded.collapsedRegions;
1629
+ }
1630
+ const regions = [...layoutGroups.map((g) => g.region), ...collapsedRegions];
1435
1631
  // Same-layer order follows the trails: a component ranks by the first step
1436
1632
  // that mentions it, so a trail reads top-to-bottom (or left-to-right) as it
1437
1633
  // fans out. Components no trail touches follow in declaration order.
@@ -1474,17 +1670,29 @@ export async function buildSubsystemGraph(doc, opts = {}) {
1474
1670
  preserveNodePositions: false,
1475
1671
  orderByLine,
1476
1672
  edgeLabels: showEdgeLabels === false ? { enabled: false } : { enabled: true, placement: 'CENTER' },
1477
- groups: layoutGroups.map((g) => ({
1478
- id: g.id,
1479
- memberIds: g.memberAliases,
1480
- parentId: g.parentId,
1481
- // Modules collapse a long path to `first/…/last`, so they only need
1482
- // room for the collapsed badge. Processes/packages never collapse:
1483
- // size the frame to hold the full centered label plus padding.
1484
- minWidth: g.region.kind === 'module' || g.region.kind === 'directory'
1485
- ? moduleMinWidthForBadge(g.region.label)
1486
- : boundaryMinWidthForBadge(g.region.label),
1487
- })),
1673
+ groups: layoutGroups.map((g) => isCardFrame(g.region)
1674
+ ? {
1675
+ id: g.id,
1676
+ memberIds: g.memberAliases,
1677
+ parentId: g.parentId,
1678
+ // A card frame wraps its label to two lines, so it needs no more
1679
+ // width than the container card it is drawn as.
1680
+ minWidth: NODE_W,
1681
+ // Reserve the header rows above the members and the card inset
1682
+ // around them — the same chrome a grown C4 container reserves,
1683
+ // so ELK's fit already clears it.
1684
+ padTop: OPEN_HEADER_PAD,
1685
+ padBottom: OPEN_SIDE_PAD,
1686
+ padX: OPEN_SIDE_PAD,
1687
+ }
1688
+ : {
1689
+ id: g.id,
1690
+ memberIds: g.memberAliases,
1691
+ parentId: g.parentId,
1692
+ // Modules collapse a long path to `first/…/last`, so they only
1693
+ // need room for the collapsed badge.
1694
+ minWidth: moduleMinWidthForBadge(g.region.label),
1695
+ }),
1488
1696
  // Honour `showSingletonFrames`: a one-member process or module is
1489
1697
  // still a real boundary. `buildBoundaryLayoutGroups` already made
1490
1698
  // those regions claim their members, so keeping them here cannot
@@ -1517,9 +1725,10 @@ export async function buildSubsystemGraph(doc, opts = {}) {
1517
1725
  else
1518
1726
  moduleGroupNodes.push(group);
1519
1727
  }
1520
- // Clear leaf parentIds that point at groups ELK dropped.
1728
+ // Clear leaf parentIds that point at groups ELK dropped (components and
1729
+ // collapsed cards alike).
1521
1730
  for (const n of result.nodes) {
1522
- if (n.type !== 'subsystem-component')
1731
+ if (n.type !== 'subsystem-component' && !n.data.collapsed)
1523
1732
  continue;
1524
1733
  const parentId = n.parentId;
1525
1734
  if (parentId && !builtGroupIds.has(parentId)) {