@principal-ai/subsystems-react 0.56.24 → 0.56.25

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 (125) hide show
  1. package/dist/index.d.ts +7 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +4 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/stories/Canvases/Subsystem/issuesFixtures.d.ts +4 -0
  6. package/dist/stories/Canvases/Subsystem/issuesFixtures.d.ts.map +1 -0
  7. package/dist/stories/Canvases/Subsystem/issuesFixtures.js +189 -0
  8. package/dist/stories/Canvases/Subsystem/issuesFixtures.js.map +1 -0
  9. package/dist/stories/Canvases/Subsystem/reorderFixtures.d.ts +8 -0
  10. package/dist/stories/Canvases/Subsystem/reorderFixtures.d.ts.map +1 -0
  11. package/dist/stories/Canvases/Subsystem/reorderFixtures.js +103 -0
  12. package/dist/stories/Canvases/Subsystem/reorderFixtures.js.map +1 -0
  13. package/dist/subsystem/C4ContainersPanel.d.ts +35 -0
  14. package/dist/subsystem/C4ContainersPanel.d.ts.map +1 -0
  15. package/dist/subsystem/C4ContainersPanel.js +165 -0
  16. package/dist/subsystem/C4ContainersPanel.js.map +1 -0
  17. package/dist/subsystem/C4NodeCard.d.ts.map +1 -1
  18. package/dist/subsystem/C4NodeCard.js +10 -4
  19. package/dist/subsystem/C4NodeCard.js.map +1 -1
  20. package/dist/subsystem/C4ProjectionView.d.ts.map +1 -1
  21. package/dist/subsystem/C4ProjectionView.js +81 -27
  22. package/dist/subsystem/C4ProjectionView.js.map +1 -1
  23. package/dist/subsystem/C4SketchView.d.ts.map +1 -1
  24. package/dist/subsystem/C4SketchView.js +53 -34
  25. package/dist/subsystem/C4SketchView.js.map +1 -1
  26. package/dist/subsystem/DescriptionOverlay.d.ts +10 -2
  27. package/dist/subsystem/DescriptionOverlay.d.ts.map +1 -1
  28. package/dist/subsystem/DescriptionOverlay.js +4 -4
  29. package/dist/subsystem/DescriptionOverlay.js.map +1 -1
  30. package/dist/subsystem/DescriptionPreview.d.ts +31 -0
  31. package/dist/subsystem/DescriptionPreview.d.ts.map +1 -0
  32. package/dist/subsystem/DescriptionPreview.js +31 -0
  33. package/dist/subsystem/DescriptionPreview.js.map +1 -0
  34. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  35. package/dist/subsystem/SubsystemComponentGraph.js +3 -19
  36. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  37. package/dist/subsystem/__fixtures__/c4Sketch.d.ts.map +1 -1
  38. package/dist/subsystem/__fixtures__/c4Sketch.js +1 -0
  39. package/dist/subsystem/__fixtures__/c4Sketch.js.map +1 -1
  40. package/dist/subsystem/__fixtures__/c4SketchGallery.d.ts +27 -0
  41. package/dist/subsystem/__fixtures__/c4SketchGallery.d.ts.map +1 -0
  42. package/dist/subsystem/__fixtures__/c4SketchGallery.js +312 -0
  43. package/dist/subsystem/__fixtures__/c4SketchGallery.js.map +1 -0
  44. package/dist/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +777 -0
  45. package/dist/subsystem/__fixtures__/c4Sketches/openbot.json +886 -0
  46. package/dist/subsystem/c4Sketch.d.ts +12 -0
  47. package/dist/subsystem/c4Sketch.d.ts.map +1 -1
  48. package/dist/subsystem/c4Sketch.js +2 -1
  49. package/dist/subsystem/c4Sketch.js.map +1 -1
  50. package/dist/subsystem/containerCard.d.ts +3 -1
  51. package/dist/subsystem/containerCard.d.ts.map +1 -1
  52. package/dist/subsystem/containerCard.js +2 -2
  53. package/dist/subsystem/containerCard.js.map +1 -1
  54. package/dist/subsystem/techIcons/index.d.ts +3 -1
  55. package/dist/subsystem/techIcons/index.d.ts.map +1 -1
  56. package/dist/subsystem/techIcons/index.js +2 -2
  57. package/dist/subsystem/techIcons/index.js.map +1 -1
  58. package/package.json +1 -1
  59. package/src/index.ts +10 -0
  60. package/src/stories/Canvases/C4/C4CardGrow.stories.tsx +1 -1
  61. package/src/stories/Canvases/C4/C4Component.stories.tsx +1 -1
  62. package/src/stories/Canvases/C4/C4Container.stories.tsx +1 -1
  63. package/src/stories/Canvases/C4/C4Draft.stories.tsx +1 -1
  64. package/src/stories/Canvases/C4/C4NodeGallery.stories.tsx +1 -1
  65. package/src/stories/Canvases/C4/C4Sketch.stories.tsx +56 -4
  66. package/src/stories/Canvases/C4/C4ToComponentDrill.stories.tsx +1 -1
  67. package/src/stories/Canvases/C4/C4Transition.stories.tsx +1 -1
  68. package/src/stories/Canvases/Subsystem/AnimatedProgression.stories.tsx +1 -1
  69. package/src/stories/Canvases/Subsystem/Appearance.stories.tsx +1 -1
  70. package/src/stories/Canvases/Subsystem/Basics.stories.tsx +1 -1
  71. package/src/stories/Canvases/Subsystem/Captures.stories.tsx +1 -1
  72. package/src/stories/Canvases/Subsystem/Constructs.stories.tsx +3 -7
  73. package/src/stories/Canvases/Subsystem/ConstructsEmbed.stories.tsx +27 -0
  74. package/src/stories/Canvases/Subsystem/ContainerFrames.stories.tsx +1 -1
  75. package/src/stories/Canvases/Subsystem/CustomEntities.stories.tsx +1 -1
  76. package/src/stories/Canvases/Subsystem/Deprecated.stories.tsx +2 -100
  77. package/src/stories/Canvases/Subsystem/DeprecatedGraph.stories.tsx +124 -0
  78. package/src/stories/Canvases/Subsystem/DetailPanel.stories.tsx +1 -1
  79. package/src/stories/Canvases/Subsystem/Diagnostics.stories.tsx +1 -43
  80. package/src/stories/Canvases/Subsystem/DiagnosticsStates.stories.tsx +63 -0
  81. package/src/stories/Canvases/Subsystem/EdgeViews.stories.tsx +1 -1
  82. package/src/stories/Canvases/Subsystem/FrameworkStereotype.stories.tsx +1 -1
  83. package/src/stories/Canvases/Subsystem/GraphTitle.stories.tsx +1 -19
  84. package/src/stories/Canvases/Subsystem/GraphTitleGraph.stories.tsx +51 -0
  85. package/src/stories/Canvases/Subsystem/Issues.stories.tsx +3 -228
  86. package/src/stories/Canvases/Subsystem/IssuesList.stories.tsx +60 -0
  87. package/src/stories/Canvases/Subsystem/LayoutDirection.stories.tsx +1 -1
  88. package/src/stories/Canvases/Subsystem/ModuleBadges.stories.tsx +3 -61
  89. package/src/stories/Canvases/Subsystem/ModuleBadgesNode.stories.tsx +81 -0
  90. package/src/stories/Canvases/Subsystem/ModulePathNesting.stories.tsx +1 -1
  91. package/src/stories/Canvases/Subsystem/Modules.stories.tsx +1 -1
  92. package/src/stories/Canvases/Subsystem/NodeAnatomy.stories.tsx +1 -1
  93. package/src/stories/Canvases/Subsystem/Packages.stories.tsx +1 -1
  94. package/src/stories/Canvases/Subsystem/Presentation.stories.tsx +1 -1
  95. package/src/stories/Canvases/Subsystem/Processes.stories.tsx +1 -1
  96. package/src/stories/Canvases/Subsystem/Reorder.stories.tsx +3 -153
  97. package/src/stories/Canvases/Subsystem/ReorderPanel.stories.tsx +75 -0
  98. package/src/stories/Canvases/Subsystem/Scenarios.stories.tsx +1 -1
  99. package/src/stories/Canvases/Subsystem/Spotlights.stories.tsx +1 -1
  100. package/src/stories/Canvases/Subsystem/StepEmphasis.stories.tsx +1 -1
  101. package/src/stories/Canvases/Subsystem/StoreValueType.stories.tsx +1 -1
  102. package/src/stories/Canvases/Subsystem/TrailAutoplay.stories.tsx +1 -1
  103. package/src/stories/Canvases/Subsystem/TrailSidebarViews.stories.tsx +1 -1
  104. package/src/stories/Canvases/Subsystem/Trails.stories.tsx +1 -1
  105. package/src/stories/Canvases/Subsystem/WorkspacePackageFrames.stories.tsx +1 -1
  106. package/src/stories/Canvases/Subsystem/issuesFixtures.ts +192 -0
  107. package/src/stories/Canvases/Subsystem/reorderFixtures.tsx +125 -0
  108. package/src/subsystem/C4ContainersPanel.test.tsx +151 -0
  109. package/src/subsystem/C4ContainersPanel.tsx +315 -0
  110. package/src/subsystem/C4NodeCard.tsx +12 -4
  111. package/src/subsystem/C4ProjectionView.tsx +107 -37
  112. package/src/subsystem/C4SketchView.tsx +96 -74
  113. package/src/subsystem/DescriptionOverlay.test.tsx +2 -0
  114. package/src/subsystem/DescriptionOverlay.tsx +20 -5
  115. package/src/subsystem/DescriptionPreview.tsx +96 -0
  116. package/src/subsystem/SubsystemComponentGraph.sidebar.test.tsx +1 -1
  117. package/src/subsystem/SubsystemComponentGraph.tsx +14 -43
  118. package/src/subsystem/__fixtures__/c4Sketch.ts +2 -0
  119. package/src/subsystem/__fixtures__/c4SketchGallery.test.ts +65 -0
  120. package/src/subsystem/__fixtures__/c4SketchGallery.ts +351 -0
  121. package/src/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +777 -0
  122. package/src/subsystem/__fixtures__/c4Sketches/openbot.json +886 -0
  123. package/src/subsystem/c4Sketch.ts +13 -0
  124. package/src/subsystem/containerCard.tsx +4 -1
  125. package/src/subsystem/techIcons/index.tsx +11 -2
