@principal-ai/subsystems-react 0.55.0 → 0.55.2

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 (129) hide show
  1. package/README.md +2 -1
  2. package/dist/graphify/index.d.ts +2 -0
  3. package/dist/graphify/index.d.ts.map +1 -1
  4. package/dist/graphify/index.js +1 -0
  5. package/dist/graphify/index.js.map +1 -1
  6. package/dist/graphify/symbolFocus.d.ts +49 -0
  7. package/dist/graphify/symbolFocus.d.ts.map +1 -0
  8. package/dist/graphify/symbolFocus.js +139 -0
  9. package/dist/graphify/symbolFocus.js.map +1 -0
  10. package/dist/index.d.ts +7 -5
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +3 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/pierre/PierreTrailCodeView.d.ts +1 -1
  15. package/dist/pierre/PierreTrailCodeView.d.ts.map +1 -1
  16. package/dist/stories/Canvases/Aggregate/aggregateViewFixture.d.ts.map +1 -0
  17. package/dist/stories/Canvases/Aggregate/aggregateViewFixture.js.map +1 -0
  18. package/dist/stories/Canvases/Subsystem/fixtures.d.ts.map +1 -0
  19. package/dist/stories/Canvases/Subsystem/fixtures.js.map +1 -0
  20. package/dist/subsystem/ComponentDeclaration.d.ts +1 -1
  21. package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -1
  22. package/dist/subsystem/ComponentDeclaration.js +1 -1
  23. package/dist/subsystem/ComponentDeclaration.js.map +1 -1
  24. package/dist/subsystem/ConstructsCatalog.d.ts +1 -1
  25. package/dist/subsystem/ConstructsCatalog.d.ts.map +1 -1
  26. package/dist/subsystem/SubsystemComponentGraph.d.ts +36 -2
  27. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  28. package/dist/subsystem/SubsystemComponentGraph.js +250 -35
  29. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  30. package/dist/subsystem/SymbolFocusedView.d.ts +30 -0
  31. package/dist/subsystem/SymbolFocusedView.d.ts.map +1 -0
  32. package/dist/subsystem/SymbolFocusedView.js +24 -0
  33. package/dist/subsystem/SymbolFocusedView.js.map +1 -0
  34. package/dist/subsystem/SymbolInspectionCard.d.ts +1 -1
  35. package/dist/subsystem/SymbolInspectionCard.d.ts.map +1 -1
  36. package/dist/subsystem/SymbolInspectionCard.js +1 -1
  37. package/dist/subsystem/SymbolInspectionCard.js.map +1 -1
  38. package/dist/subsystem/TrailsPanel.d.ts +16 -1
  39. package/dist/subsystem/TrailsPanel.d.ts.map +1 -1
  40. package/dist/subsystem/TrailsPanel.js +71 -9
  41. package/dist/subsystem/TrailsPanel.js.map +1 -1
  42. package/dist/subsystem/graphChrome.d.ts +13 -0
  43. package/dist/subsystem/graphChrome.d.ts.map +1 -1
  44. package/dist/subsystem/graphChrome.js +19 -1
  45. package/dist/subsystem/graphChrome.js.map +1 -1
  46. package/dist/subsystem/model.d.ts +40 -4
  47. package/dist/subsystem/model.d.ts.map +1 -1
  48. package/dist/subsystem/model.js +38 -7
  49. package/dist/subsystem/model.js.map +1 -1
  50. package/dist/subsystem/{declarationRef.d.ts → sourceSpan.d.ts} +1 -1
  51. package/dist/subsystem/sourceSpan.d.ts.map +1 -0
  52. package/dist/subsystem/{declarationRef.js → sourceSpan.js} +1 -1
  53. package/dist/subsystem/sourceSpan.js.map +1 -0
  54. package/package.json +2 -2
  55. package/src/graphify/index.ts +6 -0
  56. package/src/graphify/symbolFocus.test.ts +163 -0
  57. package/src/graphify/symbolFocus.ts +190 -0
  58. package/src/index.ts +9 -2
  59. package/src/pierre/PierreTrailCodeView.tsx +1 -1
  60. package/src/stories/{Subsystem/AggregateGraph → Canvases/Aggregate}/AggregateFrameGraph.stories.tsx +1 -1
  61. package/src/stories/{Subsystem/C4Graph → Canvases/C4}/C4CardGrow.stories.tsx +1 -1
  62. package/src/stories/{Subsystem/C4Graph → Canvases/C4}/C4Component.stories.tsx +1 -1
  63. package/src/stories/{Subsystem/C4Graph → Canvases/C4}/C4Container.stories.tsx +1 -1
  64. package/src/stories/{Subsystem/C4Graph → Canvases/C4}/C4NodeGallery.stories.tsx +1 -1
  65. package/src/stories/{Subsystem/C4Graph → Canvases/C4}/C4ToComponentDrill.stories.tsx +1 -1
  66. package/src/stories/{Subsystem/C4Graph → Canvases/C4}/C4Transition.stories.tsx +1 -1
  67. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/AnimatedProgression.stories.tsx +1 -1
  68. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Appearance.stories.tsx +1 -1
  69. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Basics.stories.tsx +1 -1
  70. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Captures.stories.tsx +1 -1
  71. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Constructs.stories.tsx +2 -2
  72. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/CustomEntities.stories.tsx +1 -1
  73. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Deprecated.stories.tsx +1 -1
  74. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/DetailPanel.stories.tsx +2 -2
  75. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Diagnostics.stories.tsx +1 -1
  76. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/EdgeViews.stories.tsx +1 -1
  77. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/FrameworkStereotype.stories.tsx +1 -1
  78. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/GraphTitle.stories.tsx +1 -1
  79. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Issues.stories.tsx +1 -1
  80. package/src/stories/Canvases/Subsystem/LayoutDirection.stories.tsx +122 -0
  81. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/ModuleBadges.stories.tsx +1 -1
  82. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/ModulePathNesting.stories.tsx +1 -1
  83. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Modules.stories.tsx +1 -1
  84. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/NodeAnatomy.stories.tsx +1 -1
  85. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Packages.stories.tsx +1 -1
  86. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Processes.stories.tsx +1 -1
  87. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Proposed.stories.tsx +1 -1
  88. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/ProposedTrails.stories.tsx +1 -1
  89. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Reorder.stories.tsx +1 -1
  90. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Scenarios.stories.tsx +1 -1
  91. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Spotlights.stories.tsx +1 -1
  92. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/StoreValueType.stories.tsx +1 -1
  93. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/TrailAutoplay.stories.tsx +1 -1
  94. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/Trails.stories.tsx +78 -2
  95. package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/WorkspacePackageFrames.stories.tsx +1 -1
  96. package/src/stories/Canvases/SymbolFocusedView/SymbolFocusedView.stories.tsx +163 -0
  97. package/src/stories/{Subsystem → Components}/AgentsPanel.stories.tsx +1 -1
  98. package/src/stories/{Subsystem/ComponentDeclarationAudit.stories.tsx → Components/ComponentDeclaration/Audit.stories.tsx} +4 -4
  99. package/src/stories/{Subsystem/ComponentDeclarationSymbols.stories.tsx → Components/ComponentDeclaration/Symbols.stories.tsx} +5 -5
  100. package/src/stories/{Subsystem → Components}/ConstructsCatalog.stories.tsx +2 -2
  101. package/src/stories/{Subsystem/Sidebar → Components}/GraphSidebar.stories.tsx +4 -4
  102. package/src/stories/{Subsystem/IssueIcons.stories.tsx → Components/IssueList.stories.tsx} +1 -1
  103. package/src/stories/{Subsystem/StoreValueTypeDeclaration.stories.tsx → Components/StoreValueType.stories.tsx} +1 -1
  104. package/src/subsystem/ComponentDeclaration.tsx +2 -2
  105. package/src/subsystem/ConstructsCatalog.tsx +1 -1
  106. package/src/subsystem/SubsystemComponentGraph.tsx +334 -28
  107. package/src/subsystem/SymbolFocusedView.tsx +80 -0
  108. package/src/subsystem/SymbolInspectionCard.tsx +2 -2
  109. package/src/subsystem/TrailsPanel.tsx +114 -5
  110. package/src/subsystem/graphChrome.tsx +22 -1
  111. package/src/subsystem/layoutDirection.test.ts +26 -0
  112. package/src/subsystem/model.test.ts +17 -0
  113. package/src/subsystem/model.ts +70 -10
  114. package/src/subsystem/{declarationRef.test.ts → sourceSpan.test.ts} +1 -1
  115. package/dist/stories/Subsystem/AggregateGraph/aggregateViewFixture.d.ts.map +0 -1
  116. package/dist/stories/Subsystem/AggregateGraph/aggregateViewFixture.js.map +0 -1
  117. package/dist/stories/Subsystem/ComponentGraph/fixtures.d.ts.map +0 -1
  118. package/dist/stories/Subsystem/ComponentGraph/fixtures.js.map +0 -1
  119. package/dist/subsystem/declarationRef.d.ts.map +0 -1
  120. package/dist/subsystem/declarationRef.js.map +0 -1
  121. package/src/stories/Subsystem/EgoGraph/EgoGraph.stories.tsx +0 -351
  122. /package/dist/stories/{Subsystem/AggregateGraph → Canvases/Aggregate}/aggregateViewFixture.d.ts +0 -0
  123. /package/dist/stories/{Subsystem/AggregateGraph → Canvases/Aggregate}/aggregateViewFixture.js +0 -0
  124. /package/dist/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/fixtures.d.ts +0 -0
  125. /package/dist/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/fixtures.js +0 -0
  126. /package/src/graphify/__fixtures__/{ego-samples.json → symbol-focused-samples.json} +0 -0
  127. /package/src/stories/{Subsystem/AggregateGraph → Canvases/Aggregate}/aggregateViewFixture.ts +0 -0
  128. /package/src/stories/{Subsystem/ComponentGraph → Canvases/Subsystem}/fixtures.ts +0 -0
  129. /package/src/subsystem/{declarationRef.ts → sourceSpan.ts} +0 -0
