@principal-ai/subsystems-react 0.56.24 → 0.56.26
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.
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/stories/Canvases/Subsystem/issuesFixtures.d.ts +4 -0
- package/dist/stories/Canvases/Subsystem/issuesFixtures.d.ts.map +1 -0
- package/dist/stories/Canvases/Subsystem/issuesFixtures.js +189 -0
- package/dist/stories/Canvases/Subsystem/issuesFixtures.js.map +1 -0
- package/dist/stories/Canvases/Subsystem/reorderFixtures.d.ts +8 -0
- package/dist/stories/Canvases/Subsystem/reorderFixtures.d.ts.map +1 -0
- package/dist/stories/Canvases/Subsystem/reorderFixtures.js +103 -0
- package/dist/stories/Canvases/Subsystem/reorderFixtures.js.map +1 -0
- package/dist/subsystem/C4ContainersPanel.d.ts +35 -0
- package/dist/subsystem/C4ContainersPanel.d.ts.map +1 -0
- package/dist/subsystem/C4ContainersPanel.js +165 -0
- package/dist/subsystem/C4ContainersPanel.js.map +1 -0
- package/dist/subsystem/C4NodeCard.d.ts.map +1 -1
- package/dist/subsystem/C4NodeCard.js +10 -4
- package/dist/subsystem/C4NodeCard.js.map +1 -1
- package/dist/subsystem/C4ProjectionView.d.ts +12 -2
- package/dist/subsystem/C4ProjectionView.d.ts.map +1 -1
- package/dist/subsystem/C4ProjectionView.js +100 -33
- package/dist/subsystem/C4ProjectionView.js.map +1 -1
- package/dist/subsystem/C4SketchView.d.ts.map +1 -1
- package/dist/subsystem/C4SketchView.js +53 -34
- package/dist/subsystem/C4SketchView.js.map +1 -1
- package/dist/subsystem/ConstructsCatalog.d.ts +18 -11
- package/dist/subsystem/ConstructsCatalog.d.ts.map +1 -1
- package/dist/subsystem/ConstructsCatalog.js +25 -27
- package/dist/subsystem/ConstructsCatalog.js.map +1 -1
- package/dist/subsystem/DescriptionOverlay.d.ts +10 -2
- package/dist/subsystem/DescriptionOverlay.d.ts.map +1 -1
- package/dist/subsystem/DescriptionOverlay.js +4 -4
- package/dist/subsystem/DescriptionOverlay.js.map +1 -1
- package/dist/subsystem/DescriptionPreview.d.ts +31 -0
- package/dist/subsystem/DescriptionPreview.d.ts.map +1 -0
- package/dist/subsystem/DescriptionPreview.js +31 -0
- package/dist/subsystem/DescriptionPreview.js.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts +13 -3
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +18 -23
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/__fixtures__/c4Sketch.d.ts.map +1 -1
- package/dist/subsystem/__fixtures__/c4Sketch.js +1 -0
- package/dist/subsystem/__fixtures__/c4Sketch.js.map +1 -1
- package/dist/subsystem/__fixtures__/c4SketchGallery.d.ts +29 -0
- package/dist/subsystem/__fixtures__/c4SketchGallery.d.ts.map +1 -0
- package/dist/subsystem/__fixtures__/c4SketchGallery.js +320 -0
- package/dist/subsystem/__fixtures__/c4SketchGallery.js.map +1 -0
- package/dist/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +778 -0
- package/dist/subsystem/__fixtures__/c4Sketches/openbot.json +887 -0
- package/dist/subsystem/c4Sketch.d.ts +12 -0
- package/dist/subsystem/c4Sketch.d.ts.map +1 -1
- package/dist/subsystem/c4Sketch.js +2 -1
- package/dist/subsystem/c4Sketch.js.map +1 -1
- package/dist/subsystem/containerCard.d.ts +3 -1
- package/dist/subsystem/containerCard.d.ts.map +1 -1
- package/dist/subsystem/containerCard.js +2 -2
- package/dist/subsystem/containerCard.js.map +1 -1
- package/dist/subsystem/techIcons/index.d.ts +3 -1
- package/dist/subsystem/techIcons/index.d.ts.map +1 -1
- package/dist/subsystem/techIcons/index.js +2 -2
- package/dist/subsystem/techIcons/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +10 -0
- package/src/stories/Canvases/C4/C4CardGrow.stories.tsx +1 -1
- package/src/stories/Canvases/C4/C4Component.stories.tsx +1 -1
- package/src/stories/Canvases/C4/C4Container.stories.tsx +1 -1
- package/src/stories/Canvases/C4/C4Draft.stories.tsx +1 -1
- package/src/stories/Canvases/C4/C4NodeGallery.stories.tsx +1 -1
- package/src/stories/Canvases/C4/C4Sketch.stories.tsx +62 -4
- package/src/stories/Canvases/C4/C4ToComponentDrill.stories.tsx +1 -1
- package/src/stories/Canvases/C4/C4Transition.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/AnimatedProgression.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Appearance.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Basics.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Captures.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Constructs.stories.tsx +3 -7
- package/src/stories/Canvases/Subsystem/ConstructsEmbed.stories.tsx +27 -0
- package/src/stories/Canvases/Subsystem/ContainerFrames.stories.tsx +7 -4
- package/src/stories/Canvases/Subsystem/CustomEntities.stories.tsx +3 -2
- package/src/stories/Canvases/Subsystem/Deprecated.stories.tsx +2 -100
- package/src/stories/Canvases/Subsystem/DeprecatedGraph.stories.tsx +124 -0
- package/src/stories/Canvases/Subsystem/DetailPanel.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Diagnostics.stories.tsx +1 -43
- package/src/stories/Canvases/Subsystem/DiagnosticsStates.stories.tsx +63 -0
- package/src/stories/Canvases/Subsystem/EdgeViews.stories.tsx +3 -2
- package/src/stories/Canvases/Subsystem/FrameworkStereotype.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/GraphTitle.stories.tsx +1 -19
- package/src/stories/Canvases/Subsystem/GraphTitleGraph.stories.tsx +51 -0
- package/src/stories/Canvases/Subsystem/Issues.stories.tsx +5 -229
- package/src/stories/Canvases/Subsystem/IssuesList.stories.tsx +60 -0
- package/src/stories/Canvases/Subsystem/LayoutDirection.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/ModuleBadges.stories.tsx +6 -63
- package/src/stories/Canvases/Subsystem/ModuleBadgesNode.stories.tsx +81 -0
- package/src/stories/Canvases/Subsystem/ModulePathNesting.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Modules.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/NodeAnatomy.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Packages.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Presentation.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Processes.stories.tsx +3 -2
- package/src/stories/Canvases/Subsystem/Reorder.stories.tsx +5 -154
- package/src/stories/Canvases/Subsystem/ReorderPanel.stories.tsx +75 -0
- package/src/stories/Canvases/Subsystem/Scenarios.stories.tsx +7 -4
- package/src/stories/Canvases/Subsystem/Spotlights.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/StepEmphasis.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/StoreValueType.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/TrailAutoplay.stories.tsx +3 -2
- package/src/stories/Canvases/Subsystem/TrailSidebarViews.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Trails.stories.tsx +5 -3
- package/src/stories/Canvases/Subsystem/WorkspacePackageFrames.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/issuesFixtures.ts +192 -0
- package/src/stories/Canvases/Subsystem/reorderFixtures.tsx +125 -0
- package/src/stories/Components/ConstructsCatalog.stories.tsx +2 -1
- package/src/subsystem/C4ContainersPanel.test.tsx +151 -0
- package/src/subsystem/C4ContainersPanel.tsx +315 -0
- package/src/subsystem/C4NodeCard.tsx +12 -4
- package/src/subsystem/C4ProjectionView.tsx +151 -53
- package/src/subsystem/C4SketchView.tsx +96 -74
- package/src/subsystem/ConstructsCatalog.tsx +59 -58
- package/src/subsystem/DescriptionOverlay.test.tsx +18 -8
- package/src/subsystem/DescriptionOverlay.tsx +20 -5
- package/src/subsystem/DescriptionPreview.tsx +96 -0
- package/src/subsystem/SubsystemComponentGraph.sidebar.test.tsx +28 -8
- package/src/subsystem/SubsystemComponentGraph.tsx +46 -51
- package/src/subsystem/__fixtures__/c4Sketch.ts +2 -0
- package/src/subsystem/__fixtures__/c4SketchGallery.test.ts +65 -0
- package/src/subsystem/__fixtures__/c4SketchGallery.ts +361 -0
- package/src/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +778 -0
- package/src/subsystem/__fixtures__/c4Sketches/openbot.json +887 -0
- package/src/subsystem/c4Sketch.ts +13 -0
- package/src/subsystem/containerCard.tsx +4 -1
- 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
|
|
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 {
|
|
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: [
|
|
@@ -117,8 +112,9 @@ export const DeepModulePaths: Story = {
|
|
|
117
112
|
<div style={{ width: '100%', height: '100vh' }}>
|
|
118
113
|
<SubsystemComponentGraph
|
|
119
114
|
title="Deep module paths"
|
|
120
|
-
description=
|
|
121
|
-
|
|
115
|
+
description="Module badges never spill past their frame while collapsed."
|
|
116
|
+
notes={
|
|
117
|
+
'A path that would overflow collapses to `first/…/last`; ' +
|
|
122
118
|
'click the badge to expand the full path (the badge widens past the frame edge — the frame itself stays put), click again to collapse it back.'
|
|
123
119
|
}
|
|
124
120
|
components={deepComponents}
|
|
@@ -127,56 +123,3 @@ export const DeepModulePaths: Story = {
|
|
|
127
123
|
</div>
|
|
128
124
|
),
|
|
129
125
|
};
|
|
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'],
|
|
@@ -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'],
|
|
@@ -67,7 +67,8 @@ export const ProcessBoundaries: Story = {
|
|
|
67
67
|
<div style={{ width: '100%', height: '100vh' }}>
|
|
68
68
|
<SubsystemComponentGraph
|
|
69
69
|
title="Process boundaries"
|
|
70
|
-
description="Host and renderer each render in their own ELK-aware boundary frame.
|
|
70
|
+
description="Host and renderer each render in their own ELK-aware boundary frame."
|
|
71
|
+
notes="The worker process holds a single node and still gets a frame (singleton frames default on). The telemetry service has no `process` and sits outside every boundary."
|
|
71
72
|
components={processComponents}
|
|
72
73
|
trails={processEdges.trails}
|
|
73
74
|
/>
|
|
@@ -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 {
|
|
7
|
-
import
|
|
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(
|
|
@@ -140,64 +41,14 @@ function ReorderGraphDemo() {
|
|
|
140
41
|
trails={trails}
|
|
141
42
|
onReorderTrails={onReorder}
|
|
142
43
|
title="drawing-files flows"
|
|
143
|
-
description="Drag the grip at the right of a trail row to reorder it.
|
|
44
|
+
description="Drag the grip at the right of a trail row to reorder it."
|
|
45
|
+
notes="Select a trail to open its steps and focus its components; Back restores the full list and model. The header above mirrors the array order; dropping a row calls `onReorderTrails` with the next array."
|
|
144
46
|
/>
|
|
145
47
|
</div>
|
|
146
48
|
</div>
|
|
147
49
|
);
|
|
148
50
|
}
|
|
149
51
|
|
|
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
52
|
export const DragToReorder: Story = {
|
|
198
53
|
render: () => <ReorderGraphDemo />,
|
|
199
54
|
};
|
|
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',
|
|
@@ -149,7 +149,8 @@ function MultiRepoDemo() {
|
|
|
149
149
|
<div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
|
|
150
150
|
<SubsystemComponentGraph
|
|
151
151
|
title="Type-ref resolution across repos"
|
|
152
|
-
description="Two repos → two file trees.
|
|
152
|
+
description="Two repos → two file trees."
|
|
153
|
+
notes="Each tree is scoped to its repo's files and headed by the owner avatar + repo name. Cross-repo edges land on external stubs."
|
|
153
154
|
components={multiRepoComponents}
|
|
154
155
|
trails={multiRepoEdges.trails}
|
|
155
156
|
/>
|
|
@@ -382,7 +383,8 @@ function AccessSurfacesDemo() {
|
|
|
382
383
|
<div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
|
|
383
384
|
<SubsystemComponentGraph
|
|
384
385
|
title="Access surfaces, roles, and process boundaries"
|
|
385
|
-
description="Two process regions (host, renderer) + boundary entries; agents and the external service float outside every boundary.
|
|
386
|
+
description="Two process regions (host, renderer) + boundary entries; agents and the external service float outside every boundary."
|
|
387
|
+
notes="Hover for the role badge; click the store to drill into its state-only detail."
|
|
386
388
|
components={accessSurfaceComponents}
|
|
387
389
|
trails={accessSurfaceEdges.trails}
|
|
388
390
|
onSelect={(id) => setSelected(id)}
|
|
@@ -1128,7 +1130,8 @@ function TypeFamilySpectrumDemo() {
|
|
|
1128
1130
|
<div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
|
|
1129
1131
|
<SubsystemComponentGraph
|
|
1130
1132
|
title="Type-family — what a type can hold"
|
|
1131
|
-
description="Structured buckets: callable signature (generics + params), interface properties, enum members, union, plain alias reference.
|
|
1133
|
+
description="Structured buckets: callable signature (generics + params), interface properties, enum members, union, plain alias reference."
|
|
1134
|
+
notes="`rhs` = verbatim escape hatch for shapes that don't fit (mapped/conditional/template-literal). Click each to see the declaration."
|
|
1132
1135
|
components={typeSpectrumComponents}
|
|
1133
1136
|
trails={typeSpectrumEdges.trails}
|
|
1134
1137
|
onSelect={(id) => setSelected(id)}
|
|
@@ -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: [
|
|
@@ -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'],
|
|
@@ -203,7 +203,8 @@ export const AutoplayFocus: Story = {
|
|
|
203
203
|
edgeView="trails"
|
|
204
204
|
initialTrailId="wt-book"
|
|
205
205
|
title="Autoplay through steps"
|
|
206
|
-
description="Autoplay cycles the trail steps.
|
|
206
|
+
description="Autoplay cycles the trail steps."
|
|
207
|
+
notes="**Goal to refine:** each advance should camera-focus the step (and optionally open its snippet), not just dim the rest of the graph. Use the controls to compare `focus` vs `dim` and the zoom gate."
|
|
207
208
|
renderFileViewer={(file, opts) => (
|
|
208
209
|
<div style={{ padding: 12, fontFamily: 'monospace', fontSize: 12, color: '#bbb', whiteSpace: 'pre' }}>
|
|
209
210
|
{`// ${file}`}
|