@@ -0,0 +1,60 @@
1
+ import '@xyflow/react/dist/style.css';
2
+ import React from 'react';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
+ import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
5
+ import { SubsystemIssueList } from '../../../subsystem/IssueList';
6
+ import { ISSUES, TRAIL_STEP_ISSUES } from './issuesFixtures';
7
+
8
+ const meta = {
9
+ title: 'Canvases/Subsystem/UI Isolation/Issues',
10
+ component: SubsystemIssueList,
11
+ parameters: {
12
+ layout: 'fullscreen',
13
+ },
14
+ tags: ['autodocs'],
15
+ decorators: [
16
+ (Story) => (
17
+ <ThemeProvider theme={defaultEditorTheme}>
18
+ <Story />
19
+ </ThemeProvider>
20
+ ),
21
+ ],
22
+ } satisfies Meta<typeof SubsystemIssueList>;
23
+
24
+ export default meta;
25
+ type Story = StoryObj<typeof meta>;
26
+
27
+ /** The catalogue, grouped by verification layer. */
28
+ export const List: Story = {
29
+ render: () => (
30
+ <div style={{ display: 'flex', flexDirection: 'column', width: 380, height: '100vh', borderRight: '1px solid #333' }}>
31
+ <SubsystemIssueList
32
+ issues={ISSUES}
33
+ onSelectIssue={() => {}}
34
+ onApplyFix={() => {}}
35
+ />
36
+ </div>
37
+ ),
38
+ };
39
+
40
+ /** All four layers clean — the happy state. */
41
+ export const AllGood: Story = {
42
+ render: () => (
43
+ <div style={{ display: 'flex', flexDirection: 'column', width: 380, height: '100vh', borderRight: '1px solid #333' }}>
44
+ <SubsystemIssueList issues={[]} />
45
+ </div>
46
+ ),
47
+ };
48
+
49
+ /** Trail step verification: shows unconfirmed and stale call site findings. */
50
+ export const TrailStepVerification: Story = {
51
+ render: () => (
52
+ <div style={{ display: 'flex', flexDirection: 'column', width: 380, height: '100vh', borderRight: '1px solid #333' }}>
53
+ <SubsystemIssueList
54
+ issues={TRAIL_STEP_ISSUES}
55
+ focusCategory="trail"
56
+ onSelectIssue={() => {}}
57
+ />
58
+ </div>
59
+ ),
60
+ };
@@ -20,7 +20,7 @@ import type { SubsystemOpenFileOptions } from '../../../subsystem/sourceSpan';
20
20
  import { components, graphSpecFromSteps } from './fixtures';