package/src/index.ts CHANGED
@@ -74,6 +74,7 @@ export {
74
74
  extractNamedTypes,
75
75
  extractGraphifySignature,
76
76
  compareSignatures,
77
+ toSymbolFocusedView,
77
78
  } from './graphify';
78
79
  export type {
79
80
  ComponentAnchorInput,
@@ -83,6 +84,9 @@ export type {
83
84
  GraphifyInferredSignature,
84
85
  ClaimedSignature,
85
86
  SignatureCompareResult,
87
+ SymbolFocusedViewInput,
88
+ SymbolFocusedViewOptions,
89
+ SymbolFocusedViewGraph,
86
90
  } from './graphify';
87
91
 
88
92
  // ELK layout utilities
@@ -101,6 +105,8 @@ export type { UseElkLayoutOptions, UseElkLayoutResult } from './hooks/useElkLayo
101
105
  // Subsystem component graph
102
106
  export { SubsystemComponentGraph } from './subsystem/SubsystemComponentGraph';
103
107
  export type { SubsystemComponentGraphProps, TrailViewerContext } from './subsystem/SubsystemComponentGraph';
108
+ export { SymbolFocusedView } from './subsystem/SymbolFocusedView';
109
+ export type { SymbolFocusedViewProps } from './subsystem/SymbolFocusedView';
104
110
  export { SubsystemModelTransition } from './subsystem/SubsystemModelTransition';
105
111
  export type {
106
112
  SubsystemModelTransitionProps,
@@ -235,6 +241,7 @@ export type {
235
241
  SubsystemEdgeMechanism,
236
242
  SubsystemEdgeView,
237
243
  SubsystemEdgeProvenance,
244
+ SubsystemLayoutDirection,
238
245
  SubsystemGraphifyRelation,
239
246
  SubsystemConstructDeclaration,
240
247
  SubsystemDeclarationProvenance,
@@ -314,13 +321,13 @@ export type {
314
321
  SubsystemSourceSpan,
315
322
  SubsystemOpenFileOptions,
316
323
  SpanFreshness,
317
- } from './subsystem/declarationRef';
324
+ } from './subsystem/sourceSpan';
318
325
  export {
319
326
  parseSourceLocation,
320
327
  normalizeDeclarationLine,
321
328
  extractDeclarationLine,
322
329
  DECLARATION_HASH_ALGO,
323
- } from './subsystem/declarationRef';
330
+ } from './subsystem/sourceSpan';
324
331
  export {
325
332
  setPrettierProvider,
326
333
  getPrettierProvider,
@@ -38,7 +38,7 @@ import type {
38
38
  SubsystemTrail,
39
39
  SubsystemTrailStep,
40
40
  } from '../subsystem/model';
41
- import type { SubsystemOpenFileOptions } from '../subsystem/declarationRef';
41
+ import type { SubsystemOpenFileOptions } from '../subsystem/sourceSpan';
42
42
  import { buildPierreOptions, PIERRE_FILE_STYLE } from './pierreBackground';
43
43
  import { pierreLangForPath } from './pierreFileLang';
44
44
  import { resolvePierreSyntaxThemeName } from './pierreSyntaxTheme';
@@ -10,7 +10,7 @@ import {
10
10
  } from './aggregateViewFixture';
11
11
 
12
12
  const meta = {
13
- title: 'Subsystem/AggregateGraph/AggregateFrameGraph',
13
+ title: 'Canvases/Aggregate/AggregateFrameGraph',
14
14
  component: SubsystemAggregateGraph,
15
15
  parameters: {
16
16
  layout: 'fullscreen',
@@ -5,7 +5,7 @@ import { C4NodeCard, NODE_W, NODE_H } from '../../../subsystem/C4NodeCard';
5
5
  import type { C4Container, C4Component } from '../../../subsystem/c4';
6
6
 
7
7
  const meta = {
8
- title: 'Subsystem/C4Graph/C4CardGrow',
8
+ title: 'Canvases/C4/C4CardGrow',
9
9
  parameters: { layout: 'fullscreen' },
10
10
  tags: ['autodocs'],
11
11
  decorators: [
@@ -6,7 +6,7 @@ import { C4Graph } from '../../../subsystem/C4Graph';
6
6
  import type { C4Edge, C4Model, C4Element, C4Component, C4Container } from '../../../subsystem/c4';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/C4Graph/C4Component',
9
+ title: 'Canvases/C4/C4Component',
10
10
  component: C4Graph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],
@@ -6,7 +6,7 @@ import { C4Graph } from '../../../subsystem/C4Graph';
6
6
  import type { C4Edge, C4Model, C4Element, C4Container } from '../../../subsystem/c4';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/C4Graph/C4Container',
9
+ title: 'Canvases/C4/C4Container',
10
10
  component: C4Graph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],
@@ -31,7 +31,7 @@ import type { C4Element } from '../../../subsystem/c4';
31
31
  // ---------------------------------------------------------------------------
32
32
 
33
33
  const meta = {
34
- title: 'Subsystem/C4Graph/C4NodeGallery',
34
+ title: 'Canvases/C4/C4NodeGallery',
35
35
  parameters: { layout: 'fullscreen' },
36
36
  tags: ['autodocs'],
37
37
  decorators: [
@@ -68,7 +68,7 @@ const MODEL_DESCRIPTION =
68
68
  */
69
69
 
70
70
  const meta = {
71
- title: 'Subsystem/C4Graph/C4ToComponentDrill',
71
+ title: 'Canvases/C4/C4ToComponentDrill',
72
72
  component: C4Graph,
73
73
  parameters: { layout: 'fullscreen' },
74
74
  tags: ['autodocs'],
@@ -6,7 +6,7 @@ import { C4Graph } from '../../../subsystem/C4Graph';
6
6
  import type { C4Edge, C4Model, C4Element, C4Component, C4Container } from '../../../subsystem/c4';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/C4Graph/C4Transition',
9
+ title: 'Canvases/C4/C4Transition',
10
10
  component: C4Graph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],
@@ -14,7 +14,7 @@ import type { SubsystemComponent, SubsystemTrail } from '../../../subsystem/mode
14
14
  */
15
15
 
16
16
  const meta = {
17
- title: 'Subsystem/ComponentGraph/Animated progression',
17
+ title: 'Canvases/Subsystem/Animated progression',
18
18
  component: SubsystemComponentGraph,
19
19
  parameters: { layout: 'fullscreen' },
20
20
  } satisfies Meta<typeof SubsystemComponentGraph>;
@@ -8,7 +8,7 @@ import type { GraphifyComponentDetail } from '../../../graphify';
8
8
  import { investigateOnlyComponents, investigateOnlyTrails } from './fixtures';
9
9
 
10
10
  const meta = {
11
- title: 'Subsystem/ComponentGraph/Appearance',
11
+ title: 'Canvases/Subsystem/Appearance',
12
12
  component: SubsystemComponentGraph,
13
13
  parameters: {
14
14
  layout: 'fullscreen',
@@ -7,7 +7,7 @@ import type { SubsystemComponent, SubsystemComponentEdge } from '../../../subsys
7
7
  import { components, graphSpecFromSteps } from './fixtures';
8
8
 
9
9
  const meta = {
10
- title: 'Subsystem/ComponentGraph/Basics',
10
+ title: 'Canvases/Subsystem/Basics',
11
11
  component: SubsystemComponentGraph,
12
12
  parameters: {
13
13
  layout: 'fullscreen',
@@ -8,7 +8,7 @@ import type { GraphifyComponentDetail } from '../../../graphify';
8
8
  import { components, graphSpecFromSteps, readerDetail, investigateOnlyComponents, investigateOnlyTrails } from './fixtures';
9
9
 
10
10
  const meta = {
11
- title: 'Subsystem/ComponentGraph/Captures',
11
+ title: 'Canvases/Subsystem/Captures',
12
12
  component: SubsystemComponentGraph,
13
13
  parameters: {
14
14
  layout: 'fullscreen',
@@ -5,11 +5,11 @@ import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme
5
5
  import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
6
6
  import { PierreFileView, PierreSnippetView } from '../../../pierre';
7
7
  import type { SubsystemComponent } from '../../../subsystem/model';
8
- import type { SubsystemOpenFileOptions } from '../../../subsystem/declarationRef';
8
+ import type { SubsystemOpenFileOptions } from '../../../subsystem/sourceSpan';
9
9
  import type { GraphifyComponentDetail } from '../../../graphify';
10
10
 
11
11
  const meta = {
12
- title: 'Subsystem/ComponentGraph/Constructs',
12
+ title: 'Canvases/Subsystem/Constructs',
13
13
  component: SubsystemComponentGraph,
14
14
  parameters: {
15
15
  layout: 'fullscreen',
@@ -155,7 +155,7 @@ const entityGraph = graphSpecFromSteps([
155
155
  ]);
156
156
 
157
157
  const meta = {
158
- title: 'Subsystem/ComponentGraph/CustomEntities',
158
+ title: 'Canvases/Subsystem/CustomEntities',
159
159
  component: SubsystemComponentGraph,
160
160
  parameters: { layout: 'fullscreen' },
161
161
  tags: ['autodocs'],
@@ -17,7 +17,7 @@ import { trailFromSteps } from './fixtures';
17
17
  * as siblings — proposed = not built yet, deprecated = built once, removed since.
18
18
  */
19
19
  const meta = {
20
- title: 'Subsystem/ComponentGraph/Deprecated',
20
+ title: 'Canvases/Subsystem/Deprecated',
21
21
  parameters: { layout: 'fullscreen' },
22
22
  tags: ['autodocs'],
23
23
  decorators: [
@@ -5,14 +5,14 @@ import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme
5
5
  import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
6
6
  import { PierreFileView, PierreSnippetView } from '../../../pierre';
7
7
  import type { SubsystemComponent, SubsystemComponentEdge } from '../../../subsystem/model';
8
- import type { SubsystemOpenFileOptions } from '../../../subsystem/declarationRef';
8
+ import type { SubsystemOpenFileOptions } from '../../../subsystem/sourceSpan';
9
9
  import type { GraphifyComponentDetail } from '../../../graphify';
10
10
  import componentDeclarationSource from '../../../subsystem/ComponentDeclaration.tsx?raw';
11
11
  import resolveSource from '../../../graphify/resolve.ts?raw';
12
12
  import { readerDetail } from './fixtures';
13
13
 
14
14
  const meta = {
15
- title: 'Subsystem/ComponentGraph/DetailPanel',
15
+ title: 'Canvases/Subsystem/DetailPanel',
16
16
  component: SubsystemComponentGraph,
17
17
  parameters: {
18
18
  layout: 'fullscreen',
@@ -10,7 +10,7 @@ import {
10
10
  import { components, graphSpecFromSteps } from './fixtures';
11
11
 
12
12
  const meta = {
13
- title: 'Subsystem/ComponentGraph/Diagnostics',
13
+ title: 'Canvases/Subsystem/Diagnostics',
14
14
  component: SubsystemComponentGraph,
15
15
  parameters: {
16
16
  layout: 'fullscreen',
@@ -7,7 +7,7 @@ import type { SubsystemEdgeView, SubsystemGraphifyRelation } from '../../../subs
7
7
  import { components, trailFromSteps } from './fixtures';
8
8
 
9
9
  const meta = {
10
- title: 'Subsystem/ComponentGraph/EdgeViews',
10
+ title: 'Canvases/Subsystem/EdgeViews',
11
11
  component: SubsystemComponentGraph,
12
12
  parameters: {
13
13
  layout: 'fullscreen',
@@ -6,7 +6,7 @@ import type { SubsystemComponent } from '../../../subsystem/model';
6
6
  import { trailFromSteps } from './fixtures';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/ComponentGraph/FrameworkStereotype',
9
+ title: 'Canvases/Subsystem/FrameworkStereotype',
10
10
  component: SubsystemComponentGraph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],
@@ -6,7 +6,7 @@ import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGr
6
6
  import { components, graphSpecFromSteps } from './fixtures';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/ComponentGraph/GraphTitle',
9
+ title: 'Canvases/Subsystem/GraphTitle',
10
10
  component: SubsystemComponentGraph,
11
11
  parameters: {
12
12
  layout: 'fullscreen',
@@ -10,7 +10,7 @@ import type { C4Container } from '../../../subsystem/c4';
10
10
  import { components, graphSpecFromSteps } from './fixtures';
11
11
 
12
12
  const meta = {
13
- title: 'Subsystem/ComponentGraph/Issues',
13
+ title: 'Canvases/Subsystem/Issues',
14
14
  component: SubsystemComponentGraph,
15
15
  parameters: {
16
16
  layout: 'fullscreen',
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Layout direction — the canvas toggle flips the layered layout between
3
+ * left-to-right and top-to-bottom.
4
+ *
5
+ * The flip is sequenced: edges fade out, ELK re-lays out while the nodes slide
6
+ * to their new slots, then the edges fade back in. Old routes never cut across
7
+ * the new layout mid-flight. The camera refits when the new layout lands
8
+ * (`refocusOnLayoutFlip`, on by default) — a vertical graph grows
9
+ * downward and would otherwise leave most of itself off-screen.
10
+ */
11
+ import React, { useState } from 'react';
12
+ import '@xyflow/react/dist/style.css';
13
+ import type { Meta, StoryObj } from '@storybook/react';
14
+ import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
15
+ import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
16
+ import type { SubsystemLayoutDirection } from '../../../subsystem/model';
17
+ import { components, graphSpecFromSteps } from './fixtures';
18
+
19
+ const meta = {
20
+ title: 'Canvases/Subsystem/LayoutDirection',
21
+ component: SubsystemComponentGraph,
22
+ parameters: { layout: 'fullscreen' },
23
+ tags: ['autodocs'],
24
+ decorators: [
25
+ (Story) => (
26
+ <ThemeProvider theme={defaultEditorTheme}>
27
+ <Story />
28
+ </ThemeProvider>
29
+ ),
30
+ ],
31
+ } satisfies Meta<typeof SubsystemComponentGraph>;
32
+
33
+ export default meta;
34
+ type Story = StoryObj<typeof meta>;
35
+
36
+ // A graph with enough layers to make the axis obvious: two producers fan into
37
+ // a service, which writes to a store and produces an event.
38
+ const layoutComponents = components([
39
+ ['api', 'ApiHandler', 'function', 'src/api/handler.ts', 'pkg:github/principal-ai/agent-monitoring', 'HTTP entry point', 'handleRequest'],
40
+ ['cli', 'CliHandler', 'function', 'src/cli/handler.ts', 'pkg:github/principal-ai/agent-monitoring', 'command entry point', 'handleCommand'],
41
+ ['svc', 'SessionService', 'class', 'src/session/SessionService.ts', 'pkg:github/principal-ai/agent-monitoring', 'owns session persistence', 'SessionService'],
42
+ ['store', 'SessionStore', 'class', 'src/session/SessionStore.ts', 'pkg:github/principal-ai/agent-monitoring', 'retained session state', 'SessionStore'],
43
+ ['event', 'SessionEvent', 'interface', 'src/types/SessionEvent.ts', 'pkg:github/principal-ai/agent-monitoring', 'output event shape', 'SessionEvent'],
44
+ ]);
45
+
46
+ const layoutSpec = graphSpecFromSteps([
47
+ ['api', 'svc', 'calls', 'src/api/handler.ts', 42],
48
+ ['cli', 'svc', 'calls', 'src/cli/handler.ts', 18],
49
+ ['svc', 'store', 'writes', 'src/session/SessionService.ts', 88],
50
+ ['svc', 'event', 'produces', 'src/session/SessionService.ts', 95],
51
+ ]);
52
+
53
+ function DirectionDemo({ initial }: { initial: SubsystemLayoutDirection }) {
54
+ return (
55
+ <div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
56
+ <SubsystemComponentGraph
57
+ components={layoutComponents}
58
+ trails={layoutSpec.trails}
59
+ defaultLayoutDirection={initial}
60
+ showEdgeLabels
61
+ />
62
+ </div>
63
+ );
64
+ }
65
+
66
+ /** Left-to-right (the default). Click the corner toggle to watch the flip. */
67
+ export const Horizontal: Story = {
68
+ render: () => <DirectionDemo initial="horizontal" />,
69
+ };
70
+
71
+ /** Seeded top-to-bottom. The toggle restores the remembered choice per `persistKey`. */
72
+ export const Vertical: Story = {
73
+ render: () => <DirectionDemo initial="vertical" />,
74
+ };
75
+
76
+ /**
77
+ * Host-controlled: the graph renders no built-in toggle; the host owns the
78
+ * value and echoes it back through `onLayoutDirectionChange`.
79
+ */
80
+ function ControlledDemo() {
81
+ const [direction, setDirection] = useState<SubsystemLayoutDirection>('horizontal');
82
+ return (
83
+ <div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
84
+ <div style={{ display: 'flex', gap: 8, padding: 8, background: defaultEditorTheme.colors.background }}>
85
+ {(['horizontal', 'vertical'] as const).map((d) => (
86
+ <button
87
+ key={d}
88
+ type="button"
89
+ onClick={() => setDirection(d)}
90
+ aria-pressed={direction === d}
91
+ style={{
92
+ padding: '4px 10px',
93
+ borderRadius: 6,
94
+ border: `1px solid ${defaultEditorTheme.colors.border}`,
95
+ background: direction === d ? defaultEditorTheme.colors.border : 'transparent',
96
+ color: defaultEditorTheme.colors.text,
97
+ fontFamily: defaultEditorTheme.fonts.monospace,
98
+ fontSize: 12,
99
+ cursor: 'pointer',
100
+ }}
101
+ >
102
+ {d}
103
+ </button>
104
+ ))}
105
+ </div>
106
+ <div style={{ flex: 1, minHeight: 0 }}>
107
+ <SubsystemComponentGraph
108
+ components={layoutComponents}
109
+ trails={layoutSpec.trails}
110
+ layoutDirection={direction}
111
+ onLayoutDirectionChange={setDirection}
112
+ hideLayoutToggle
113
+ showEdgeLabels
114
+ />
115
+ </div>
116
+ </div>
117
+ );
118
+ }
119
+
120
+ export const ControlledByHost: Story = {
121
+ render: () => <ControlledDemo />,
122
+ };
@@ -12,7 +12,7 @@ import type {
12
12
  import { graphSpecFromSteps } from './fixtures';
13
13
 
14
14
  const meta = {
15
- title: 'Subsystem/ComponentGraph/ModuleBadges',
15
+ title: 'Canvases/Subsystem/ModuleBadges',
16
16
  parameters: { layout: 'fullscreen' },
17
17
  tags: ['autodocs'],
18
18
  decorators: [
@@ -15,7 +15,7 @@ import type { SubsystemComponent } from '../../../subsystem/model';
15
15
  */
16
16
 
17
17
  const meta = {
18
- title: 'Subsystem/ComponentGraph/Module path nesting',
18
+ title: 'Canvases/Subsystem/Module path nesting',
19
19
  component: SubsystemComponentGraph,
20
20
  parameters: { layout: 'fullscreen' },
21
21
  tags: ['autodocs'],
@@ -6,7 +6,7 @@ import type { SubsystemComponent } from '../../../subsystem/model';
6
6
  import { graphSpecFromSteps } from './fixtures';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/ComponentGraph/Modules',
9
+ title: 'Canvases/Subsystem/Modules',
10
10
  component: SubsystemComponentGraph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],
@@ -24,7 +24,7 @@ import type {
24
24
  * still proposals.
25
25
  */
26
26
  const meta = {
27
- title: 'Subsystem/ComponentGraph/NodeAnatomy',
27
+ title: 'Canvases/Subsystem/NodeAnatomy',
28
28
  parameters: { layout: 'fullscreen' },
29
29
  tags: ['autodocs'],
30
30
  decorators: [
@@ -6,7 +6,7 @@ import type { SubsystemComponent } from '../../../subsystem/model';
6
6
  import { graphSpecFromSteps } from './fixtures';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/ComponentGraph/Packages',
9
+ title: 'Canvases/Subsystem/Packages',
10
10
  component: SubsystemComponentGraph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],
@@ -5,7 +5,7 @@ import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGr
5
5
  import { components, graphSpecFromSteps } from './fixtures';
6
6
 
7
7
  const meta = {
8
- title: 'Subsystem/ComponentGraph/Processes',
8
+ title: 'Canvases/Subsystem/Processes',
9
9
  component: SubsystemComponentGraph,
10
10
  parameters: { layout: 'fullscreen' },
11
11
  tags: ['autodocs'],
@@ -12,7 +12,7 @@ import type {
12
12
  import { trailFromSteps } from './fixtures';
13
13
 
14
14
  const meta = {
15
- title: 'Subsystem/ComponentGraph/Proposed',
15
+ title: 'Canvases/Subsystem/Proposed',
16
16
  parameters: { layout: 'fullscreen' },
17
17
  tags: ['autodocs'],
18
18
  decorators: [
@@ -6,7 +6,7 @@ import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGr
6
6
  import type { SubsystemComponent, SubsystemTrail } from '../../../subsystem/model';
7
7
 
8
8
  const meta = {
9
- title: 'Subsystem/ComponentGraph/ProposedTrails',
9
+ title: 'Canvases/Subsystem/ProposedTrails',
10
10
  component: SubsystemComponentGraph,
11
11
  parameters: {
12
12
  layout: 'fullscreen',
@@ -7,7 +7,7 @@ import { TrailsPanel } from '../../../subsystem/TrailsPanel';
7
7
  import type { SubsystemComponent, SubsystemTrail } from '../../../subsystem/model';
8
8
 
9
9
  const meta = {
10
- title: 'Subsystem/ComponentGraph/Reorder',
10
+ title: 'Canvases/Subsystem/Reorder',
11
11
  component: SubsystemComponentGraph,
12
12
  parameters: {
13
13
  layout: 'fullscreen',
@@ -12,7 +12,7 @@ import type { GraphifyComponentDetail } from '../../../graphify';
12
12
  import { components, graphSpecFromSteps } from './fixtures';
13
13
 
14
14
  const meta = {
15
- title: 'Subsystem/ComponentGraph/Scenarios',
15
+ title: 'Canvases/Subsystem/Scenarios',
16
16
  component: SubsystemComponentGraph,
17
17
  parameters: {
18
18
  layout: 'fullscreen',
@@ -17,7 +17,7 @@ import { resolvePierreSyntaxThemeName } from '../../../pierre/pierreSyntaxTheme'
17
17
  import { useTheme } from '@principal-ade/industry-theme';
18
18
 
19
19
  const meta = {
20
- title: 'Subsystem/ComponentGraph/Spotlights',
20
+ title: 'Canvases/Subsystem/Spotlights',
21
21
  parameters: { layout: 'fullscreen' },
22
22
  tags: ['autodocs'],
23
23
  decorators: [
@@ -23,7 +23,7 @@ import type { SubsystemComponent, SubsystemGraphNode } from '../../../subsystem/
23
23
  * accessor shows the accessor's name instead of the state's.
24
24
  */
25
25
  const meta = {
26
- title: 'Subsystem/ComponentGraph/StoreValueType',
26
+ title: 'Canvases/Subsystem/StoreValueType',
27
27
  parameters: { layout: 'fullscreen' },
28
28
  tags: ['autodocs'],
29
29
  decorators: [
@@ -16,7 +16,7 @@ import type { SubsystemComponent, SubsystemTrail } from '../../../subsystem/mode
16
16
  * camera today. This story exists to expose that gap and iterate on it.
17
17
  */
18
18
  const meta = {
19
- title: 'Subsystem/ComponentGraph/TrailAutoplay',
19
+ title: 'Canvases/Subsystem/TrailAutoplay',
20
20
  component: SubsystemComponentGraph,
21
21
  parameters: { layout: 'fullscreen' },
22
22
  tags: ['autodocs'],
@@ -8,7 +8,7 @@ import { PierreTrailCodeView } from '../../../pierre';
8
8
  import type { TrailViewerContext } from '../../../subsystem/SubsystemComponentGraph';
9
9
 
10
10
  const meta = {
11
- title: 'Subsystem/ComponentGraph/Trails',
11
+ title: 'Canvases/Subsystem/Trails',
12
12
  component: SubsystemComponentGraph,
13
13
  parameters: {
14
14
  layout: 'fullscreen',
@@ -272,6 +272,82 @@ const proposedTrails: SubsystemTrail[] = [
272
272
  },
273
273
  ],
274
274
  },
275
+ // Neighbours for the wrapped title above: a couple of one-line titles and
276
+ // one that wraps to two, so the header's padding reads against the rows on
277
+ // either side of it rather than in isolation.
278
+ {
279
+ id: 'tl-open-drawing',
280
+ title: 'Open drawing',
281
+ steps: [
282
+ {
283
+ from: 'panel',
284
+ to: 'host',
285
+ mechanism: 'produces',
286
+ file: 'src/panels/DrawingsLeftPanel.tsx',
287
+ span: { startLine: 85, endLine: 85, contentHash: 'fixture' },
288
+ purl: stepPurl('src/panels/DrawingsLeftPanel.tsx'),
289
+ symbol: 'DrawingsLeftPanel.openDrawing',
290
+ annotation: 'Emits the open intent up to the host.',
291
+ },
292
+ {
293
+ from: 'host',
294
+ to: 'storage',
295
+ mechanism: 'calls',
296
+ file: 'src/hooks/useDrawingsHost.ts',
297
+ span: { startLine: 45, endLine: 45, contentHash: 'fixture' },
298
+ purl: stepPurl('src/hooks/useDrawingsHost.ts'),
299
+ symbol: 'useDrawingsHost.openDrawing',
300
+ },
301
+ ],
302
+ },
303
+ {
304
+ id: 'tl-save-drawing',
305
+ title: 'Save the drawing and refresh the list',
306
+ steps: [
307
+ {
308
+ from: 'tab',
309
+ to: 'fs',
310
+ mechanism: 'calls',
311
+ file: 'src/components/DrawingTabContent.tsx',
312
+ span: { startLine: 112, endLine: 112, contentHash: 'fixture' },
313
+ purl: stepPurl('src/components/DrawingTabContent.tsx'),
314
+ symbol: 'DrawingTabContent.save',
315
+ },
316
+ {
317
+ from: 'host',
318
+ to: 'panel',
319
+ mechanism: 'produces',
320
+ file: 'src/hooks/useDrawingsHost.ts',
321
+ span: { startLine: 64, endLine: 64, contentHash: 'fixture' },
322
+ purl: stepPurl('src/hooks/useDrawingsHost.ts'),
323
+ symbol: 'useDrawingsHost.onSaved',
324
+ },
325
+ ],
326
+ },
327
+ {
328
+ id: 'tl-delete-drawing',
329
+ title: 'Delete drawing',
330
+ steps: [
331
+ {
332
+ from: 'host',
333
+ to: 'fs',
334
+ mechanism: 'calls',
335
+ file: 'src/hooks/useDrawingsHost.ts',
336
+ span: { startLine: 66, endLine: 66, contentHash: 'fixture' },
337
+ purl: stepPurl('src/hooks/useDrawingsHost.ts'),
338
+ symbol: 'useDrawingsHost.deleteDrawing',
339
+ },
340
+ {
341
+ from: 'panel',
342
+ to: 'storage',
343
+ mechanism: 'calls',
344
+ file: 'src/panels/DrawingsLeftPanel.tsx',
345
+ span: { startLine: 56, endLine: 56, contentHash: 'fixture' },
346
+ purl: stepPurl('src/panels/DrawingsLeftPanel.tsx'),
347
+ symbol: 'DrawingsLeftPanel.scan',
348
+ },
349
+ ],
350
+ },
275
351
  ];
276
352
 
277
353
  function ProposedMissingStepDemo() {
@@ -306,7 +382,7 @@ function ProposedMissingStepDemo() {
306
382
  components={proposedComponents}
307
383
  trails={proposedTrails}
308
384
  title="proposed seam with a missing file"
309
- description="Expand **Associate a finished run with its model** and click either step. The proposed step has no file in the checkout, so its snippet shows an inline *Proposed — … isn't in the local checkout yet.* placeholder instead of failing the whole flow."
385
+ description="The **Trails** panel lists four flows so the long, wrapped title (*Associate a finished run with its model (proposed)*) reads against its neighbours — two one-line titles and one (*Save the drawing and refresh the list*) that also wraps. Expand **Associate a finished run with its model** and click either step: the proposed step has no file in the checkout, so its snippet shows an inline *Proposed — … isn't in the local checkout yet.* placeholder instead of failing the whole flow."
310
386
  renderTrailViewer={renderTrailViewer}
311
387
  renderFileViewer={(file) => (
312
388
  <div