@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.
- 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.map +1 -1
- package/dist/subsystem/C4ProjectionView.js +81 -27
- 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/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.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +3 -19
- 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 +27 -0
- package/dist/subsystem/__fixtures__/c4SketchGallery.d.ts.map +1 -0
- package/dist/subsystem/__fixtures__/c4SketchGallery.js +312 -0
- package/dist/subsystem/__fixtures__/c4SketchGallery.js.map +1 -0
- package/dist/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +777 -0
- package/dist/subsystem/__fixtures__/c4Sketches/openbot.json +886 -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 +56 -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 +1 -1
- package/src/stories/Canvases/Subsystem/CustomEntities.stories.tsx +1 -1
- 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 +1 -1
- 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 +3 -228
- 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 +3 -61
- 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 +1 -1
- package/src/stories/Canvases/Subsystem/Reorder.stories.tsx +3 -153
- package/src/stories/Canvases/Subsystem/ReorderPanel.stories.tsx +75 -0
- package/src/stories/Canvases/Subsystem/Scenarios.stories.tsx +1 -1
- 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 +1 -1
- package/src/stories/Canvases/Subsystem/TrailSidebarViews.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/Trails.stories.tsx +1 -1
- 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/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 +107 -37
- package/src/subsystem/C4SketchView.tsx +96 -74
- package/src/subsystem/DescriptionOverlay.test.tsx +2 -0
- package/src/subsystem/DescriptionOverlay.tsx +20 -5
- package/src/subsystem/DescriptionPreview.tsx +96 -0
- package/src/subsystem/SubsystemComponentGraph.sidebar.test.tsx +1 -1
- package/src/subsystem/SubsystemComponentGraph.tsx +14 -43
- package/src/subsystem/__fixtures__/c4Sketch.ts +2 -0
- package/src/subsystem/__fixtures__/c4SketchGallery.test.ts +65 -0
- package/src/subsystem/__fixtures__/c4SketchGallery.ts +351 -0
- package/src/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +777 -0
- package/src/subsystem/__fixtures__/c4Sketches/openbot.json +886 -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,124 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import '@xyflow/react/dist/style.css';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { ReactFlowProvider } from '@xyflow/react';
|
|
5
|
+
import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
|
|
6
|
+
import { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
|
|
7
|
+
import type { SubsystemComponent } from '../../../subsystem/model';
|
|
8
|
+
import { trailFromSteps } from './fixtures';
|
|
9
|
+
|
|
10
|
+
const PURL = 'pkg:github/principal-ai/subsystem-modeling';
|
|
11
|
+
|
|
12
|
+
const meta = {
|
|
13
|
+
title: 'Canvases/Subsystem/Views/Deprecated',
|
|
14
|
+
parameters: { layout: 'fullscreen' },
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
decorators: [
|
|
17
|
+
(Story) => (
|
|
18
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
19
|
+
<ReactFlowProvider>
|
|
20
|
+
<Story />
|
|
21
|
+
</ReactFlowProvider>
|
|
22
|
+
</ThemeProvider>
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
} satisfies Meta;
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Full graph: live audit calling a deleted topology audit, which called two
|
|
32
|
+
// more deleted helpers. Mirrors the real wedged model.
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
const deprecatedComponents: SubsystemComponent[] = [
|
|
35
|
+
{
|
|
36
|
+
alias: 'audit',
|
|
37
|
+
name: 'auditSubsystemModel',
|
|
38
|
+
construct: 'function',
|
|
39
|
+
file: 'src/bun/verify-subsystem-component.ts',
|
|
40
|
+
purl: PURL,
|
|
41
|
+
symbol: 'auditSubsystemModel',
|
|
42
|
+
purpose: 'Deterministic dry-run audit of a stored model',
|
|
43
|
+
role: 'entry',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
alias: 'topology',
|
|
47
|
+
name: 'auditTopologyRelations',
|
|
48
|
+
construct: 'function',
|
|
49
|
+
file: 'src/bun/topology-audit.ts',
|
|
50
|
+
purl: PURL,
|
|
51
|
+
symbol: 'auditTopologyRelations',
|
|
52
|
+
purpose: 'Orchestrates relations[] endpoint checks',
|
|
53
|
+
deprecated: true,
|
|
54
|
+
removedIn: {
|
|
55
|
+
commit: 'e168afc',
|
|
56
|
+
reason: 'Remove topology relations; nest module boundaries by path',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
alias: 'topo-relation',
|
|
61
|
+
name: 'graphifyHasRelationBetween',
|
|
62
|
+
construct: 'function',
|
|
63
|
+
file: 'src/bun/topology-audit.ts',
|
|
64
|
+
purl: PURL,
|
|
65
|
+
symbol: 'graphifyHasRelationBetween',
|
|
66
|
+
purpose: 'True when Graphify records a relation between two nodes',
|
|
67
|
+
deprecated: true,
|
|
68
|
+
removedIn: {
|
|
69
|
+
commit: 'e168afc',
|
|
70
|
+
reason: 'Remove topology relations; nest module boundaries by path',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
alias: 'topo-hints',
|
|
75
|
+
name: 'graphifyHasRelationTowardHints',
|
|
76
|
+
construct: 'function',
|
|
77
|
+
file: 'src/bun/topology-audit.ts',
|
|
78
|
+
purl: PURL,
|
|
79
|
+
symbol: 'graphifyHasRelationTowardHints',
|
|
80
|
+
purpose: 'Relation hints directed at a component',
|
|
81
|
+
deprecated: true,
|
|
82
|
+
removedIn: { commit: 'e168afc' },
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
alias: 'boundary',
|
|
86
|
+
name: 'auditBoundaryFields',
|
|
87
|
+
construct: 'function',
|
|
88
|
+
file: 'src/bun/boundary-audit.ts',
|
|
89
|
+
purl: PURL,
|
|
90
|
+
symbol: 'auditBoundaryFields',
|
|
91
|
+
purpose: 'Package/module containment + process checks',
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
const deprecatedTrails = [
|
|
96
|
+
trailFromSteps('audit-steps', 'Audit (dry-run, graphify-backed)', [
|
|
97
|
+
['audit', 'topology', 'calls', 'src/bun/verify-subsystem-component.ts', 1],
|
|
98
|
+
['audit', 'boundary', 'calls', 'src/bun/verify-subsystem-component.ts', 1],
|
|
99
|
+
['topology', 'topo-relation', 'calls', 'src/bun/topology-audit.ts', 1],
|
|
100
|
+
['topology', 'topo-hints', 'calls', 'src/bun/topology-audit.ts', 1],
|
|
101
|
+
]),
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
function DeprecatedDemo() {
|
|
105
|
+
const [selected, setSelected] = useState<string | null>(null);
|
|
106
|
+
return (
|
|
107
|
+
<div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
|
|
108
|
+
<SubsystemComponentGraph
|
|
109
|
+
components={deprecatedComponents}
|
|
110
|
+
trails={deprecatedTrails}
|
|
111
|
+
onSelect={(id) => setSelected(id)}
|
|
112
|
+
/>
|
|
113
|
+
<div style={{ marginTop: 8, padding: '0 12px', fontFamily: 'monospace', fontSize: 12, color: '#aaa' }}>
|
|
114
|
+
Click a slate `deprecated` badge to open the removal provenance
|
|
115
|
+
{selected ? ` · selected: ${selected}` : ''}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Full graph: the deleted topology subtree still wired into a live audit. */
|
|
122
|
+
export const RemovedSubtree: Story = {
|
|
123
|
+
render: () => <DeprecatedDemo />,
|
|
124
|
+
};
|
|
@@ -12,7 +12,7 @@ import resolveSource from '../../../graphify/resolve.ts?raw';
|
|
|
12
12
|
import { readerDetail } from './fixtures';
|
|
13
13
|
|
|
14
14
|
const meta = {
|
|
15
|
-
title: 'Canvases/Subsystem/DetailPanel',
|
|
15
|
+
title: 'Canvases/Subsystem/Views/DetailPanel',
|
|
16
16
|
component: SubsystemComponentGraph,
|
|
17
17
|
parameters: {
|
|
18
18
|
layout: 'fullscreen',
|
|
@@ -3,14 +3,10 @@ import React from 'react';
|
|
|
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
|
-
SubsystemDiagnosticToggle,
|
|
8
|
-
type SubsystemDiagnosticStatus,
|
|
9
|
-
} from '../../../subsystem/DiagnosticToggle';
|
|
10
6
|
import { components, graphSpecFromSteps } from './fixtures';
|
|
11
7
|
|
|
12
8
|
const meta = {
|
|
13
|
-
title: 'Canvases/Subsystem/Diagnostics',
|
|
9
|
+
title: 'Canvases/Subsystem/Views/Diagnostics',
|
|
14
10
|
component: SubsystemComponentGraph,
|
|
15
11
|
parameters: {
|
|
16
12
|
layout: 'fullscreen',
|
|
@@ -43,44 +39,6 @@ const graphEdges = graphSpecFromSteps([
|
|
|
43
39
|
const GRAPH_DESCRIPTION =
|
|
44
40
|
'A small e-commerce checkout subsystem: an HTTP entry point that writes to retained cart state and calls out to Stripe.';
|
|
45
41
|
|
|
46
|
-
/** Every chip state side by side, for quick visual review. */
|
|
47
|
-
export const States: Story = {
|
|
48
|
-
render: () => {
|
|
49
|
-
const rows: Array<{ label: string; status: SubsystemDiagnosticStatus; issueCount?: number; fixableCount?: number; stale?: boolean; busy?: boolean }> = [
|
|
50
|
-
{ label: 'ok', status: 'ok' },
|
|
51
|
-
{ label: 'ok (stale)', status: 'ok', stale: true },
|
|
52
|
-
{ label: 'issues · 3', status: 'issues', issueCount: 3 },
|
|
53
|
-
{ label: 'gaps · 2', status: 'gaps', issueCount: 2 },
|
|
54
|
-
{ label: 'unknown (never checked)', status: 'unknown' },
|
|
55
|
-
{ label: 'issues (busy)', status: 'issues', issueCount: 3, busy: true },
|
|
56
|
-
{ label: 'issues · 7, 7 fixable', status: 'issues', issueCount: 7, fixableCount: 7 },
|
|
57
|
-
{ label: 'issues · 4, 2 fixable', status: 'issues', issueCount: 4, fixableCount: 2 },
|
|
58
|
-
{ label: 'issues · 2, fixable + stale', status: 'issues', issueCount: 2, fixableCount: 2, stale: true },
|
|
59
|
-
{ label: 'issues · 120, fixable capped', status: 'issues', issueCount: 120, fixableCount: 120 },
|
|
60
|
-
{ label: 'issues (busy) hides badge', status: 'issues', issueCount: 3, fixableCount: 3, busy: true },
|
|
61
|
-
];
|
|
62
|
-
return (
|
|
63
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: 18, padding: 32 }}>
|
|
64
|
-
{rows.map((row) => (
|
|
65
|
-
<div key={row.label} style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
|
66
|
-
<span style={{ width: 220, fontFamily: 'monospace', fontSize: 12, opacity: 0.7 }}>
|
|
67
|
-
{row.label}
|
|
68
|
-
</span>
|
|
69
|
-
<SubsystemDiagnosticToggle
|
|
70
|
-
status={row.status}
|
|
71
|
-
issueCount={row.issueCount}
|
|
72
|
-
fixableCount={row.fixableCount}
|
|
73
|
-
stale={row.stale}
|
|
74
|
-
busy={row.busy}
|
|
75
|
-
onToggle={() => {}}
|
|
76
|
-
/>
|
|
77
|
-
</div>
|
|
78
|
-
))}
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
42
|
/**
|
|
85
43
|
* The real case that motivated the badge: seven re-pin findings, every one a
|
|
86
44
|
* one-click fix the construct-fixer defers to the human. The chip announces
|
|
@@ -0,0 +1,63 @@
|
|
|
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 {
|
|
6
|
+
SubsystemDiagnosticToggle,
|
|
7
|
+
type SubsystemDiagnosticStatus,
|
|
8
|
+
} from '../../../subsystem/DiagnosticToggle';
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Canvases/Subsystem/UI Isolation/Diagnostics',
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: 'fullscreen',
|
|
14
|
+
},
|
|
15
|
+
decorators: [
|
|
16
|
+
(Story) => (
|
|
17
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
18
|
+
<Story />
|
|
19
|
+
</ThemeProvider>
|
|
20
|
+
),
|
|
21
|
+
],
|
|
22
|
+
} satisfies Meta;
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
|
|
27
|
+
/** Every chip state side by side, for quick visual review. */
|
|
28
|
+
export const States: Story = {
|
|
29
|
+
render: () => {
|
|
30
|
+
const rows: Array<{ label: string; status: SubsystemDiagnosticStatus; issueCount?: number; fixableCount?: number; stale?: boolean; busy?: boolean }> = [
|
|
31
|
+
{ label: 'ok', status: 'ok' },
|
|
32
|
+
{ label: 'ok (stale)', status: 'ok', stale: true },
|
|
33
|
+
{ label: 'issues · 3', status: 'issues', issueCount: 3 },
|
|
34
|
+
{ label: 'gaps · 2', status: 'gaps', issueCount: 2 },
|
|
35
|
+
{ label: 'unknown (never checked)', status: 'unknown' },
|
|
36
|
+
{ label: 'issues (busy)', status: 'issues', issueCount: 3, busy: true },
|
|
37
|
+
{ label: 'issues · 7, 7 fixable', status: 'issues', issueCount: 7, fixableCount: 7 },
|
|
38
|
+
{ label: 'issues · 4, 2 fixable', status: 'issues', issueCount: 4, fixableCount: 2 },
|
|
39
|
+
{ label: 'issues · 2, fixable + stale', status: 'issues', issueCount: 2, fixableCount: 2, stale: true },
|
|
40
|
+
{ label: 'issues · 120, fixable capped', status: 'issues', issueCount: 120, fixableCount: 120 },
|
|
41
|
+
{ label: 'issues (busy) hides badge', status: 'issues', issueCount: 3, fixableCount: 3, busy: true },
|
|
42
|
+
];
|
|
43
|
+
return (
|
|
44
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 18, padding: 32 }}>
|
|
45
|
+
{rows.map((row) => (
|
|
46
|
+
<div key={row.label} style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
|
|
47
|
+
<span style={{ width: 220, fontFamily: 'monospace', fontSize: 12, opacity: 0.7 }}>
|
|
48
|
+
{row.label}
|
|
49
|
+
</span>
|
|
50
|
+
<SubsystemDiagnosticToggle
|
|
51
|
+
status={row.status}
|
|
52
|
+
issueCount={row.issueCount}
|
|
53
|
+
fixableCount={row.fixableCount}
|
|
54
|
+
stale={row.stale}
|
|
55
|
+
busy={row.busy}
|
|
56
|
+
onToggle={() => {}}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -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: 'Canvases/Subsystem/EdgeViews',
|
|
10
|
+
title: 'Canvases/Subsystem/Views/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: 'Canvases/Subsystem/FrameworkStereotype',
|
|
9
|
+
title: 'Canvases/Subsystem/Views/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: 'Canvases/Subsystem/GraphTitle',
|
|
9
|
+
title: 'Canvases/Subsystem/Views/GraphTitle',
|
|
10
10
|
component: SubsystemComponentGraph,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'fullscreen',
|
|
@@ -36,24 +36,6 @@ const graphOnlyEdges = graphSpecFromSteps([
|
|
|
36
36
|
['entry', 'stripe', 'calls'],
|
|
37
37
|
]);
|
|
38
38
|
|
|
39
|
-
function GraphOnly() {
|
|
40
|
-
return (
|
|
41
|
-
<div style={{ width: '100%', height: '100vh' }}>
|
|
42
|
-
<SubsystemComponentGraph
|
|
43
|
-
components={graphOnlyComponents}
|
|
44
|
-
trails={graphOnlyEdges.trails}
|
|
45
|
-
graphTitle="Checkout"
|
|
46
|
-
hideSidebar
|
|
47
|
-
/>
|
|
48
|
-
</div>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** The hero configuration: no sidebar, subsystem name as a canvas chip. */
|
|
53
|
-
export const GraphOnlyWithTitle: Story = {
|
|
54
|
-
render: () => <GraphOnly />,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
39
|
/** Full-width name header above the graph and its description/trails sidebar. */
|
|
58
40
|
export const WithSidebar: Story = {
|
|
59
41
|
render: () => (
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { SubsystemComponentGraph } from '../../../subsystem/SubsystemComponentGraph';
|
|
6
|
+
import { components, graphSpecFromSteps } from './fixtures';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Canvases/Subsystem/Graphs/GraphTitle',
|
|
10
|
+
component: SubsystemComponentGraph,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'fullscreen',
|
|
13
|
+
},
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
17
|
+
<Story />
|
|
18
|
+
</ThemeProvider>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
21
|
+
} satisfies Meta<typeof SubsystemComponentGraph>;
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
const componentsSpec = components([
|
|
27
|
+
['entry', 'checkoutApi', 'function', 'src/checkout/api.ts', 'pkg:github/you/your-app', 'Handles cart requests.', 'checkoutApi'],
|
|
28
|
+
['store', 'cartStore', 'store', 'src/checkout/cartStore.ts', 'pkg:github/you/your-app', 'Retained cart state.', 'cartStore'],
|
|
29
|
+
['stripe', 'Stripe', 'external', '', 'external', undefined, undefined],
|
|
30
|
+
['caller', 'Web client', 'external', '', 'external', undefined, undefined],
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
const edges = graphSpecFromSteps([
|
|
34
|
+
['caller', 'entry', 'calls'],
|
|
35
|
+
['entry', 'store', 'writes'],
|
|
36
|
+
['entry', 'stripe', 'calls'],
|
|
37
|
+
]);
|
|
38
|
+
|
|
39
|
+
/** The hero configuration: no sidebar, subsystem name as a canvas chip. */
|
|
40
|
+
export const GraphOnlyWithTitle: Story = {
|
|
41
|
+
render: () => (
|
|
42
|
+
<div style={{ width: '100%', height: '100vh' }}>
|
|
43
|
+
<SubsystemComponentGraph
|
|
44
|
+
components={componentsSpec}
|
|
45
|
+
trails={edges.trails}
|
|
46
|
+
graphTitle="Checkout"
|
|
47
|
+
hideSidebar
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
),
|
|
51
|
+
};
|
|
@@ -3,14 +3,15 @@ import React, { useMemo, useState } from 'react';
|
|
|
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 {
|
|
6
|
+
import { issueCategory, type SubsystemIssue, type SubsystemIssueCategory } from '../../../subsystem/IssueList';
|
|
7
7
|
import { verifyProcessBoundaries, verificationIssues } from '../../../subsystem/c4Evidence';
|
|
8
8
|
import { getSubsystemRegions, type SubsystemComponent, type SubsystemTrail } from '../../../subsystem/model';
|
|
9
9
|
import type { C4Container } from '../../../subsystem/c4';
|
|
10
10
|
import { components, graphSpecFromSteps } from './fixtures';
|
|
11
|
+
import { ISSUES } from './issuesFixtures';
|
|
11
12
|
|
|
12
13
|
const meta = {
|
|
13
|
-
title: 'Canvases/Subsystem/Issues',
|
|
14
|
+
title: 'Canvases/Subsystem/Views/Issues',
|
|
14
15
|
component: SubsystemComponentGraph,
|
|
15
16
|
parameters: {
|
|
16
17
|
layout: 'fullscreen',
|
|
@@ -27,142 +28,6 @@ const meta = {
|
|
|
27
28
|
export default meta;
|
|
28
29
|
type Story = StoryObj<typeof meta>;
|
|
29
30
|
|
|
30
|
-
const ISSUES: SubsystemIssue[] = [
|
|
31
|
-
{
|
|
32
|
-
id: 'i1',
|
|
33
|
-
severity: 'error',
|
|
34
|
-
kind: 'missing_file',
|
|
35
|
-
message: 'File src/checkout/cartStore.ts is not present on disk (repo pkg:github/you/your-app).',
|
|
36
|
-
target: { kind: 'component', id: 'store', label: 'cartStore' },
|
|
37
|
-
fix: { label: 'Use graphify file' },
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'i2',
|
|
41
|
-
severity: 'error',
|
|
42
|
-
kind: 'construct_mismatch',
|
|
43
|
-
message: 'Claimed function but graphify infers class.',
|
|
44
|
-
target: { kind: 'component', id: 'entry', label: 'checkoutApi' },
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: 'i3',
|
|
48
|
-
severity: 'info',
|
|
49
|
-
kind: 'signature_unconfirmed',
|
|
50
|
-
message: 'Named parameter types are not present in the graphify cache.',
|
|
51
|
-
target: { kind: 'component', id: 'entry', label: 'checkoutApi' },
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: 'i5',
|
|
55
|
-
severity: 'info',
|
|
56
|
-
kind: 'boundary_module_file_mismatch',
|
|
57
|
-
message: 'Module "src/checkout" contains a file outside its declared root.',
|
|
58
|
-
target: { kind: 'module', id: 'src/checkout', label: 'src/checkout' },
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: 'i6',
|
|
62
|
-
severity: 'info',
|
|
63
|
-
kind: 'trail',
|
|
64
|
-
message: 'Step 2 references a line that moved (was :42).',
|
|
65
|
-
target: {
|
|
66
|
-
kind: 'step',
|
|
67
|
-
id: 'story-steps',
|
|
68
|
-
label: 'Story steps',
|
|
69
|
-
detail: 'step 2',
|
|
70
|
-
stepIndex: 1,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: 'i20',
|
|
75
|
-
severity: 'error',
|
|
76
|
-
kind: 'step_span_unconfirmed',
|
|
77
|
-
message: 'Trail "Story steps" step 1: step span not captured (entry → store via writes)',
|
|
78
|
-
target: {
|
|
79
|
-
kind: 'step',
|
|
80
|
-
id: 'story-steps',
|
|
81
|
-
label: 'Story steps',
|
|
82
|
-
detail: 'step 1',
|
|
83
|
-
stepIndex: 0,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
id: 'i21',
|
|
88
|
-
severity: 'info',
|
|
89
|
-
kind: 'step_span_stale',
|
|
90
|
-
message: 'Trail "Story steps" step 2: step span changed since verification (lines 42-44 in src/checkout/api.ts)',
|
|
91
|
-
target: {
|
|
92
|
-
kind: 'step',
|
|
93
|
-
id: 'story-steps',
|
|
94
|
-
label: 'Story steps',
|
|
95
|
-
detail: 'step 2',
|
|
96
|
-
stepIndex: 1,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: 'i7',
|
|
101
|
-
severity: 'info',
|
|
102
|
-
kind: 'boundary_process_nest_disagree',
|
|
103
|
-
message:
|
|
104
|
-
'module "src/host/main.ts" members claim different processes: "host", "renderer"',
|
|
105
|
-
target: { kind: 'module', id: 'src/host/main.ts', label: 'src/host/main.ts' },
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: 'i17',
|
|
109
|
-
severity: 'error',
|
|
110
|
-
kind: 'symbol_ambiguous',
|
|
111
|
-
message: 'Multiple Graphify nodes match readSession (3 candidates)',
|
|
112
|
-
target: { kind: 'component', id: 'session-reader', label: 'SessionReader' },
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
id: 'i18',
|
|
116
|
-
severity: 'error',
|
|
117
|
-
kind: 'symbol_unmatched',
|
|
118
|
-
message: 'No Graphify node matches symbol persistSession in src/session/SessionStore.ts',
|
|
119
|
-
target: { kind: 'component', id: 'session-store', label: 'SessionStore' },
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
id: 'i9',
|
|
123
|
-
severity: 'info',
|
|
124
|
-
kind: 'construct_span_stale',
|
|
125
|
-
message: 'Declaration moved since capture — recorded start line 42, now 57.',
|
|
126
|
-
target: { kind: 'component', id: 'session-store', label: 'SessionStore' },
|
|
127
|
-
fix: { label: 'Re-pin declaration' },
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
id: 'i10',
|
|
131
|
-
severity: 'info',
|
|
132
|
-
kind: 'construct_unconfirmed',
|
|
133
|
-
message: 'Graphify anchored the node but left the construct unclassified (interface vs type alias).',
|
|
134
|
-
target: { kind: 'component', id: 'host-info', label: 'HostInfo' },
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
id: 'i22',
|
|
138
|
-
severity: 'error',
|
|
139
|
-
kind: 'construct_span_unconfirmed',
|
|
140
|
-
message: 'HostInfo has no captured source span — its declaration extent is unpinned until an agent proposes start/end lines.',
|
|
141
|
-
target: { kind: 'component', id: 'host-info', label: 'HostInfo' },
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'i11',
|
|
145
|
-
severity: 'error',
|
|
146
|
-
kind: 'signature_mismatch',
|
|
147
|
-
message: 'Claimed (req: HostInfo) => Session; Graphify has (string) => void.',
|
|
148
|
-
target: { kind: 'component', id: 'entry', label: 'checkoutApi' },
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: 'i13',
|
|
152
|
-
severity: 'info',
|
|
153
|
-
kind: 'repo_unresolved',
|
|
154
|
-
message: 'Repo pkg:github/acme/worker is not available locally — clone it to verify its components',
|
|
155
|
-
target: { kind: 'repo', id: 'pkg:github/acme/worker', label: 'pkg:github/acme/worker' },
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
id: 'i19',
|
|
159
|
-
severity: 'info',
|
|
160
|
-
kind: 'graphify_unavailable',
|
|
161
|
-
message: 'Graphify cache missing for pkg:github/you/your-app — build it to verify constructs and anchors',
|
|
162
|
-
target: { kind: 'repo', id: 'pkg:github/you/your-app', label: 'pkg:github/you/your-app' },
|
|
163
|
-
},
|
|
164
|
-
];
|
|
165
|
-
|
|
166
31
|
const graphComponents = components([
|
|
167
32
|
['entry', 'checkoutApi', 'function', 'src/checkout/api.ts', 'pkg:github/you/your-app', 'Handles cart requests.', 'checkoutApi'],
|
|
168
33
|
['store', 'cartStore', 'store', 'src/checkout/cartStore.ts', 'pkg:github/you/your-app', 'Retained cart state.', 'cartStore'],
|
|
@@ -174,28 +39,6 @@ const graphEdges = graphSpecFromSteps([
|
|
|
174
39
|
['entry', 'stripe', 'calls'],
|
|
175
40
|
]);
|
|
176
41
|
|
|
177
|
-
/** The catalogue, grouped by verification layer. */
|
|
178
|
-
export const List: Story = {
|
|
179
|
-
render: () => (
|
|
180
|
-
<div style={{ display: 'flex', flexDirection: 'column', width: 380, height: '100vh', borderRight: '1px solid #333' }}>
|
|
181
|
-
<SubsystemIssueList
|
|
182
|
-
issues={ISSUES}
|
|
183
|
-
onSelectIssue={() => {}}
|
|
184
|
-
onApplyFix={() => {}}
|
|
185
|
-
/>
|
|
186
|
-
</div>
|
|
187
|
-
),
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
/** All four layers clean — the happy state. */
|
|
191
|
-
export const AllGood: Story = {
|
|
192
|
-
render: () => (
|
|
193
|
-
<div style={{ display: 'flex', flexDirection: 'column', width: 380, height: '100vh', borderRight: '1px solid #333' }}>
|
|
194
|
-
<SubsystemIssueList issues={[]} />
|
|
195
|
-
</div>
|
|
196
|
-
),
|
|
197
|
-
};
|
|
198
|
-
|
|
199
42
|
/** In place: diagnostics active, so the sidebar bottom panel is the issue list. */
|
|
200
43
|
export const GraphWithIssues: Story = {
|
|
201
44
|
render: () => (
|
|
@@ -219,74 +62,6 @@ export const GraphWithIssues: Story = {
|
|
|
219
62
|
};
|
|
220
63
|
|
|
221
64
|
/** Trail step verification findings — unconfirmed and stale call sites. */
|
|
222
|
-
const TRAIL_STEP_ISSUES: SubsystemIssue[] = [
|
|
223
|
-
{
|
|
224
|
-
id: 'ts1',
|
|
225
|
-
severity: 'info',
|
|
226
|
-
kind: 'step_span_unconfirmed',
|
|
227
|
-
message: 'Trail "Add to Cart" step 1: call site not verified (addToCart → cartStore via writes)',
|
|
228
|
-
target: {
|
|
229
|
-
kind: 'step',
|
|
230
|
-
id: 'add-to-cart',
|
|
231
|
-
label: 'Add to Cart',
|
|
232
|
-
detail: 'step 1',
|
|
233
|
-
stepIndex: 0,
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
id: 'ts2',
|
|
238
|
-
severity: 'info',
|
|
239
|
-
kind: 'step_span_unconfirmed',
|
|
240
|
-
message: 'Trail "Add to Cart" step 2: call site not verified (cartStore → inventoryService via calls)',
|
|
241
|
-
target: {
|
|
242
|
-
kind: 'step',
|
|
243
|
-
id: 'add-to-cart',
|
|
244
|
-
label: 'Add to Cart',
|
|
245
|
-
detail: 'step 2',
|
|
246
|
-
stepIndex: 1,
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
id: 'ts3',
|
|
251
|
-
severity: 'info',
|
|
252
|
-
kind: 'step_span_stale',
|
|
253
|
-
message: 'Trail "Checkout" step 1: call site changed since verification (lines 42-44 in src/checkout/api.ts)',
|
|
254
|
-
target: {
|
|
255
|
-
kind: 'step',
|
|
256
|
-
id: 'checkout',
|
|
257
|
-
label: 'Checkout',
|
|
258
|
-
detail: 'step 1',
|
|
259
|
-
stepIndex: 0,
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
id: 'ts4',
|
|
264
|
-
severity: 'info',
|
|
265
|
-
kind: 'step_span_stale',
|
|
266
|
-
message: 'Trail "Checkout" step 3: call site changed since verification (lines 78-82 in src/checkout/api.ts)',
|
|
267
|
-
target: {
|
|
268
|
-
kind: 'step',
|
|
269
|
-
id: 'checkout',
|
|
270
|
-
label: 'Checkout',
|
|
271
|
-
detail: 'step 3',
|
|
272
|
-
stepIndex: 2,
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
];
|
|
276
|
-
|
|
277
|
-
/** Trail step verification: shows unconfirmed and stale call site findings. */
|
|
278
|
-
export const TrailStepVerification: Story = {
|
|
279
|
-
render: () => (
|
|
280
|
-
<div style={{ display: 'flex', flexDirection: 'column', width: 380, height: '100vh', borderRight: '1px solid #333' }}>
|
|
281
|
-
<SubsystemIssueList
|
|
282
|
-
issues={TRAIL_STEP_ISSUES}
|
|
283
|
-
focusCategory="trail"
|
|
284
|
-
onSelectIssue={() => {}}
|
|
285
|
-
/>
|
|
286
|
-
</div>
|
|
287
|
-
),
|
|
288
|
-
};
|
|
289
|
-
|
|
290
65
|
/** Trail step verification badges on graph edges. */
|
|
291
66
|
const stepVerificationComponents = components([
|
|
292
67
|
['api', 'checkoutApi', 'function', 'src/checkout/api.ts', 'pkg:github/you/your-app', 'Handles cart requests.', 'checkoutApi'],
|