21
21
 
22
22
  const meta = {
23
- title: 'Canvases/Subsystem/LayoutDirection',
23
+ title: 'Canvases/Subsystem/Views/LayoutDirection',
24
24
  component: SubsystemComponentGraph,
25
25
  parameters: { layout: 'fullscreen' },
26
26
  tags: ['autodocs'],
@@ -1,18 +1,13 @@
1
1
  import '@xyflow/react/dist/style.css';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
- import { ReactFlowProvider, type NodeProps } from '@xyflow/react';
3
+ import { ReactFlowProvider } from '@xyflow/react';
4
4
  import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
5
5
  import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
6
- import { SubsystemGroupNode } from '../../../subsystem/nodes';
7
- import type {
8
- SubsystemComponent,
9
- SubsystemGraphNode,
10
- SubsystemProcessRegion,
11
- } from '../../../subsystem/model';
6
+ import type { SubsystemComponent } from '../../../subsystem/model';
12
7
  import { graphSpecFromSteps } from './fixtures';
13
8
 
14
9
  const meta = {
15
- title: 'Canvases/Subsystem/ModuleBadges',
10
+ title: 'Canvases/Subsystem/Views/ModuleBadges',
16
11
  parameters: { layout: 'fullscreen' },
17
12
  tags: ['autodocs'],
18
13
  decorators: [
@@ -127,56 +122,3 @@ export const DeepModulePaths: Story = {
127
122
  </div>
128
123
  ),
129
124
  };
130
-
131
- const HARNESS_FRAME_WIDTH = 360;
132
-
133
- const harnessRegion: SubsystemProcessRegion = {
134
- kind: 'module',
135
- key: DEEP_NODES,
136
- label: DEEP_NODES,
137
- memberAliases: ['node-comp', 'group-comp', 'edge-comp'],
138
- };
139
-
140
- /** Fixed frame; the badge is the only thing that grows on click. */
141
- function ModuleBadgeHarness() {
142
- const nodeProps = {
143
- id: `module:${harnessRegion.key}`,
144
- data: { region: harnessRegion },
145
- width: HARNESS_FRAME_WIDTH,
146
- height: 180,
147
- selected: false,
148
- } as unknown as NodeProps<SubsystemGraphNode>;
149
- return (
150
- <div
151
- style={{
152
- padding: 56,
153
- display: 'flex',
154
- flexDirection: 'column',
155
- gap: 16,
156
- height: '100vh',
157
- boxSizing: 'border-box',
158
- fontFamily: 'ui-sans-serif, system-ui, sans-serif',
159
- }}
160
- >
161
- <div style={{ fontSize: 13, color: '#8a90a0' }}>
162
- The module frame stays at{' '}
163
- <span style={{ fontFamily: 'monospace', color: '#d5d9e2' }}>
164
- {HARNESS_FRAME_WIDTH}px
165
- </span>
166
- . Hover a badge and it widens to reveal more of the path text (no
167
- stretch, no distortion) to show it's clickable. Click to expand the
168
- full path past the frame's edge, click again to collapse back to{' '}
169
- <code>first/…/last</code>.
170
- </div>
171
- <div style={{ position: 'relative', width: HARNESS_FRAME_WIDTH, minWidth: 0 }}>
172
- <SubsystemGroupNode {...nodeProps} />
173
- </div>
174
- </div>
175
- );
176
- }
177
-
178
- /** Isolated demo: only the badge grows — the module frame never moves. */
179
- export const BadgeOnly: Story = {
180
- parameters: { layout: 'fullscreen' },
181
- render: () => <ModuleBadgeHarness />,
182
- };
@@ -0,0 +1,81 @@
1
+ import '@xyflow/react/dist/style.css';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+ import { ReactFlowProvider, type NodeProps } from '@xyflow/react';
4
+ import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
5
+ import { SubsystemGroupNode } from '../../../subsystem/nodes';
6
+ import type {
7
+ SubsystemGraphNode,
8
+ SubsystemProcessRegion,
9
+ } from '../../../subsystem/model';
10
+
11
+ const meta = {
12
+ title: 'Canvases/Subsystem/UI Isolation/ModuleBadges',
13
+ parameters: { layout: 'fullscreen' },
14
+ tags: ['autodocs'],
15
+ decorators: [
16
+ (Story) => (
17
+ <ThemeProvider theme={defaultEditorTheme}>
18
+ <ReactFlowProvider>
19
+ <Story />
20
+ </ReactFlowProvider>
21
+ </ThemeProvider>
22
+ ),
23
+ ],
24
+ } satisfies Meta;
25
+
26
+ export default meta;
27
+ type Story = StoryObj<typeof meta>;
28
+
29
+ const DEEP_NODES = 'packages/subsystems-react/src/subsystem/nodes.tsx';
30
+ const HARNESS_FRAME_WIDTH = 360;
31
+
32
+ const harnessRegion: SubsystemProcessRegion = {
33
+ kind: 'module',
34
+ key: DEEP_NODES,
35
+ label: DEEP_NODES,
36
+ memberAliases: ['node-comp', 'group-comp', 'edge-comp'],
37
+ };
38
+
39
+ /** Fixed frame; the badge is the only thing that grows on click. */
40
+ function ModuleBadgeHarness() {
41
+ const nodeProps = {
42
+ id: `module:${harnessRegion.key}`,
43
+ data: { region: harnessRegion },
44
+ width: HARNESS_FRAME_WIDTH,
45
+ height: 180,
46
+ selected: false,
47
+ } as unknown as NodeProps<SubsystemGraphNode>;
48
+ return (
49
+ <div
50
+ style={{
51
+ padding: 56,
52
+ display: 'flex',
53
+ flexDirection: 'column',
54
+ gap: 16,
55
+ height: '100vh',
56
+ boxSizing: 'border-box',
57
+ fontFamily: 'ui-sans-serif, system-ui, sans-serif',
58
+ }}
59
+ >
60
+ <div style={{ fontSize: 13, color: '#8a90a0' }}>
61
+ The module frame stays at{' '}
62
+ <span style={{ fontFamily: 'monospace', color: '#d5d9e2' }}>
63
+ {HARNESS_FRAME_WIDTH}px
64
+ </span>
65
+ . Hover a badge and it widens to reveal more of the path text (no
66
+ stretch, no distortion) to show it's clickable. Click to expand the
67
+ full path past the frame's edge, click again to collapse back to{' '}
68
+ <code>first/…/last</code>.
69
+ </div>
70
+ <div style={{ position: 'relative', width: HARNESS_FRAME_WIDTH, minWidth: 0 }}>
71
+ <SubsystemGroupNode {...nodeProps} />
72
+ </div>
73
+ </div>
74
+ );
75
+ }
76
+
77
+ /** Isolated demo: only the badge grows — the module frame never moves. */
78
+ export const BadgeOnly: Story = {
79
+ parameters: { layout: 'fullscreen' },
80
+ render: () => <ModuleBadgeHarness />,
81
+ };
@@ -15,7 +15,7 @@ import type { SubsystemComponent } from '../../../subsystem/model';
15
15
  */
16
16
 
17
17
  const meta = {
18
- title: 'Canvases/Subsystem/Module path nesting',
18
+ title: 'Canvases/Subsystem/Views/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: 'Canvases/Subsystem/Modules',
9
+ title: 'Canvases/Subsystem/Views/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: 'Canvases/Subsystem/NodeAnatomy',
27
+ title: 'Canvases/Subsystem/UI Isolation/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: 'Canvases/Subsystem/Packages',
9
+ title: 'Canvases/Subsystem/Views/Packages',
10
10
  component: SubsystemComponentGraph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],
@@ -16,7 +16,7 @@ import type { SubsystemComponent, SubsystemTrail } from '../../../subsystem/mode
16
16
  * mismatch between the rects and the rendered nodes is visible at a glance.
17
17
  */
18
18
  const meta = {
19
- title: 'Canvases/Subsystem/Presentation',
19
+ title: 'Canvases/Subsystem/Graphs/Presentation',
20
20
  component: SubsystemComponentGraph,
21
21
  parameters: { layout: 'fullscreen' },
22
22
  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: 'Canvases/Subsystem/Processes',
8
+ title: 'Canvases/Subsystem/Views/Processes',
9
9
  component: SubsystemComponentGraph,
10
10
  parameters: { layout: 'fullscreen' },
11
11
  tags: ['autodocs'],
@@ -3,11 +3,11 @@ import '@xyflow/react/dist/style.css';
3
3
  import type { Meta, StoryObj } from '@storybook/react';
4
4
  import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
5
5
  import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
6
- import { TrailsPanel } from '../../../subsystem/TrailsPanel';
7
- import type { SubsystemComponent, SubsystemTrail } from '../../../subsystem/model';
6
+ import type { SubsystemTrail } from '../../../subsystem/model';
7
+ import { components, initialTrails, OrderHeader } from './reorderFixtures';
8
8
 
9
9
  const meta = {
10
- title: 'Canvases/Subsystem/Reorder',
10
+ title: 'Canvases/Subsystem/Views/Reorder',
11
11
  component: SubsystemComponentGraph,
12
12
  parameters: {
13
13
  layout: 'fullscreen',
@@ -25,105 +25,6 @@ const meta = {
25
25
  export default meta;
26
26
  type Story = StoryObj<typeof meta>;
27
27
 
28
- const components: SubsystemComponent[] = [
29
- {
30
- alias: 'panel',
31
- name: 'DrawingsLeftPanel',
32
- construct: 'class',
33
- file: 'src/panels/DrawingsLeftPanel.tsx',
34
- purl: 'pkg:github/principal-ai/desktop-app',
35
- purpose: 'lists drawings; emits open/delete intents',
36
- symbol: 'DrawingsLeftPanel',
37
- process: 'draw-list',
38
- },
39
- {
40
- alias: 'host',
41
- name: 'useDrawingsHost',
42
- construct: 'function',
43
- file: 'src/hooks/useDrawingsHost.ts',
44
- purl: 'pkg:github/principal-ai/desktop-app',
45
- purpose: 'hosts drawing CRUD; dispatches to storage and shell',
46
- symbol: 'useDrawingsHost',
47
- process: 'draw-list',
48
- },
49
- {
50
- alias: 'storage',
51
- name: 'DrawingsStorage',
52
- construct: 'class',
53
- file: 'src/storage/drawingsStorage.ts',
54
- purl: 'pkg:github/principal-ai/desktop-app',
55
- purpose: 'persists drawings as files',
56
- symbol: 'DrawingsStorage',
57
- process: 'draw-host',
58
- },
59
- {
60
- alias: 'fs',
61
- name: 'FileSystemService',
62
- construct: 'external',
63
- file: 'src/services/fileSystem.ts',
64
- purl: 'pkg:github/principal-ai/desktop-app',
65
- purpose: 'sandboxed host fd/fs access',
66
- symbol: 'FileSystemService',
67
- role: 'service',
68
- },
69
- ];
70
-
71
- const initialTrails: SubsystemTrail[] = [
72
- {
73
- id: 'tl-open-drawing',
74
- title: 'Open drawing',
75
- steps: [
76
- { from: 'panel', to: 'storage', mechanism: 'calls', file: 'src/panels/DrawingsLeftPanel.tsx', line: 56, symbol: 'DrawingsLeftPanel.scan' },
77
- { from: 'panel', to: 'host', mechanism: 'produces', file: 'src/panels/DrawingsLeftPanel.tsx', line: 85, symbol: 'DrawingsLeftPanel.openDrawing' },
78
- { from: 'host', to: 'storage', mechanism: 'calls', file: 'src/hooks/useDrawingsHost.ts', line: 45, symbol: 'useDrawingsHost.openDrawing' },
79
- ],
80
- },
81
- {
82
- id: 'tl-save-drawing',
83
- title: 'Save drawing',
84
- steps: [
85
- { from: 'host', to: 'storage', mechanism: 'calls', file: 'src/hooks/useDrawingsHost.ts', line: 64, symbol: 'useDrawingsHost.saveDrawing' },
86
- { from: 'storage', to: 'fs', mechanism: 'calls', file: 'src/storage/drawingsStorage.ts', line: 90, symbol: 'DrawingsStorage.write' },
87
- ],
88
- },
89
- {
90
- id: 'tl-delete-drawing',
91
- title: 'Delete drawing',
92
- steps: [
93
- { from: 'host', to: 'fs', mechanism: 'calls', file: 'src/hooks/useDrawingsHost.ts', line: 66, symbol: 'useDrawingsHost.deleteDrawing' },
94
- { from: 'host', to: 'panel', mechanism: 'produces', file: 'src/hooks/useDrawingsHost.ts', line: 64, symbol: 'useDrawingsHost.refreshList' },
95
- ],
96
- },
97
- {
98
- id: 'tl-refresh-list',
99
- title: 'Refresh list',
100
- steps: [
101
- { from: 'panel', to: 'storage', mechanism: 'calls', file: 'src/panels/DrawingsLeftPanel.tsx', line: 56, symbol: 'DrawingsLeftPanel.scan' },
102
- ],
103
- },
104
- ];
105
-
106
- const orderLabel = (list: SubsystemTrail[]) => list.map((w) => w.title).join(' → ');
107
-
108
- function OrderHeader({ list }: { list: SubsystemTrail[] }) {
109
- return (
110
- <div
111
- style={{
112
- padding: '8px 12px',
113
- borderBottom: '1px solid #2a2a2a',
114
- fontFamily: 'monospace',
115
- fontSize: 12,
116
- color: '#9aa4b2',
117
- whiteSpace: 'nowrap',
118
- overflow: 'hidden',
119
- textOverflow: 'ellipsis',
120
- }}
121
- >
122
- array order: {orderLabel(list)}
123
- </div>
124
- );
125
- }
126
-
127
28
  function ReorderGraphDemo() {
128
29
  const [trails, setTrails] = useState(initialTrails);
129
30
  const onReorder = useCallback(
@@ -147,57 +48,6 @@ function ReorderGraphDemo() {
147
48
  );
148
49
  }
149
50
 
150
- function PanelOnlyDemo() {
151
- const [trails, setTrails] = useState(initialTrails);
152
- // Start collapsed so the drag grips are visible; expanding any row hides them
153
- // (reordering is only offered when every row is collapsed).
154
- const [expanded, setExpanded] = useState<Set<string>>(new Set());
155
- const onToggleCollapsed = useCallback((id: string) => {
156
- setExpanded((prev) => {
157
- const next = new Set(prev);
158
- if (next.has(id)) next.delete(id);
159
- else next.add(id);
160
- return next;
161
- });
162
- }, []);
163
-
164
- return (
165
- <div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
166
- <OrderHeader list={trails} />
167
- <div style={{ flex: 1, minHeight: 0, display: 'flex' }}>
168
- <div
169
- style={{
170
- width: 340,
171
- display: 'flex',
172
- flexDirection: 'column',
173
- borderRight: '1px solid #2a2a2a',
174
- }}
175
- >
176
- <TrailsPanel
177
- trails={trails}
178
- expandedTrails={expanded}
179
- focusedTrailId={null}
180
- focusedStepIndex={null}
181
- hoveredTrailStep={null}
182
- onToggleCollapsed={onToggleCollapsed}
183
- onFocusFlow={() => {}}
184
- onClearFocus={() => {}}
185
- onFocusStep={() => {}}
186
- onHoverStep={() => {}}
187
- onHoverFlow={() => {}}
188
- onLeaveStep={() => {}}
189
- onReorder={setTrails}
190
- />
191
- </div>
192
- </div>
193
- </div>
194
- );
195
- }
196
-
197
51
  export const DragToReorder: Story = {
198
52
  render: () => <ReorderGraphDemo />,
199
53
  };
200
-
201
- export const PanelOnly: Story = {
202
- render: () => <PanelOnlyDemo />,
203
- };
@@ -0,0 +1,75 @@
1
+ import React, { useCallback, useState } from 'react';
2
+ import '@xyflow/react/dist/style.css';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
+ import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
5
+ import { TrailsPanel } from '../../../subsystem/TrailsPanel';
6
+ import { initialTrails, OrderHeader } from './reorderFixtures';
7
+
8
+ const meta = {
9
+ title: 'Canvases/Subsystem/UI Isolation/Reorder',
10
+ parameters: {
11
+ layout: 'fullscreen',
12
+ },
13
+ tags: ['autodocs'],
14
+ decorators: [
15
+ (Story) => (
16
+ <ThemeProvider theme={defaultEditorTheme}>
17
+ <Story />
18
+ </ThemeProvider>
19
+ ),
20
+ ],
21
+ } satisfies Meta;
22
+
23
+ export default meta;
24
+ type Story = StoryObj<typeof meta>;
25
+
26
+ function PanelOnlyDemo() {
27
+ const [trails, setTrails] = useState(initialTrails);
28
+ // Start collapsed so the drag grips are visible; expanding any row hides them
29
+ // (reordering is only offered when every row is collapsed).
30
+ const [expanded, setExpanded] = useState<Set<string>>(new Set());
31
+ const onToggleCollapsed = useCallback((id: string) => {
32
+ setExpanded((prev) => {
33
+ const next = new Set(prev);
34
+ if (next.has(id)) next.delete(id);
35
+ else next.add(id);
36
+ return next;
37
+ });
38
+ }, []);
39
+
40
+ return (
41
+ <div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
42
+ <OrderHeader list={trails} />
43
+ <div style={{ flex: 1, minHeight: 0, display: 'flex' }}>
44
+ <div
45
+ style={{
46
+ width: 340,
47
+ display: 'flex',
48
+ flexDirection: 'column',
49
+ borderRight: '1px solid #2a2a2a',
50
+ }}
51
+ >
52
+ <TrailsPanel
53
+ trails={trails}
54
+ expandedTrails={expanded}
55
+ focusedTrailId={null}
56
+ focusedStepIndex={null}
57
+ hoveredTrailStep={null}
58
+ onToggleCollapsed={onToggleCollapsed}
59
+ onFocusFlow={() => {}}
60
+ onClearFocus={() => {}}
61
+ onFocusStep={() => {}}
62
+ onHoverStep={() => {}}
63
+ onHoverFlow={() => {}}
64
+ onLeaveStep={() => {}}
65
+ onReorder={setTrails}
66
+ />
67
+ </div>
68
+ </div>
69
+ </div>
70
+ );
71
+ }
72
+
73
+ export const PanelOnly: Story = {
74
+ render: () => <PanelOnlyDemo />,
75
+ };
@@ -12,7 +12,7 @@ import type { GraphifyComponentDetail } from '../../../graphify';
12
12
  import { components, graphSpecFromSteps } from './fixtures';
13
13
 
14
14
  const meta = {
15
- title: 'Canvases/Subsystem/Scenarios',
15
+ title: 'Canvases/Subsystem/Views/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: 'Canvases/Subsystem/Spotlights',
20
+ title: 'Canvases/Subsystem/UI Isolation/Spotlights',
21
21
  parameters: { layout: 'fullscreen' },
22
22
  tags: ['autodocs'],
23
23
  decorators: [
@@ -22,7 +22,7 @@ import {
22
22
  * a claim and watch what the keys do.
23
23
  */
24
24
  const meta = {
25
- title: 'Canvases/Subsystem/Step emphasis',
25
+ title: 'Canvases/Subsystem/Views/Step emphasis',
26
26
  component: SubsystemComponentGraph,
27
27
  parameters: {
28
28
  layout: 'fullscreen',
@@ -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: 'Canvases/Subsystem/StoreValueType',
26
+ title: 'Canvases/Subsystem/UI Isolation/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: 'Canvases/Subsystem/TrailAutoplay',
19
+ title: 'Canvases/Subsystem/Graphs/TrailAutoplay',
20
20
  component: SubsystemComponentGraph,
21
21
  parameters: { layout: 'fullscreen' },
22
22
  tags: ['autodocs'],
@@ -56,7 +56,7 @@ function Demo() {
56
56
  }
57
57
 
58
58
  const meta = {
59
- title: 'Canvases/Subsystem/TrailSidebarViews',
59
+ title: 'Canvases/Subsystem/Views/TrailSidebarViews',
60
60
  component: SubsystemComponentGraph,
61
61
  parameters: { layout: 'fullscreen' },
62
62
  decorators: [(Story) => (
@@ -8,7 +8,7 @@ import { PierreTrailCodeView } from '../../../pierre';
8
8
  import type { TrailViewerContext } from '../../../subsystem/SubsystemComponentGraph';
9
9
 
10
10
  const meta = {
11
- title: 'Canvases/Subsystem/Trails',
11
+ title: 'Canvases/Subsystem/Views/Trails',
12
12
  component: SubsystemComponentGraph,
13
13
  parameters: {
14
14
  layout: 'fullscreen',
@@ -6,7 +6,7 @@ import type { SubsystemComponent } from '../../../subsystem/model';
6
6
  import { graphSpecFromSteps } from './fixtures';
7
7
 
8
8
  const meta = {
9
- title: 'Canvases/Subsystem/WorkspacePackages',
9
+ title: 'Canvases/Subsystem/Views/WorkspacePackages',
10
10
  component: SubsystemComponentGraph,
11
11
  parameters: { layout: 'fullscreen' },
12
12
  tags: ['autodocs'],