@principal-ai/principal-view-react 0.16.33 → 0.16.34
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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts +3 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +19 -5
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/SubsystemFileTree.d.ts +10 -15
- package/dist/subsystem/SubsystemFileTree.d.ts.map +1 -1
- package/dist/subsystem/SubsystemFileTree.js +96 -93
- package/dist/subsystem/SubsystemFileTree.js.map +1 -1
- package/dist/subsystem/model.d.ts +3 -0
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodes.d.ts +2 -0
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +12 -7
- package/dist/subsystem/nodes.js.map +1 -1
- package/package.json +2 -1
- package/src/index.ts +1 -1
- package/src/stories/SubsystemComponentGraph.stories.tsx +10 -2
- package/src/subsystem/SubsystemComponentGraph.tsx +22 -4
- package/src/subsystem/SubsystemFileTree.tsx +102 -141
- package/src/subsystem/model.ts +3 -0
- package/src/subsystem/nodes.tsx +17 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/subsystem/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,UAAU,GAGX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAyEtD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAA0B,EAC1B,IAA4B,EAC5B,YAAqB,EACrB,IAAa;IAEb,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M,GAAG,GAAG,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC;SAClB;QACD,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,GAAI,CAAwB,CAAC,IAA8B,CAAC;YACnE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC;SAClB;KACF;IAED,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -14,6 +14,8 @@ export interface SubsystemGraphCallbacks {
|
|
|
14
14
|
onSelect?: (componentId: string) => void;
|
|
15
15
|
/** Click an edge (or its label) — select the relationship. */
|
|
16
16
|
onEdgeSelect?: (edgeId: string) => void;
|
|
17
|
+
/** Hover a component (null on leave) — associates it with the file tree. */
|
|
18
|
+
onHover?: (componentId: string | null) => void;
|
|
17
19
|
/** Upper bound for node width; nodes grow with content up to this, then wrap. */
|
|
18
20
|
maxNodeWidth?: number;
|
|
19
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/subsystem/nodes.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM7C,CAAC;AAgBF,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,EAAE,uBAA4B,CAAC;AAE/D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/subsystem/nodes.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM7C,CAAC;AAgBF,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/C,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,EAAE,uBAA4B,CAAC;AAE/D,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,kBAAkB,CAAC,2CA+K1E;AAED;;;cAGc;AACd,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,SAAS,GACV,EAAE,SAAS,CAAC,kBAAkB,CAAC,2CAkC/B"}
|
package/dist/subsystem/nodes.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* Subsystem component/group node + edge renderers.
|
|
4
4
|
*
|
|
@@ -46,7 +46,14 @@ export function SubsystemComponentNode(props) {
|
|
|
46
46
|
// Set while a file is open in the drawer: true → spotlight, false → dim,
|
|
47
47
|
// absent (no file open) → neutral.
|
|
48
48
|
const fileMatch = data.fileMatch;
|
|
49
|
-
|
|
49
|
+
const showFileBadges = data.showFileBadges !== false;
|
|
50
|
+
return (_jsxs("div", { onMouseEnter: () => {
|
|
51
|
+
setHover(true);
|
|
52
|
+
SUBSYSTEM_CALLBACKS.onHover?.(c.id);
|
|
53
|
+
}, onMouseLeave: () => {
|
|
54
|
+
setHover(false);
|
|
55
|
+
SUBSYSTEM_CALLBACKS.onHover?.(null);
|
|
56
|
+
}, onClick: (e) => {
|
|
50
57
|
e.stopPropagation();
|
|
51
58
|
SUBSYSTEM_CALLBACKS.onSelect?.(c.id);
|
|
52
59
|
}, style: {
|
|
@@ -82,14 +89,13 @@ export function SubsystemComponentNode(props) {
|
|
|
82
89
|
whiteSpace: 'nowrap',
|
|
83
90
|
fontSize: theme.fontSizes[0] * 0.8,
|
|
84
91
|
fontFamily: theme.fonts.monospace,
|
|
85
|
-
textTransform: 'uppercase',
|
|
86
92
|
letterSpacing: 0.5,
|
|
87
93
|
color,
|
|
88
94
|
background: theme.colors.background,
|
|
89
95
|
border: `1px solid ${theme.colors.border}`,
|
|
90
96
|
borderRadius: 4,
|
|
91
97
|
padding: '1px 6px',
|
|
92
|
-
}, children: [KIND_LABEL[c.kind] ?? c.kind, c.capture && c.capture !== 'edited' ? ` · ${c.capture}` : ''] })), hover && c.purpose && (_jsx("div", { style: {
|
|
98
|
+
}, children: [_jsx("span", { style: { textTransform: 'uppercase' }, children: KIND_LABEL[c.kind] ?? c.kind }), c.file ? ` · ${c.file.split('/').pop()}` : '', c.capture && c.capture !== 'edited' ? ` · ${c.capture}` : ''] })), hover && c.purpose && (_jsx("div", { style: {
|
|
93
99
|
position: 'absolute',
|
|
94
100
|
top: '100%',
|
|
95
101
|
left: 0,
|
|
@@ -116,8 +122,7 @@ export function SubsystemComponentNode(props) {
|
|
|
116
122
|
whiteSpace: 'normal',
|
|
117
123
|
overflowWrap: 'anywhere',
|
|
118
124
|
maxWidth: '100%',
|
|
119
|
-
|
|
120
|
-
fontFamily: c.kind === 'type' ? 'Georgia, "Times New Roman", serif' : theme.fonts.body,
|
|
125
|
+
fontFamily: theme.fonts.body,
|
|
121
126
|
}, children: breakWords(displayName) }), c.symbol && c.symbol !== displayName && (_jsx("div", { style: {
|
|
122
127
|
fontSize: theme.fontSizes[0] * 0.82,
|
|
123
128
|
fontFamily: theme.fonts.monospace,
|
|
@@ -128,7 +133,7 @@ export function SubsystemComponentNode(props) {
|
|
|
128
133
|
overflow: 'hidden',
|
|
129
134
|
textOverflow: 'ellipsis',
|
|
130
135
|
maxWidth: '100%',
|
|
131
|
-
}, title: c.symbol, children: c.symbol })), c.file && (_jsx("div", { onClick: (e) => {
|
|
136
|
+
}, title: c.symbol, children: c.symbol })), c.file && showFileBadges && (_jsx("div", { onClick: (e) => {
|
|
132
137
|
e.stopPropagation();
|
|
133
138
|
SUBSYSTEM_CALLBACKS.onSelect?.(c.id);
|
|
134
139
|
}, style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../src/subsystem/nodes.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,MAAM,EACN,QAAQ,GAGT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EACL,UAAU,EACV,eAAe,EACf,oBAAoB,GAGrB,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,IAA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,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAElC,OAAO,CACL,8BAIE,eACE,CAAC,EAAE,IAAI,EACP,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,aAAa,EACpB,WAAW,EAAE,EAAE,EACf,SAAS,EAAC,8BAA8B,GACxC,EAGF,eACE,CAAC,EAAE,IAAI,EACP,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,GAAG,EAChB,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAC7C,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAChC,IACD,CACJ,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principal-ai/principal-view-react",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.34",
|
|
4
4
|
"description": "React components for graph-based principal view framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@xyflow/react": "^12.11.3",
|
|
18
18
|
"elkjs": "^0.12.0",
|
|
19
|
+
"@pierre/trees": "1.0.0-beta.6",
|
|
19
20
|
"hast-util-sanitize": "^5.0.2",
|
|
20
21
|
"highlight.js": "^11.11.1",
|
|
21
22
|
"js-yaml": "4.1.1",
|
package/src/index.ts
CHANGED
|
@@ -246,7 +246,7 @@ export type {
|
|
|
246
246
|
// Subsystem component graph
|
|
247
247
|
export { SubsystemComponentGraph } from './subsystem/SubsystemComponentGraph';
|
|
248
248
|
export type { SubsystemComponentGraphProps } from './subsystem/SubsystemComponentGraph';
|
|
249
|
-
export { SubsystemFileTree
|
|
249
|
+
export { SubsystemFileTree } from './subsystem/SubsystemFileTree';
|
|
250
250
|
export type { SubsystemFileTreeProps } from './subsystem/SubsystemFileTree';
|
|
251
251
|
export { GraphLayoutCover } from './subsystem/GraphLayoutCover';
|
|
252
252
|
export type { GraphLayoutCoverProps } from './subsystem/GraphLayoutCover';
|
|
@@ -77,6 +77,7 @@ function TwoNodeDemo({ showEdgeLabels = true }: { showEdgeLabels?: boolean }) {
|
|
|
77
77
|
onSelect={(id) => setSelected(id)}
|
|
78
78
|
onEdgeSelect={(e) => setSelectedEdge(e)}
|
|
79
79
|
showEdgeLabels={showEdgeLabels}
|
|
80
|
+
showFileBadges={false}
|
|
80
81
|
/>
|
|
81
82
|
<div style={{ marginTop: 8, fontFamily: 'monospace', fontSize: 12, color: '#aaa' }}>
|
|
82
83
|
{selectedEdge
|
|
@@ -135,7 +136,7 @@ function PlaygroundDemo({ leftCount, rightCount, showEdgeLabels }: { leftCount:
|
|
|
135
136
|
|
|
136
137
|
return (
|
|
137
138
|
<div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
|
|
138
|
-
<SubsystemComponentGraph components={comps} edges={edgeList} showEdgeLabels={showEdgeLabels} />
|
|
139
|
+
<SubsystemComponentGraph components={comps} edges={edgeList} showEdgeLabels={showEdgeLabels} showFileBadges={false} />
|
|
139
140
|
</div>
|
|
140
141
|
);
|
|
141
142
|
}
|
|
@@ -200,6 +201,7 @@ function V2ReaderDemo() {
|
|
|
200
201
|
edges={v2ReaderEdges}
|
|
201
202
|
onSelect={(id) => setSelected(id)}
|
|
202
203
|
onEdgeSelect={(e) => setSelectedEdge(e)}
|
|
204
|
+
showFileBadges={false}
|
|
203
205
|
/>
|
|
204
206
|
<div style={{ marginTop: 8, fontFamily: 'monospace', fontSize: 12, color: '#aaa' }}>
|
|
205
207
|
{selectedEdge
|
|
@@ -310,7 +312,7 @@ const investigateOnlyEdges = edges([
|
|
|
310
312
|
export const InvestigateOnly: Story = {
|
|
311
313
|
render: () => (
|
|
312
314
|
<div style={{ width: '100%', height: '100vh', display: 'flex', flexDirection: 'column' }}>
|
|
313
|
-
<SubsystemComponentGraph components={investigateOnlyComponents} edges={investigateOnlyEdges} />
|
|
315
|
+
<SubsystemComponentGraph components={investigateOnlyComponents} edges={investigateOnlyEdges} showFileBadges={false} />
|
|
314
316
|
</div>
|
|
315
317
|
),
|
|
316
318
|
};
|
|
@@ -323,6 +325,7 @@ export const NarrowMaxWidth: Story = {
|
|
|
323
325
|
components={investigateOnlyComponents}
|
|
324
326
|
edges={investigateOnlyEdges}
|
|
325
327
|
maxNodeWidth={140}
|
|
328
|
+
showFileBadges={false}
|
|
326
329
|
/>
|
|
327
330
|
</div>
|
|
328
331
|
),
|
|
@@ -391,6 +394,7 @@ export const NamingConventions: Story = {
|
|
|
391
394
|
components={namingConventionComponents}
|
|
392
395
|
edges={[]}
|
|
393
396
|
maxNodeWidth={180}
|
|
397
|
+
showFileBadges={false}
|
|
394
398
|
/>
|
|
395
399
|
</div>
|
|
396
400
|
),
|
|
@@ -505,6 +509,7 @@ function DetailKindsDemo() {
|
|
|
505
509
|
components={detailKindComponents}
|
|
506
510
|
edges={[]}
|
|
507
511
|
onSelect={(id) => setSelected(id)}
|
|
512
|
+
showFileBadges={false}
|
|
508
513
|
/>
|
|
509
514
|
<div style={{ marginTop: 8, fontFamily: 'monospace', fontSize: 12, color: '#aaa' }}>
|
|
510
515
|
{selected ? `selected: ${selected}` : 'click a component to see its GraphifyComponentDetail'}
|
|
@@ -580,6 +585,7 @@ function MinimalVsResolvedDemo({ resolved }: { resolved: boolean }) {
|
|
|
580
585
|
components={resolved ? resolvedComponents : minimalComponents}
|
|
581
586
|
edges={sharedEdges}
|
|
582
587
|
onSelect={(id) => setSelected(id)}
|
|
588
|
+
showFileBadges={false}
|
|
583
589
|
/>
|
|
584
590
|
<div style={{ marginTop: 8, fontFamily: 'monospace', fontSize: 12, color: '#aaa' }}>
|
|
585
591
|
{resolved
|
|
@@ -656,6 +662,7 @@ function InvestigationDemo() {
|
|
|
656
662
|
components={investigationComponents}
|
|
657
663
|
edges={investigationEdges}
|
|
658
664
|
onSelect={(id) => setSelected(id)}
|
|
665
|
+
showFileBadges={false}
|
|
659
666
|
/>
|
|
660
667
|
<div style={{ marginTop: 8, fontFamily: 'monospace', fontSize: 12, color: '#aaa' }}>
|
|
661
668
|
read-only investigation snapshot (grok 019fd2a9) — components analyzed, not edited
|
|
@@ -747,6 +754,7 @@ function MermaidDemo() {
|
|
|
747
754
|
components={mermaidComponents}
|
|
748
755
|
edges={mermaidEdges}
|
|
749
756
|
onSelect={(id) => setSelected(id)}
|
|
757
|
+
showFileBadges={false}
|
|
750
758
|
/>
|
|
751
759
|
<div style={{ marginTop: 8, fontFamily: 'monospace', fontSize: 12, color: '#aaa' }}>
|
|
752
760
|
mermaid diagram rendering pipeline — lazy → render → zoom → modal
|
|
@@ -78,6 +78,9 @@ export interface SubsystemComponentGraphProps {
|
|
|
78
78
|
maxNodeWidth?: number;
|
|
79
79
|
/** Show edge labels (mechanism names) on the graph. @default true */
|
|
80
80
|
showEdgeLabels?: boolean;
|
|
81
|
+
/** Show the click-to-open file chip under each component name.
|
|
82
|
+
* @default true */
|
|
83
|
+
showFileBadges?: boolean;
|
|
81
84
|
/** Subsystem title displayed in the sidebar. */
|
|
82
85
|
title?: string;
|
|
83
86
|
/** Markdown description rendered in the sidebar. */
|
|
@@ -120,7 +123,7 @@ interface InnerProps extends SubsystemComponentGraphProps {
|
|
|
120
123
|
measured: { w: number; h: number } | null;
|
|
121
124
|
}
|
|
122
125
|
|
|
123
|
-
function Inner({ components, edges, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, title, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, renderFileView, renderFileViewer, onFileSelect }: InnerProps) {
|
|
126
|
+
function Inner({ components, edges, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showFileBadges, title, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, renderFileView, renderFileViewer, onFileSelect }: InnerProps) {
|
|
124
127
|
const { theme } = useTheme();
|
|
125
128
|
const { fitView } = useReactFlow();
|
|
126
129
|
const viewport = useViewport();
|
|
@@ -132,6 +135,8 @@ function Inner({ components, edges, onSelect, onEdgeSelect, measured: _measured,
|
|
|
132
135
|
const [selected, setSelected] = useState<SubsystemComponent | null>(null);
|
|
133
136
|
// File currently shown in the bottom drawer (repo-root-relative path).
|
|
134
137
|
const [openFile, setOpenFile] = useState<string | null>(null);
|
|
138
|
+
// Component the pointer is over (null on leave) → transient tree highlight.
|
|
139
|
+
const [hoveredComponentId, setHoveredComponentId] = useState<string | null>(null);
|
|
135
140
|
// Ref mirror of `selected` so the SUBSYSTEM_CALLBACKS click handler (a
|
|
136
141
|
// closure over the effect deps) can toggle without a stale value.
|
|
137
142
|
const selectedRef = useRef<SubsystemComponent | null>(null);
|
|
@@ -226,10 +231,12 @@ function Inner({ components, edges, onSelect, onEdgeSelect, measured: _measured,
|
|
|
226
231
|
};
|
|
227
232
|
SUBSYSTEM_CALLBACKS.onEdgeSelect = selectEdge;
|
|
228
233
|
SUBSYSTEM_CALLBACKS.maxNodeWidth = maxNodeWidth;
|
|
234
|
+
SUBSYSTEM_CALLBACKS.onHover = setHoveredComponentId;
|
|
229
235
|
return () => {
|
|
230
236
|
SUBSYSTEM_CALLBACKS.onSelect = undefined;
|
|
231
237
|
SUBSYSTEM_CALLBACKS.onEdgeSelect = undefined;
|
|
232
238
|
SUBSYSTEM_CALLBACKS.maxNodeWidth = undefined;
|
|
239
|
+
SUBSYSTEM_CALLBACKS.onHover = undefined;
|
|
233
240
|
};
|
|
234
241
|
}, [components, onSelect, maxNodeWidth, selectEdge]);
|
|
235
242
|
|
|
@@ -241,15 +248,19 @@ function Inner({ components, edges, onSelect, onEdgeSelect, measured: _measured,
|
|
|
241
248
|
// component lives in that file — the node renderer spotlights matches and
|
|
242
249
|
// dims non-matches (mirrors the edge-dimming behavior on selection).
|
|
243
250
|
const dispNodes = useMemo(() => {
|
|
244
|
-
|
|
245
|
-
|
|
251
|
+
let ns = xyflowNodesBase.map((n) => ({
|
|
252
|
+
...n,
|
|
253
|
+
data: { ...(n.data as object), showFileBadges },
|
|
254
|
+
}));
|
|
255
|
+
if (!openFile) return ns;
|
|
256
|
+
return ns.map((n) => {
|
|
246
257
|
const comp = (n.data as { component?: SubsystemComponent } | undefined)?.component;
|
|
247
258
|
return {
|
|
248
259
|
...n,
|
|
249
260
|
data: { ...(n.data as object), fileMatch: comp?.file === openFile },
|
|
250
261
|
};
|
|
251
262
|
});
|
|
252
|
-
}, [xyflowNodesBase, openFile]);
|
|
263
|
+
}, [xyflowNodesBase, openFile, showFileBadges]);
|
|
253
264
|
|
|
254
265
|
const baseNodesKey = useMemo(() => nodes.map((n) => n.id).sort().join(','), [nodes]);
|
|
255
266
|
const baseEdgesKey = useMemo(
|
|
@@ -401,6 +412,12 @@ function Inner({ components, edges, onSelect, onEdgeSelect, measured: _measured,
|
|
|
401
412
|
[components],
|
|
402
413
|
);
|
|
403
414
|
|
|
415
|
+
// The hovered node's file (null when not hovering / file-less component).
|
|
416
|
+
const hoveredFile = useMemo(() => {
|
|
417
|
+
if (!hoveredComponentId) return null;
|
|
418
|
+
return components.find((c) => c.id === hoveredComponentId)?.file ?? null;
|
|
419
|
+
}, [components, hoveredComponentId]);
|
|
420
|
+
|
|
404
421
|
// Drawer content renderer: prefer the path-keyed viewer; fall back to the
|
|
405
422
|
// legacy component-keyed one via a file → first-component lookup.
|
|
406
423
|
const fileViewer = useMemo(() => {
|
|
@@ -501,6 +518,7 @@ function Inner({ components, edges, onSelect, onEdgeSelect, measured: _measured,
|
|
|
501
518
|
<SubsystemFileTree
|
|
502
519
|
files={files}
|
|
503
520
|
selectedFile={selected?.file ?? openFile}
|
|
521
|
+
hoveredFile={hoveredFile}
|
|
504
522
|
onSelectFile={onTreeSelectFile}
|
|
505
523
|
/>
|
|
506
524
|
)}
|
|
@@ -1,161 +1,107 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SubsystemFileTree —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* SubsystemFileTree — sidebar file tree for a subsystem's components, built
|
|
3
|
+
* on @pierre/trees following the panel repo's SessionFileTreePanel pattern:
|
|
4
|
+
* init-once options + latest-value refs, and a suppress flag around
|
|
5
|
+
* programmatic selection so `onSelectionChange` echoes don't re-open files.
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
|
-
import { useMemo,
|
|
8
|
-
import type {
|
|
9
|
-
import {
|
|
8
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
9
|
+
import type { CSSProperties } from 'react';
|
|
10
|
+
import { FileTree, useFileTree } from '@pierre/trees/react';
|
|
10
11
|
import { useTheme } from '@principal-ade/industry-theme';
|
|
11
12
|
|
|
12
|
-
interface TreeEntry {
|
|
13
|
-
name: string;
|
|
14
|
-
path: string;
|
|
15
|
-
isFile: boolean;
|
|
16
|
-
children: Map<string, TreeEntry>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** Build a nested tree from repo-root-relative file paths (deduped). */
|
|
20
|
-
export function buildFileTree(files: string[]): TreeEntry {
|
|
21
|
-
const root: TreeEntry = { name: '', path: '', isFile: false, children: new Map() };
|
|
22
|
-
for (const file of [...new Set(files)].sort()) {
|
|
23
|
-
const segments = file.split('/').filter(Boolean);
|
|
24
|
-
let node = root;
|
|
25
|
-
segments.forEach((segment, index) => {
|
|
26
|
-
const isFile = index === segments.length - 1;
|
|
27
|
-
const path = node.path ? `${node.path}/${segment}` : segment;
|
|
28
|
-
let child = node.children.get(segment);
|
|
29
|
-
if (!child || child.isFile !== isFile) {
|
|
30
|
-
child = { name: segment, path, isFile, children: new Map() };
|
|
31
|
-
node.children.set(segment, child);
|
|
32
|
-
}
|
|
33
|
-
node = child;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return root;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function sortEntries(node: TreeEntry): TreeEntry[] {
|
|
40
|
-
return Array.from(node.children.values()).sort((a, b) => {
|
|
41
|
-
if (a.isFile !== b.isFile) return a.isFile ? 1 : -1;
|
|
42
|
-
return a.name.localeCompare(b.name);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
13
|
export interface SubsystemFileTreeProps {
|
|
47
14
|
/** Repo-root-relative file paths; duplicates are deduped. */
|
|
48
15
|
files: string[];
|
|
49
|
-
/** File to highlight (
|
|
16
|
+
/** File to select/highlight (the drawer-open file). */
|
|
50
17
|
selectedFile?: string | null;
|
|
51
|
-
/**
|
|
18
|
+
/** File to transiently highlight while its node is hovered on the graph;
|
|
19
|
+
* falls back to `selectedFile` when null. */
|
|
20
|
+
hoveredFile?: string | null;
|
|
21
|
+
/** Called when a file row is clicked; upstream toggles the drawer. */
|
|
52
22
|
onSelectFile?: (file: string) => void;
|
|
53
23
|
}
|
|
54
24
|
|
|
55
25
|
/** Fills its parent height by design — pin it with a sized flex container. */
|
|
56
|
-
export function SubsystemFileTree({ files, selectedFile, onSelectFile }: SubsystemFileTreeProps) {
|
|
26
|
+
export function SubsystemFileTree({ files, selectedFile, hoveredFile, onSelectFile }: SubsystemFileTreeProps) {
|
|
57
27
|
const { theme } = useTheme();
|
|
58
28
|
const muted = theme.colors.textMuted ?? theme.colors.textSecondary;
|
|
59
|
-
const
|
|
60
|
-
const uniqueCount = useMemo(() => new Set(files).size, [files]);
|
|
61
|
-
const [collapsed, setCollapsed] = useState<Set<string>>(() => new Set());
|
|
62
|
-
const [hovered, setHovered] = useState<string | null>(null);
|
|
29
|
+
const paths = useMemo(() => Array.from(new Set(files)).sort(), [files]);
|
|
63
30
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
31
|
+
// Latest-value refs so the stable `onSelectionChange` closure never goes
|
|
32
|
+
// stale — `useFileTree` reads its options once on init.
|
|
33
|
+
const pathSet = useMemo(() => new Set(paths), [paths]);
|
|
34
|
+
const pathSetRef = useRef(pathSet);
|
|
35
|
+
pathSetRef.current = pathSet;
|
|
36
|
+
const onSelectFileRef = useRef(onSelectFile);
|
|
37
|
+
onSelectFileRef.current = onSelectFile;
|
|
38
|
+
const selectedFileRef = useRef<string | null>(selectedFile ?? null);
|
|
39
|
+
selectedFileRef.current = selectedFile ?? null;
|
|
40
|
+
// Suppresses onSelectFile while selection is driven programmatically from
|
|
41
|
+
// the drawer state (`selectedFile`) — no synthetic open/close events.
|
|
42
|
+
const suppressSelectRef = useRef(false);
|
|
43
|
+
const initialPaths = useRef(paths);
|
|
44
|
+
|
|
45
|
+
const { model } = useFileTree({
|
|
46
|
+
paths: initialPaths.current,
|
|
47
|
+
initialExpansion: 'open',
|
|
48
|
+
onSelectionChange: (selected) => {
|
|
49
|
+
if (suppressSelectRef.current) return;
|
|
50
|
+
const raw = selected[selected.length - 1] ?? selected[0];
|
|
51
|
+
if (!raw) return;
|
|
52
|
+
// Directory rows carry a trailing slash; only emit for real files.
|
|
53
|
+
const path = raw.endsWith('/') ? raw.slice(0, -1) : raw;
|
|
54
|
+
if (!pathSetRef.current.has(path)) return;
|
|
55
|
+
// Includes re-clicks on the open row — upstream toggles it closed.
|
|
56
|
+
onSelectFileRef.current?.(path);
|
|
57
|
+
},
|
|
58
|
+
});
|
|
72
59
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
gap: 5,
|
|
89
|
-
width: '100%',
|
|
90
|
-
padding: '1px 6px',
|
|
91
|
-
border: 'none',
|
|
92
|
-
borderRadius: 4,
|
|
93
|
-
background: isSelected || hovered === child.path
|
|
94
|
-
? theme.colors.border
|
|
95
|
-
: 'transparent',
|
|
96
|
-
color: theme.colors.text,
|
|
97
|
-
fontWeight: isSelected ? 600 : 400,
|
|
98
|
-
fontFamily: theme.fonts.monospace,
|
|
99
|
-
fontSize: theme.fontSizes[0],
|
|
100
|
-
lineHeight: '20px',
|
|
101
|
-
textAlign: 'left',
|
|
102
|
-
cursor: 'pointer',
|
|
103
|
-
whiteSpace: 'nowrap',
|
|
104
|
-
overflow: 'hidden',
|
|
105
|
-
textOverflow: 'ellipsis',
|
|
106
|
-
}}
|
|
107
|
-
>
|
|
108
|
-
<span style={{ width: 12, flexShrink: 0 }} />
|
|
109
|
-
<FileText size={11} style={{ flexShrink: 0, opacity: 0.8 }} />
|
|
110
|
-
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>{child.name}</span>
|
|
111
|
-
</button>
|
|
112
|
-
);
|
|
60
|
+
// Reconcile the tree's native selection with the desired highlight: the
|
|
61
|
+
// hovered node's file while hovering, else the drawer-open file. Deselects
|
|
62
|
+
// the previous target and scrolls the new one into view.
|
|
63
|
+
const lastSyncedRef = useRef<string | null>(null);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const target = hoveredFile ?? selectedFile ?? null;
|
|
66
|
+
if (lastSyncedRef.current === target) return;
|
|
67
|
+
const prev = lastSyncedRef.current;
|
|
68
|
+
lastSyncedRef.current = target;
|
|
69
|
+
suppressSelectRef.current = true;
|
|
70
|
+
try {
|
|
71
|
+
if (prev) model.getItem(prev)?.deselect();
|
|
72
|
+
if (target) {
|
|
73
|
+
model.getItem(target)?.select();
|
|
74
|
+
model.scrollToPath(target);
|
|
113
75
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
overflow: 'hidden',
|
|
140
|
-
}}
|
|
141
|
-
>
|
|
142
|
-
<span style={{ width: 12, flexShrink: 0, display: 'inline-flex', justifyContent: 'center' }}>
|
|
143
|
-
{isCollapsed ? <ChevronRight size={10} /> : <ChevronDown size={10} />}
|
|
144
|
-
</span>
|
|
145
|
-
{isCollapsed ? <Folder size={11} style={{ flexShrink: 0 }} /> : <FolderOpen size={11} style={{ flexShrink: 0 }} />}
|
|
146
|
-
<span style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}>{child.name}</span>
|
|
147
|
-
</button>
|
|
148
|
-
{!isCollapsed && (
|
|
149
|
-
<div style={{ paddingLeft: 12 }}>
|
|
150
|
-
{renderEntries(child, depth + 1)}
|
|
151
|
-
</div>
|
|
152
|
-
)}
|
|
153
|
-
</div>
|
|
154
|
-
);
|
|
155
|
-
});
|
|
76
|
+
} finally {
|
|
77
|
+
suppressSelectRef.current = false;
|
|
78
|
+
}
|
|
79
|
+
}, [model, selectedFile, hoveredFile]);
|
|
80
|
+
|
|
81
|
+
// Re-scope the tree in place when the subsystem's file set changes.
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
model.resetPaths(paths);
|
|
84
|
+
}, [model, paths]);
|
|
85
|
+
|
|
86
|
+
// Pierre emits no selection change when the clicked row is already
|
|
87
|
+
// selected — detect re-clicks on the open file's row via focus and let
|
|
88
|
+
// upstream toggle the drawer closed.
|
|
89
|
+
const handleContainerClick = () => {
|
|
90
|
+
const focused = model.getFocusedPath();
|
|
91
|
+
if (!focused) return;
|
|
92
|
+
const path = focused.endsWith('/') ? focused.slice(0, -1) : focused;
|
|
93
|
+
if (path !== selectedFileRef.current) return;
|
|
94
|
+
suppressSelectRef.current = true;
|
|
95
|
+
try {
|
|
96
|
+
onSelectFileRef.current?.(path);
|
|
97
|
+
} finally {
|
|
98
|
+
suppressSelectRef.current = false;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
156
101
|
|
|
157
102
|
return (
|
|
158
103
|
<div
|
|
104
|
+
onClickCapture={handleContainerClick}
|
|
159
105
|
style={{
|
|
160
106
|
height: '50%',
|
|
161
107
|
minHeight: 120,
|
|
@@ -186,12 +132,27 @@ export function SubsystemFileTree({ files, selectedFile, onSelectFile }: Subsyst
|
|
|
186
132
|
Files
|
|
187
133
|
</span>
|
|
188
134
|
<span style={{ fontSize: theme.fontSizes[0] * 0.8, fontFamily: theme.fonts.monospace, color: muted }}>
|
|
189
|
-
{
|
|
135
|
+
{paths.length}
|
|
190
136
|
</span>
|
|
191
137
|
</div>
|
|
192
|
-
<
|
|
193
|
-
{
|
|
194
|
-
|
|
138
|
+
<FileTree
|
|
139
|
+
model={model}
|
|
140
|
+
style={
|
|
141
|
+
{
|
|
142
|
+
flex: 1,
|
|
143
|
+
minHeight: 0,
|
|
144
|
+
'--trees-padding-inline-override': '8px',
|
|
145
|
+
'--trees-bg-override': 'transparent',
|
|
146
|
+
'--trees-fg-override': theme.colors.text,
|
|
147
|
+
'--trees-fg-muted-override': muted,
|
|
148
|
+
'--trees-accent-override': theme.colors.primary,
|
|
149
|
+
'--trees-font-family-override': theme.fonts.monospace,
|
|
150
|
+
'--trees-font-size-override': `${theme.fontSizes[0]}px`,
|
|
151
|
+
'--trees-theme-list-hover-bg': theme.colors.border,
|
|
152
|
+
'--trees-theme-list-active-selection-bg': theme.colors.border,
|
|
153
|
+
} as CSSProperties
|
|
154
|
+
}
|
|
155
|
+
/>
|
|
195
156
|
</div>
|
|
196
157
|
);
|
|
197
158
|
}
|
package/src/subsystem/model.ts
CHANGED
|
@@ -136,6 +136,9 @@ export interface SubsystemGraphNodeData extends Record<string, unknown> {
|
|
|
136
136
|
* lives in that file (spotlighted), false otherwise (dimmed). Absent when
|
|
137
137
|
* no file is open — render neutrally. */
|
|
138
138
|
fileMatch?: boolean;
|
|
139
|
+
/** False hides the click-to-open file chip under the component name.
|
|
140
|
+
* Absent/true renders it (default). */
|
|
141
|
+
showFileBadges?: boolean;
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
export type SubsystemGraphNode = Node<SubsystemGraphNodeData, SubsystemGraphNodeType>;
|