@principal-ai/subsystems-react 0.51.0 → 0.51.1
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 +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/pierre/PierreTrailCodeView.d.ts +1 -1
- package/dist/pierre/PierreTrailCodeView.d.ts.map +1 -1
- package/dist/pierre/PierreTrailCodeView.js +44 -21
- package/dist/pierre/PierreTrailCodeView.js.map +1 -1
- package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.d.ts +493 -0
- package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.d.ts.map +1 -0
- package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.js +329 -0
- package/dist/stories/Subsystem/C4Graph/c4ProposedElements.fixture.js.map +1 -0
- package/dist/subsystem/C4Graph.d.ts +2 -2
- package/dist/subsystem/C4Graph.d.ts.map +1 -1
- package/dist/subsystem/C4Graph.js +25 -16
- package/dist/subsystem/C4Graph.js.map +1 -1
- package/dist/subsystem/C4NodeCard.d.ts +71 -36
- package/dist/subsystem/C4NodeCard.d.ts.map +1 -1
- package/dist/subsystem/C4NodeCard.js +88 -94
- package/dist/subsystem/C4NodeCard.js.map +1 -1
- package/dist/subsystem/FileDrawer.d.ts.map +1 -1
- package/dist/subsystem/FileDrawer.js +20 -21
- package/dist/subsystem/FileDrawer.js.map +1 -1
- package/dist/subsystem/IssueList.js +1 -1
- package/dist/subsystem/IssueList.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +13 -4
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/c4.d.ts +272 -0
- package/dist/subsystem/c4.d.ts.map +1 -0
- package/dist/subsystem/c4.js +322 -0
- package/dist/subsystem/c4.js.map +1 -0
- package/dist/subsystem/c4Evidence.d.ts +143 -0
- package/dist/subsystem/c4Evidence.d.ts.map +1 -0
- package/dist/subsystem/c4Evidence.js +240 -0
- package/dist/subsystem/c4Evidence.js.map +1 -0
- package/dist/subsystem/model.d.ts +2 -6
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js.map +1 -1
- package/package.json +4 -3
- package/src/index.ts +26 -28
- package/src/pierre/PierreTrailCodeView.tsx +49 -21
- package/src/stories/Subsystem/C4Graph/C4NodeGallery.stories.tsx +167 -79
- package/src/stories/Subsystem/C4Graph/ProposedElements.stories.tsx +293 -0
- package/src/stories/Subsystem/C4Graph/c4ProposedElements.fixture.ts +366 -0
- package/src/stories/Subsystem/ComponentGraph/IssueOverlay.stories.tsx +1 -1
- package/src/stories/Subsystem/ComponentGraph/Issues.stories.tsx +1 -1
- package/src/subsystem/C4Graph.tsx +39 -24
- package/src/subsystem/C4NodeCard.test.ts +169 -64
- package/src/subsystem/C4NodeCard.tsx +102 -108
- package/src/subsystem/FileDrawer.tsx +32 -34
- package/src/subsystem/IssueList.tsx +1 -1
- package/src/subsystem/SubsystemComponentGraph.tsx +13 -5
- package/src/subsystem/c4.test.ts +573 -0
- package/src/subsystem/c4.ts +558 -0
- package/src/subsystem/c4Evidence.test.ts +386 -0
- package/src/subsystem/c4Evidence.ts +329 -0
- package/src/subsystem/model.ts +2 -6
- package/dist/stories/Subsystem/C4Graph/c4Associations.fixture.d.ts +0 -95
- package/dist/stories/Subsystem/C4Graph/c4Associations.fixture.d.ts.map +0 -1
- package/dist/stories/Subsystem/C4Graph/c4Associations.fixture.js +0 -340
- package/dist/stories/Subsystem/C4Graph/c4Associations.fixture.js.map +0 -1
- package/dist/stories/Subsystem/C4Graph/c4Fixture.d.ts +0 -7
- package/dist/stories/Subsystem/C4Graph/c4Fixture.d.ts.map +0 -1
- package/dist/stories/Subsystem/C4Graph/c4Fixture.js +0 -7335
- package/dist/stories/Subsystem/C4Graph/c4Fixture.js.map +0 -1
- package/dist/stories/Subsystem/C4Graph/generateFixture.d.ts +0 -2
- package/dist/stories/Subsystem/C4Graph/generateFixture.d.ts.map +0 -1
- package/dist/stories/Subsystem/C4Graph/generateFixture.js +0 -145
- package/dist/stories/Subsystem/C4Graph/generateFixture.js.map +0 -1
- package/dist/subsystem/c4Associations.d.ts +0 -186
- package/dist/subsystem/c4Associations.d.ts.map +0 -1
- package/dist/subsystem/c4Associations.js +0 -284
- package/dist/subsystem/c4Associations.js.map +0 -1
- package/dist/subsystem/toC4.d.ts +0 -214
- package/dist/subsystem/toC4.d.ts.map +0 -1
- package/dist/subsystem/toC4.js +0 -282
- package/dist/subsystem/toC4.js.map +0 -1
- package/src/stories/Subsystem/C4Graph/C4Associations.stories.tsx +0 -273
- package/src/stories/Subsystem/C4Graph/C4Container.stories.tsx +0 -101
- package/src/stories/Subsystem/C4Graph/c4Associations.fixture.ts +0 -344
- package/src/stories/Subsystem/C4Graph/c4Fixture.ts +0 -7339
- package/src/stories/Subsystem/C4Graph/generateFixture.ts +0 -161
- package/src/subsystem/c4Associations.test.ts +0 -484
- package/src/subsystem/c4Associations.ts +0 -398
- package/src/subsystem/toC4.test.ts +0 -114
- package/src/subsystem/toC4.ts +0 -478
|
@@ -117,21 +117,46 @@ export function FileDrawer({
|
|
|
117
117
|
userSelect: "none",
|
|
118
118
|
}}
|
|
119
119
|
>
|
|
120
|
+
{showProgress && progress != null && (
|
|
121
|
+
<div
|
|
122
|
+
role="img"
|
|
123
|
+
aria-label={`Step ${progress.index + 1} of ${progress.total}`}
|
|
124
|
+
style={{
|
|
125
|
+
display: "flex",
|
|
126
|
+
gap: 2,
|
|
127
|
+
flexShrink: 0,
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
{Array.from({ length: progress.total }, (_, i) => (
|
|
131
|
+
<span
|
|
132
|
+
key={i}
|
|
133
|
+
style={{
|
|
134
|
+
flex: 1,
|
|
135
|
+
height: 2,
|
|
136
|
+
borderRadius: 1,
|
|
137
|
+
background:
|
|
138
|
+
i <= progress.index
|
|
139
|
+
? theme.colors.primary
|
|
140
|
+
: theme.colors.border,
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
))}
|
|
144
|
+
</div>
|
|
145
|
+
)}
|
|
120
146
|
<div
|
|
121
147
|
style={{
|
|
122
148
|
display: "flex",
|
|
123
149
|
alignItems: "center",
|
|
124
150
|
gap: 8,
|
|
125
|
-
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
151
|
+
// Top runs deeper than the bottom so the title/label sits
|
|
152
|
+
// optically centered inside the sticky top edge.
|
|
153
|
+
padding: "10px 10px 8px",
|
|
154
|
+
// The header row is the last chrome row now, so its hairline is
|
|
155
|
+
// the boundary with the code below.
|
|
156
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
131
157
|
}}
|
|
132
158
|
>
|
|
133
159
|
<span
|
|
134
|
-
title={title ?? undefined}
|
|
135
160
|
style={{
|
|
136
161
|
flex: 1,
|
|
137
162
|
minWidth: 0,
|
|
@@ -197,33 +222,6 @@ export function FileDrawer({
|
|
|
197
222
|
<X size={14} />
|
|
198
223
|
</button>
|
|
199
224
|
</div>
|
|
200
|
-
{showProgress && progress != null && (
|
|
201
|
-
<div
|
|
202
|
-
role="img"
|
|
203
|
-
aria-label={`Step ${progress.index + 1} of ${progress.total}`}
|
|
204
|
-
style={{
|
|
205
|
-
display: "flex",
|
|
206
|
-
gap: 2,
|
|
207
|
-
flexShrink: 0,
|
|
208
|
-
padding: "0 10px 6px",
|
|
209
|
-
}}
|
|
210
|
-
>
|
|
211
|
-
{Array.from({ length: progress.total }, (_, i) => (
|
|
212
|
-
<span
|
|
213
|
-
key={i}
|
|
214
|
-
style={{
|
|
215
|
-
flex: 1,
|
|
216
|
-
height: 2,
|
|
217
|
-
borderRadius: 1,
|
|
218
|
-
background:
|
|
219
|
-
i <= progress.index
|
|
220
|
-
? theme.colors.primary
|
|
221
|
-
: theme.colors.border,
|
|
222
|
-
}}
|
|
223
|
-
/>
|
|
224
|
-
))}
|
|
225
|
-
</div>
|
|
226
|
-
)}
|
|
227
225
|
</div>
|
|
228
226
|
<div style={{ flex: 1, minHeight: 0, overflow: "auto" }}>
|
|
229
227
|
{children}
|
|
@@ -233,7 +233,7 @@ export function humanizeIssueKind(kind: string): string {
|
|
|
233
233
|
const KIND_LABEL: Record<string, string> = {
|
|
234
234
|
missing_file: 'Construct declaration file missing',
|
|
235
235
|
symbol_ambiguous: 'Multiple construct symbol matches',
|
|
236
|
-
symbol_unmatched: 'Construct symbol
|
|
236
|
+
symbol_unmatched: 'Construct symbol missing',
|
|
237
237
|
stale_declaration: 'Construct declaration drift',
|
|
238
238
|
construct_mismatch: 'Construct type mismatch',
|
|
239
239
|
construct_unconfirmed: 'Construct type unconfirmed',
|
|
@@ -869,16 +869,24 @@ function Inner({ components, trails, graphifyRelations, orderByLine, initialTrai
|
|
|
869
869
|
// the selected step until it does.
|
|
870
870
|
const [visibleStepIndex, setVisibleStepIndex] = useState<number | null>(null);
|
|
871
871
|
const drawerStepIndex = drawerTarget?.kind === 'trail' ? drawerTarget.stepIndex : null;
|
|
872
|
+
// Reset when the drawer switches trail (or closes) — synchronously, so the bar
|
|
873
|
+
// never paints the previous trail's position. A step change *within* the same
|
|
874
|
+
// trail is deliberately not reset: the code view scrolls to the new step and
|
|
875
|
+
// the viewport tracker carries the fill across that scroll. Resetting on step
|
|
876
|
+
// change flashed — the post-paint effect snapped the fill to the target, then
|
|
877
|
+
// Pierre's smooth scroll re-reported the old viewport, bouncing target → old →
|
|
878
|
+
// target.
|
|
879
|
+
const activeTrailId = focusedTrail?.id ?? null;
|
|
880
|
+
const [visibleTrailId, setVisibleTrailId] = useState(activeTrailId);
|
|
881
|
+
if (activeTrailId !== visibleTrailId) {
|
|
882
|
+
setVisibleTrailId(activeTrailId);
|
|
883
|
+
setVisibleStepIndex(null);
|
|
884
|
+
}
|
|
872
885
|
const drawerProgress = useMemo(() => {
|
|
873
886
|
if (drawerStepIndex == null || !focusedTrail) return null;
|
|
874
887
|
return { index: visibleStepIndex ?? drawerStepIndex, total: focusedTrail.steps.length };
|
|
875
888
|
}, [drawerStepIndex, focusedTrail, visibleStepIndex]);
|
|
876
889
|
|
|
877
|
-
// A new trail or step invalidates whatever the last scroll reported.
|
|
878
|
-
useEffect(() => {
|
|
879
|
-
setVisibleStepIndex(null);
|
|
880
|
-
}, [focusedTrail?.id, drawerStepIndex]);
|
|
881
|
-
|
|
882
890
|
// Refresh selected component when the components list updates (e.g. verify
|
|
883
891
|
// writes back declarationRef).
|
|
884
892
|
useEffect(() => {
|