@principal-ai/subsystems-react 0.48.0 → 0.50.0
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/graphify/consolidated.d.ts +7 -1
- package/dist/graphify/consolidated.d.ts.map +1 -1
- package/dist/pierre/PierreFileView.d.ts +1 -1
- package/dist/pierre/PierreFileView.d.ts.map +1 -1
- package/dist/pierre/PierreFileView.js +2 -1
- package/dist/pierre/PierreFileView.js.map +1 -1
- package/dist/pierre/PierreSnippetView.d.ts +1 -1
- package/dist/pierre/PierreSnippetView.d.ts.map +1 -1
- package/dist/pierre/PierreSnippetView.js +2 -1
- package/dist/pierre/PierreSnippetView.js.map +1 -1
- package/dist/pierre/PierreTrailCodeView.d.ts +7 -1
- package/dist/pierre/PierreTrailCodeView.d.ts.map +1 -1
- package/dist/pierre/PierreTrailCodeView.js +71 -18
- package/dist/pierre/PierreTrailCodeView.js.map +1 -1
- package/dist/pierre/pierreBackground.d.ts +36 -2
- package/dist/pierre/pierreBackground.d.ts.map +1 -1
- package/dist/pierre/pierreBackground.js +40 -13
- package/dist/pierre/pierreBackground.js.map +1 -1
- package/dist/pierre/visibleStep.d.ts +48 -0
- package/dist/pierre/visibleStep.d.ts.map +1 -0
- package/dist/pierre/visibleStep.js +53 -0
- package/dist/pierre/visibleStep.js.map +1 -0
- package/dist/subsystem/FileDrawer.d.ts +10 -1
- package/dist/subsystem/FileDrawer.d.ts.map +1 -1
- package/dist/subsystem/FileDrawer.js +61 -40
- package/dist/subsystem/FileDrawer.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts +6 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +21 -10
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.js +10 -2
- package/dist/subsystem/formatDeclaration.js.map +1 -1
- package/dist/subsystem/tokenizeComponent.js +4 -4
- package/dist/subsystem/tokenizeComponent.js.map +1 -1
- package/package.json +3 -3
- package/src/graphify/consolidated.ts +7 -1
- package/src/pierre/PierreFileView.tsx +2 -1
- package/src/pierre/PierreSnippetView.tsx +2 -1
- package/src/pierre/PierreTrailCodeView.tsx +81 -22
- package/src/pierre/pierreBackground.ts +62 -12
- package/src/pierre/visibleStep.test.ts +108 -0
- package/src/pierre/visibleStep.ts +76 -0
- package/src/stories/Subsystem/ComponentGraph/Flows.stories.tsx +6 -0
- package/src/subsystem/FileDrawer.tsx +112 -63
- package/src/subsystem/SubsystemComponentGraph.tsx +29 -5
- package/src/subsystem/formatDeclaration.ts +10 -2
- package/src/subsystem/tokenizeComponent.ts +4 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* visibleStep — pick which step a scroll position should report as current.
|
|
3
|
+
*
|
|
4
|
+
* Kept separate from the component so the geometry can be tested directly:
|
|
5
|
+
* the answer depends on how tall the final snippet is relative to the
|
|
6
|
+
* viewport, which is not something to eyeball.
|
|
7
|
+
*/
|
|
8
|
+
/** Sub-pixel slack so a bottom edge that lands a hair off still counts. */
|
|
9
|
+
export const AT_END_TOLERANCE_PX = 2;
|
|
10
|
+
/**
|
|
11
|
+
* Index of the step to report as current.
|
|
12
|
+
*
|
|
13
|
+
* Normally the topmost step still on screen. The exception is the end of the
|
|
14
|
+
* content: when the final snippet is shorter than the viewport, reaching the
|
|
15
|
+
* bottom still leaves the previous step's tail on screen, and reporting that
|
|
16
|
+
* would strand a progress readout one step short of full.
|
|
17
|
+
*
|
|
18
|
+
* 'At the end' is accepted two ways, because either can be the authoritative
|
|
19
|
+
* one depending on how the view is nested:
|
|
20
|
+
* - the lowest mounted item's bottom edge has entered the container's box, or
|
|
21
|
+
* - the container's own scroll offset has reached its scroll extent.
|
|
22
|
+
*
|
|
23
|
+
* The second signal is only consulted when the container actually scrolls. If
|
|
24
|
+
* an ancestor scrolls instead, `scrollHeight` equals `clientHeight` and
|
|
25
|
+
* `scrollTop` is pinned at 0, which would otherwise read as 'at the end' from
|
|
26
|
+
* the very first pixel.
|
|
27
|
+
*
|
|
28
|
+
* Returns `null` when nothing measurable is on screen.
|
|
29
|
+
*/
|
|
30
|
+
export function resolveVisibleStepIndex(viewport, rects) {
|
|
31
|
+
let topIndex = null;
|
|
32
|
+
let lastIndex = null;
|
|
33
|
+
let lowestBottom = Number.NEGATIVE_INFINITY;
|
|
34
|
+
for (const rect of rects) {
|
|
35
|
+
if (topIndex == null && rect.bottom > viewport.top)
|
|
36
|
+
topIndex = rect.index;
|
|
37
|
+
if (lastIndex == null || rect.index > lastIndex)
|
|
38
|
+
lastIndex = rect.index;
|
|
39
|
+
if (rect.bottom > lowestBottom)
|
|
40
|
+
lowestBottom = rect.bottom;
|
|
41
|
+
}
|
|
42
|
+
if (topIndex == null)
|
|
43
|
+
return null;
|
|
44
|
+
const reachedLastItem = lowestBottom <= viewport.bottom + AT_END_TOLERANCE_PX;
|
|
45
|
+
const containerScrolls = viewport.scrollHeight > viewport.clientHeight;
|
|
46
|
+
const reachedScrollEnd = containerScrolls &&
|
|
47
|
+
viewport.scrollTop + viewport.clientHeight >=
|
|
48
|
+
viewport.scrollHeight - AT_END_TOLERANCE_PX;
|
|
49
|
+
return reachedLastItem || reachedScrollEnd
|
|
50
|
+
? (lastIndex ?? topIndex)
|
|
51
|
+
: topIndex;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=visibleStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibleStep.js","sourceRoot":"","sources":["../../src/pierre/visibleStep.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,uBAAuB,CACrC,QAA6B,EAC7B,KAAiC;IAEjC,IAAI,QAAQ,GAAkB,IAAI,CAAC;IACnC,IAAI,SAAS,GAAkB,IAAI,CAAC;IACpC,IAAI,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAE5C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,IAAI,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG;YAAE,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1E,IAAI,SAAS,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,GAAG,SAAS;YAAE,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;QACxE,IAAI,IAAI,CAAC,MAAM,GAAG,YAAY;YAAE,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;KAC5D;IACD,IAAI,QAAQ,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAElC,MAAM,eAAe,GAAG,YAAY,IAAI,QAAQ,CAAC,MAAM,GAAG,mBAAmB,CAAC;IAC9E,MAAM,gBAAgB,GAAG,QAAQ,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;IACvE,MAAM,gBAAgB,GACpB,gBAAgB;QAChB,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,YAAY;YACxC,QAAQ,CAAC,YAAY,GAAG,mBAAmB,CAAC;IAEhD,OAAO,eAAe,IAAI,gBAAgB;QACxC,CAAC,CAAC,CAAC,SAAS,IAAI,QAAQ,CAAC;QACzB,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC"}
|
|
@@ -13,7 +13,7 @@ export declare const FILE_DRAWER_HEIGHT_MS = 200;
|
|
|
13
13
|
* footprint so the canvas shrinks while open (nothing covered). Stays mounted
|
|
14
14
|
* so open/close/maximize animate. The header's maximize button (or a
|
|
15
15
|
* double-click) grows it over the whole graph column for whole-file reading. */
|
|
16
|
-
export declare function FileDrawer({ title, onClose, fillHeight, suppressEscape, hidden, children, }: {
|
|
16
|
+
export declare function FileDrawer({ title, onClose, fillHeight, suppressEscape, hidden, progress, children, }: {
|
|
17
17
|
/** Drawer chrome title; `null` closes the drawer. */
|
|
18
18
|
title: string | null;
|
|
19
19
|
onClose: () => void;
|
|
@@ -23,6 +23,15 @@ export declare function FileDrawer({ title, onClose, fillHeight, suppressEscape,
|
|
|
23
23
|
suppressEscape?: boolean;
|
|
24
24
|
/** Suppress the drawer entirely — no spacer, no panel (embeds). */
|
|
25
25
|
hidden?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Segmented progress readout for the drawer content, e.g. trail step 2 of 5.
|
|
28
|
+
* Rendered as one tick per step, filled through the current one. Omit for
|
|
29
|
+
* content with no position (a single file).
|
|
30
|
+
*/
|
|
31
|
+
progress?: {
|
|
32
|
+
index: number;
|
|
33
|
+
total: number;
|
|
34
|
+
} | null;
|
|
26
35
|
children?: ReactNode;
|
|
27
36
|
}): import("react").JSX.Element;
|
|
28
37
|
//# sourceMappingURL=FileDrawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDrawer.d.ts","sourceRoot":"","sources":["../../src/subsystem/FileDrawer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;2EAC2E;AAC3E,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;;iFAIiF;AACjF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,UAAkB,EAClB,cAAsB,EACtB,MAAc,EACd,QAAQ,GACT,EAAE;IACD,qDAAqD;IACrD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wEAAwE;IACxE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+
|
|
1
|
+
{"version":3,"file":"FileDrawer.d.ts","sourceRoot":"","sources":["../../src/subsystem/FileDrawer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;2EAC2E;AAC3E,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;;iFAIiF;AACjF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,UAAkB,EAClB,cAAsB,EACtB,MAAc,EACd,QAAe,EACf,QAAQ,GACT,EAAE;IACD,qDAAqD;IACrD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wEAAwE;IACxE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uEAAuE;IACvE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BA2LA"}
|
|
@@ -16,10 +16,11 @@ export const FILE_DRAWER_HEIGHT_MS = 200;
|
|
|
16
16
|
* footprint so the canvas shrinks while open (nothing covered). Stays mounted
|
|
17
17
|
* so open/close/maximize animate. The header's maximize button (or a
|
|
18
18
|
* double-click) grows it over the whole graph column for whole-file reading. */
|
|
19
|
-
export function FileDrawer({ title, onClose, fillHeight = false, suppressEscape = false, hidden = false, children, }) {
|
|
19
|
+
export function FileDrawer({ title, onClose, fillHeight = false, suppressEscape = false, hidden = false, progress = null, children, }) {
|
|
20
20
|
const { theme } = useTheme();
|
|
21
21
|
const muted = theme.colors.textMuted ?? theme.colors.textSecondary;
|
|
22
22
|
const open = title !== null && !hidden;
|
|
23
|
+
const showProgress = progress != null && progress.total > 1;
|
|
23
24
|
const [closeHover, setCloseHover] = useState(false);
|
|
24
25
|
const [maxHover, setMaxHover] = useState(false);
|
|
25
26
|
// Full-height mode: the maximize button or double-clicking the header.
|
|
@@ -67,48 +68,68 @@ export function FileDrawer({ title, onClose, fillHeight = false, suppressEscape
|
|
|
67
68
|
transition: `height ${FILE_DRAWER_HEIGHT_MS}ms ease`,
|
|
68
69
|
}, children: [_jsxs("div", { onDoubleClick: () => setMaximized((v) => !v), style: {
|
|
69
70
|
display: "flex",
|
|
70
|
-
|
|
71
|
-
gap: 8,
|
|
72
|
-
padding: "6px 10px",
|
|
73
|
-
borderBottom: `1px solid ${theme.colors.border}`,
|
|
71
|
+
flexDirection: "column",
|
|
74
72
|
flexShrink: 0,
|
|
75
73
|
cursor: "default",
|
|
76
74
|
userSelect: "none",
|
|
77
|
-
}, children: [
|
|
78
|
-
|
|
79
|
-
minWidth: 0,
|
|
80
|
-
overflow: "hidden",
|
|
81
|
-
textOverflow: "ellipsis",
|
|
82
|
-
whiteSpace: "nowrap",
|
|
83
|
-
fontFamily: theme.fonts.monospace,
|
|
84
|
-
fontSize: theme.fontSizes[0],
|
|
85
|
-
color: muted,
|
|
86
|
-
}, children: title }), _jsx("button", { type: "button", onClick: () => setMaximized((v) => !v), onMouseEnter: () => setMaxHover(true), onMouseLeave: () => setMaxHover(false), "aria-label": maximized ? "Minimize code view" : "Maximize code view", "aria-pressed": maximized, title: maximized ? "Minimize code view" : "Maximize code view", style: {
|
|
87
|
-
display: "inline-flex",
|
|
75
|
+
}, children: [_jsxs("div", { style: {
|
|
76
|
+
display: "flex",
|
|
88
77
|
alignItems: "center",
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
78
|
+
gap: 8,
|
|
79
|
+
padding: "6px 10px",
|
|
80
|
+
// With segments present they form the header's bottom edge, so
|
|
81
|
+
// only draw the hairline when there is nothing to stand in for it.
|
|
82
|
+
borderBottom: showProgress
|
|
83
|
+
? "none"
|
|
84
|
+
: `1px solid ${theme.colors.border}`,
|
|
85
|
+
}, children: [_jsx("span", { title: title ?? undefined, style: {
|
|
86
|
+
flex: 1,
|
|
87
|
+
minWidth: 0,
|
|
88
|
+
overflow: "hidden",
|
|
89
|
+
textOverflow: "ellipsis",
|
|
90
|
+
whiteSpace: "nowrap",
|
|
91
|
+
fontFamily: theme.fonts.monospace,
|
|
92
|
+
fontSize: theme.fontSizes[1],
|
|
93
|
+
fontWeight: 600,
|
|
94
|
+
color: theme.colors.text,
|
|
95
|
+
}, children: title }), _jsx("button", { type: "button", onClick: () => setMaximized((v) => !v), onMouseEnter: () => setMaxHover(true), onMouseLeave: () => setMaxHover(false), "aria-label": maximized ? "Minimize code view" : "Maximize code view", "aria-pressed": maximized, title: maximized ? "Minimize code view" : "Maximize code view", style: {
|
|
96
|
+
display: "inline-flex",
|
|
97
|
+
alignItems: "center",
|
|
98
|
+
justifyContent: "center",
|
|
99
|
+
width: 22,
|
|
100
|
+
height: 22,
|
|
101
|
+
padding: 0,
|
|
102
|
+
border: "none",
|
|
103
|
+
borderRadius: 4,
|
|
104
|
+
background: maxHover ? theme.colors.border : "transparent",
|
|
105
|
+
color: maxHover ? theme.colors.text : muted,
|
|
106
|
+
cursor: "pointer",
|
|
107
|
+
transition: "background 120ms ease, color 120ms ease",
|
|
108
|
+
}, children: maximized ? _jsx(Minimize2, { size: 14 }) : _jsx(Maximize2, { size: 14 }) }), _jsx("button", { type: "button", onClick: onClose, onMouseEnter: () => setCloseHover(true), onMouseLeave: () => setCloseHover(false), "aria-label": "Close file", style: {
|
|
109
|
+
display: "inline-flex",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
justifyContent: "center",
|
|
112
|
+
width: 22,
|
|
113
|
+
height: 22,
|
|
114
|
+
padding: 0,
|
|
115
|
+
border: "none",
|
|
116
|
+
borderRadius: 4,
|
|
117
|
+
background: closeHover ? theme.colors.border : "transparent",
|
|
118
|
+
color: closeHover ? theme.colors.text : muted,
|
|
119
|
+
cursor: "pointer",
|
|
120
|
+
transition: "background 120ms ease, color 120ms ease",
|
|
121
|
+
}, children: _jsx(X, { size: 14 }) })] }), showProgress && progress != null && (_jsx("div", { role: "img", "aria-label": `Step ${progress.index + 1} of ${progress.total}`, style: {
|
|
122
|
+
display: "flex",
|
|
123
|
+
gap: 2,
|
|
124
|
+
flexShrink: 0,
|
|
125
|
+
padding: "0 10px 6px",
|
|
126
|
+
}, children: Array.from({ length: progress.total }, (_, i) => (_jsx("span", { style: {
|
|
127
|
+
flex: 1,
|
|
128
|
+
height: 2,
|
|
129
|
+
borderRadius: 1,
|
|
130
|
+
background: i <= progress.index
|
|
131
|
+
? theme.colors.primary
|
|
132
|
+
: theme.colors.border,
|
|
133
|
+
} }, i))) }))] }), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: "auto" }, children: children })] })] }));
|
|
113
134
|
}
|
|
114
135
|
//# sourceMappingURL=FileDrawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDrawer.js","sourceRoot":"","sources":["../../src/subsystem/FileDrawer.tsx"],"names":[],"mappings":";AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEvD;2EAC2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC;;;;iF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CACtB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;qCAC1B,IATI,CAAC,CAUN,CACH,CAAC,GACE,CACP,IACG,EACN,cAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YACpD,QAAQ,GACL,IACF,IACL,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -45,6 +45,12 @@ export interface TrailViewerContext {
|
|
|
45
45
|
resolveSymbol?: (query: TrailSymbolQuery) => string | null;
|
|
46
46
|
/** A clicked construct token — open that construct's declaration line. */
|
|
47
47
|
onSymbolClick?: (symbol: string, query: TrailSymbolQuery) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Report which step scrolling has brought to the top of the code view, so the
|
|
50
|
+
* drawer can track the viewport instead of only the selected step. Forward
|
|
51
|
+
* the code view's scroll callback here.
|
|
52
|
+
*/
|
|
53
|
+
onVisibleStepChange?: (index: number) => void;
|
|
48
54
|
}
|
|
49
55
|
export interface SubsystemComponentGraphProps {
|
|
50
56
|
components: SubsystemComponent[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBtE,OAAO,EAUL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAG9B,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK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AAC,EAAE,CAAC,GAAG,EAAE;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,oBAAoB,CAAC;KAC3B,KAAK,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,gBAAgB,GAAG,IAAI,CAAC;IACjE;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AA21FD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,+BA+D1E"}
|
|
@@ -112,7 +112,7 @@ function FileOverlayCloseButton({ onClose }) {
|
|
|
112
112
|
transition: 'background 120ms ease, color 120ms ease',
|
|
113
113
|
}, children: _jsx(X, { size: 14 }) }));
|
|
114
114
|
}
|
|
115
|
-
const TrailDrawerContent = memo(function TrailDrawerContent({ render, trail, stepIndex, onOpenFile, proposedAliases, resolveSymbol, onSymbolClick, }) {
|
|
115
|
+
const TrailDrawerContent = memo(function TrailDrawerContent({ render, trail, stepIndex, onOpenFile, proposedAliases, resolveSymbol, onSymbolClick, onVisibleStepChange, }) {
|
|
116
116
|
return (_jsx(_Fragment, { children: render({
|
|
117
117
|
trail,
|
|
118
118
|
stepIndex,
|
|
@@ -120,6 +120,7 @@ const TrailDrawerContent = memo(function TrailDrawerContent({ render, trail, ste
|
|
|
120
120
|
proposedAliases,
|
|
121
121
|
resolveSymbol,
|
|
122
122
|
onSymbolClick,
|
|
123
|
+
onVisibleStepChange,
|
|
123
124
|
}) }));
|
|
124
125
|
});
|
|
125
126
|
function Inner({ components, trails, graphifyRelations, orderByLine, initialTrailId, onReorderTrails, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, moduleNesting, edgeView, title, hideSidebar, trailStepMode = 'focus', autoPlayTrails = false, trailAutoPlayIntervalMs = TRAIL_PLAY_PAUSE_MS, zoomOnTrailFocus = true, trailFocusDurationMs = 300, graphTitle, showTrailTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, diagnostic, issues, showIssues, focusIssueCategory, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileViewer, renderTrailViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, hideDrawer = false, persistKey, liveEvents, agentsPanel }) {
|
|
@@ -425,17 +426,27 @@ function Inner({ components, trails, graphifyRelations, orderByLine, initialTrai
|
|
|
425
426
|
return null;
|
|
426
427
|
if (drawerTarget.kind === 'file')
|
|
427
428
|
return drawerTarget.file;
|
|
429
|
+
// Trail steps already show their own file header per file, so the drawer
|
|
430
|
+
// title is just the trail name.
|
|
428
431
|
const tl = focusedTrail;
|
|
429
432
|
if (!tl)
|
|
430
433
|
return null;
|
|
431
|
-
|
|
432
|
-
return tl.title;
|
|
433
|
-
const step = tl.steps[drawerTarget.stepIndex];
|
|
434
|
-
if (!step)
|
|
435
|
-
return tl.title;
|
|
436
|
-
const site = `${step.file.split('/').pop() ?? step.file}:${step.line}`;
|
|
437
|
-
return `${tl.title} · ${site}`;
|
|
434
|
+
return tl.title;
|
|
438
435
|
}, [drawerTarget, focusedTrail]);
|
|
436
|
+
// Segmented step readout for trail drawers — a single file has no position.
|
|
437
|
+
// Follows the viewport once the code view reports a scroll, and falls back to
|
|
438
|
+
// the selected step until it does.
|
|
439
|
+
const [visibleStepIndex, setVisibleStepIndex] = useState(null);
|
|
440
|
+
const drawerStepIndex = drawerTarget?.kind === 'trail' ? drawerTarget.stepIndex : null;
|
|
441
|
+
const drawerProgress = useMemo(() => {
|
|
442
|
+
if (drawerStepIndex == null || !focusedTrail)
|
|
443
|
+
return null;
|
|
444
|
+
return { index: visibleStepIndex ?? drawerStepIndex, total: focusedTrail.steps.length };
|
|
445
|
+
}, [drawerStepIndex, focusedTrail, visibleStepIndex]);
|
|
446
|
+
// A new trail or step invalidates whatever the last scroll reported.
|
|
447
|
+
useEffect(() => {
|
|
448
|
+
setVisibleStepIndex(null);
|
|
449
|
+
}, [focusedTrail?.id, drawerStepIndex]);
|
|
439
450
|
// Refresh selected component when the components list updates (e.g. verify
|
|
440
451
|
// writes back declarationRef).
|
|
441
452
|
useEffect(() => {
|
|
@@ -2211,9 +2222,9 @@ function Inner({ components, trails, graphifyRelations, orderByLine, initialTrai
|
|
|
2211
2222
|
drawerTarget.startLine != null &&
|
|
2212
2223
|
!!selected.file &&
|
|
2213
2224
|
selected.file === drawerTarget.file &&
|
|
2214
|
-
selected.declarationRef?.startLine === drawerTarget.startLine }) }))] }), _jsx(FileDrawer, { title: drawerTitle, onClose: closeDrawer, fillHeight: drawerFillHeight, suppressEscape: fileOverlayOpen, hidden: hideDrawer, children: drawerTarget?.kind === 'trail' &&
|
|
2225
|
+
selected.declarationRef?.startLine === drawerTarget.startLine }) }))] }), _jsx(FileDrawer, { title: drawerTitle, onClose: closeDrawer, fillHeight: drawerFillHeight, suppressEscape: fileOverlayOpen, hidden: hideDrawer, progress: drawerProgress, children: drawerTarget?.kind === 'trail' &&
|
|
2215
2226
|
focusedTrail &&
|
|
2216
|
-
renderTrailViewer ? (_jsx(TrailDrawerContent, { render: renderTrailDrawerContent, trail: focusedTrail, stepIndex: drawerTarget.stepIndex, onOpenFile: onOpenFileFromTrail, proposedAliases: proposedAliases, resolveSymbol: resolveTrailSymbol, onSymbolClick: openConstructDeclaration })) : drawerTarget?.kind === 'file' ? (_jsx(FileDrawerContent, { render: renderDrawerContent, file: drawerTarget.file, startLine: drawerTarget.startLine })) : null }), fileOverlay && (_jsxs("div", { style: {
|
|
2227
|
+
renderTrailViewer ? (_jsx(TrailDrawerContent, { render: renderTrailDrawerContent, trail: focusedTrail, stepIndex: drawerTarget.stepIndex, onOpenFile: onOpenFileFromTrail, proposedAliases: proposedAliases, resolveSymbol: resolveTrailSymbol, onSymbolClick: openConstructDeclaration, onVisibleStepChange: setVisibleStepIndex })) : drawerTarget?.kind === 'file' ? (_jsx(FileDrawerContent, { render: renderDrawerContent, file: drawerTarget.file, startLine: drawerTarget.startLine })) : null }), fileOverlay && (_jsxs("div", { style: {
|
|
2217
2228
|
position: 'absolute',
|
|
2218
2229
|
inset: 0,
|
|
2219
2230
|
zIndex: 8,
|