@principal-ai/subsystems-react 0.56.10 → 0.56.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SubsystemComponentGraph.d.ts","sourceRoot":"","sources":["../../src/subsystem/SubsystemComponentGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAgD,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBrF,OAAO,EAYL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAG9B,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAOL,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AAMrB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAK3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAStD,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,CAAC;IACtB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,qFAAqF;IACrF,UAAU,EAAE,CAAC,IAAI,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AAC;CACvC;AAg1FD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,+BAqM1E"}
@@ -29,7 +29,7 @@ import { SubsystemDiagnosticToggle } from './DiagnosticToggle';
29
29
  import { SubsystemIssueList, issueCategory, issueKindOrder, issueRung, ISSUE_KIND_ICON, ISSUE_RUNG_ORDER, } from './IssueList';
30
30
  import { GraphLayoutCover } from './GraphLayoutCover';
31
31
  import { SubsystemFileTree } from './SubsystemFileTree';
32
- import { buildTreePathMapping } from './paths';
32
+ import { buildTrailSidebarScope } from './trailSidebarScope';
33
33
  import { GRAPH_CANVAS_CLASS, GRAPH_NAV_PROPS, GraphChrome, GraphLayerStyle, LAYOUT_FLIP_CLASS, LAYOUT_FLIP_EDGE_MS, LAYOUT_FLIP_NODE_MS } from './graphChrome';
34
34
  import { ComponentDeclaration } from './ComponentDeclaration';
35
35
  import { FileDrawer, FILE_DRAWER_HEIGHT_MS } from './FileDrawer';
@@ -127,7 +127,7 @@ const TrailDrawerContent = memo(function TrailDrawerContent({ render, trail, ste
127
127
  onVisibleStepChange,
128
128
  }) }));
129
129
  });
130
- function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirection: layoutDirectionProp, defaultLayoutDirection = 'horizontal', onLayoutDirectionChange, hideLayoutToggle = false, refocusOnLayoutFlip = true, initialTrailId, onTrailSelect, onTrailStepHover, onReorderTrails, stepEmphasis, onRemoveStepEmphasis, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, moduleNesting, edgeView, hideSidebar, trailStepMode = 'focus', autoPlayTrails = false, trailAutoPlayIntervalMs = TRAIL_PLAY_PAUSE_MS, zoomOnTrailFocus = true, trailFocusDurationMs = 300, graphTitle, showTrailTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, issues, showIssues, filesActive, focusIssueCategory, laneStatus, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileViewer, renderTrailViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, codeProcessKeys, hideDrawer = false, persistKey, liveEvents, agentsPanel }) {
130
+ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirection: layoutDirectionProp, defaultLayoutDirection = 'horizontal', onLayoutDirectionChange, hideLayoutToggle = false, refocusOnLayoutFlip = true, initialTrailId, onTrailSelect, onTrailStepHover, onReorderTrails, stepEmphasis, onRemoveStepEmphasis, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, moduleNesting, edgeView, hideSidebar, trailStepMode = 'focus', autoPlayTrails = false, trailAutoPlayIntervalMs = TRAIL_PLAY_PAUSE_MS, zoomOnTrailFocus = true, trailFocusDurationMs = 300, graphTitle, showTrailTitle = false, description, canvasOverlay, sidebarExtra, sidebarAfterDescription, issues, showIssues, filesActive, sidebarScope, onSidebarTrailChange, focusIssueCategory, laneStatus, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileViewer, renderTrailViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, codeProcessKeys, hideDrawer = false, persistKey, liveEvents, agentsPanel }) {
131
131
  const { theme } = useTheme();
132
132
  const { fitView, fitBounds } = useReactFlow();
133
133
  const viewport = useViewport();
@@ -1258,7 +1258,12 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
1258
1258
  issueModuleFocusRef.current = null;
1259
1259
  }, []);
1260
1260
  const hasTrails = useMemo(() => (trails?.length ?? 0) > 0, [trails]);
1261
- const treePaths = useMemo(() => buildTreePathMapping(components), [components]);
1261
+ const { treePaths, trail: sidebarTrail } = sidebarScope;
1262
+ const treeFilePaths = useMemo(() => treePaths.entries.map((entry) => entry.displayPath), [treePaths]);
1263
+ useEffect(() => {
1264
+ if (persistKey)
1265
+ writeViewState(persistKey, { sidebarTrailId: sidebarTrail?.id ?? null });
1266
+ }, [persistKey, sidebarTrail?.id]);
1262
1267
  // Alias → component, so the Trails panel can show human hop names instead
1263
1268
  // of model-local aliases (and the site/`via` distinction can read).
1264
1269
  const componentByAlias = useMemo(() => new Map(components.map((c) => [c.alias, c])), [components]);
@@ -1508,12 +1513,13 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
1508
1513
  }
1509
1514
  setExpandedTrails(new Set([tl.id]));
1510
1515
  setLayoutTrailId(tl.id);
1516
+ onSidebarTrailChange(tl.id);
1511
1517
  setFocusedStepIndex(null);
1512
1518
  setFocusedTrailId(tl.id);
1513
1519
  onTrailSelect?.({ trailId: tl.id });
1514
1520
  fitFocusBounds(new Set(tl.steps.map((s) => trailStepGraphEdgeId(s))));
1515
1521
  setDrawerTarget((prev) => (prev?.kind === 'trail' ? null : prev));
1516
- }, [fitFocusBounds, trailStepMode, onTrailSelect]);
1522
+ }, [fitFocusBounds, trailStepMode, onTrailSelect, onSidebarTrailChange]);
1517
1523
  const clearTrailFocus = useCallback(() => {
1518
1524
  if (pendingFocusFitRef.current != null) {
1519
1525
  window.clearTimeout(pendingFocusFitRef.current);
@@ -1521,25 +1527,26 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
1521
1527
  }
1522
1528
  setExpandedTrails(new Set());
1523
1529
  setLayoutTrailId(null);
1530
+ onSidebarTrailChange(null);
1524
1531
  setFocusedTrailId(null);
1525
1532
  setFocusedStepIndex(null);
1526
1533
  setHoveredTrailStep(null);
1527
1534
  setDrawerTarget((prev) => (prev?.kind === 'trail' ? null : prev));
1528
1535
  onTrailSelect?.(null);
1529
- }, [onTrailSelect]);
1530
- // A hidden trail must not leave the file view filtered to its cast.
1536
+ }, [onTrailSelect, onSidebarTrailChange]);
1537
+ // Switching panels keeps the selected trail, but drops transient hover previews.
1531
1538
  const filesWereActive = useRef(false);
1532
1539
  useEffect(() => {
1533
1540
  const enteringFiles = filesActive && !filesWereActive.current;
1534
1541
  filesWereActive.current = filesActive;
1535
1542
  if (!enteringFiles)
1536
1543
  return;
1537
- clearTrailFocus();
1538
- setExpandedTrails(new Set());
1544
+ if (!sidebarTrail)
1545
+ clearTrailFocus();
1539
1546
  setSelectedEdgeId(null);
1540
- setLayoutTrailId(null);
1547
+ setHoveredTrailStep(null);
1541
1548
  onTrailStepHover?.(null);
1542
- }, [filesActive, clearTrailFocus, onTrailStepHover]);
1549
+ }, [filesActive, clearTrailFocus, onTrailStepHover, sidebarTrail]);
1543
1550
  // Host deep-link: opening the graph from a trail row selects that
1544
1551
  // flow — expand its steps and focus its edges.
1545
1552
  // Guarded by a ref so a later in-tab selection isn't yanked
@@ -1579,6 +1586,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
1579
1586
  return;
1580
1587
  }
1581
1588
  // Toggle: clicking the selected step unselects it (back to whole flow).
1589
+ onSidebarTrailChange(tl.id);
1582
1590
  if (focusedTrailId === tl.id && focusedStepIndex === stepIndex) {
1583
1591
  setFocusedStepIndex(null);
1584
1592
  // Pointer is still over the row — keep hover preview so dimming doesn't
@@ -1635,6 +1643,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
1635
1643
  renderTrailViewer,
1636
1644
  trailStepMode,
1637
1645
  onTrailSelect,
1646
+ onSidebarTrailChange,
1638
1647
  ]);
1639
1648
  useEffect(() => {
1640
1649
  return () => {
@@ -2039,7 +2048,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2039
2048
  (description || filesActive || issuesActive || sidebarExtra || sidebarAfterDescription ||
2040
2049
  hasTrails);
2041
2050
  const sidebarBodyVisible = hasTrails || filesActive || issuesActive;
2042
- const sidebarTabs = issuesActive
2051
+ const sidebarTabs = issuesActive && !sidebarTrail
2043
2052
  ? agentsPanel
2044
2053
  ? [
2045
2054
  { id: 'issues', label: 'Issues' },
@@ -2050,11 +2059,12 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2050
2059
  // Header block: extras, then the description.
2051
2060
  const sidebarHeader = (_jsxs(_Fragment, { children: [sidebarExtra, description && (_jsx("div", { style: { fontSize: theme.fontSizes[0], lineHeight: 1.5 }, children: _jsx(IndustryMarkdownSlide, { content: description, slideIdPrefix: "subsystem-desc", slideIndex: 0, isVisible: true, theme: theme, disableScroll: true, disableBasePadding: true, enableKeyboardScrolling: false, autoFocusOnVisible: false }) })), sidebarAfterDescription] }));
2052
2061
  // Lower panel: diagnostics, the file tree, or the trail flow list.
2053
- const sidebarBody = issuesActive ? (diagnosticsTab === 'agents' && agentsPanel ? (_jsx(SubsystemAgentsPanel, { ...agentsPanel })) : (_jsx(SubsystemIssueList, { issues: issues ?? [], focusCategory: focusIssueCategory, laneStatus: laneStatus, onSelectIssue: focusIssueTarget, onDeselectIssue: unfocusIssueTarget, onApplyFix: onApplyIssueFix, onHoverIssue: onHoverIssue, onExpandedCategoriesChange: handleExpandedCategoriesChange }))) : filesActive ? (_jsx(SubsystemFileTree, { files: treePaths.entries.map((entry) => entry.displayPath), selectedFile: openFile ? treePaths.toDisplay.get(openFile) : null, onSelectFile: (path) => {
2062
+ const sidebarPanel = issuesActive ? (diagnosticsTab === 'agents' && agentsPanel && !sidebarTrail ? (_jsx(SubsystemAgentsPanel, { ...agentsPanel })) : (_jsx(SubsystemIssueList, { issues: sidebarScope.issues, focusCategory: focusIssueCategory, laneStatus: sidebarTrail ? undefined : laneStatus, onSelectIssue: focusIssueTarget, onDeselectIssue: unfocusIssueTarget, onApplyFix: onApplyIssueFix, onHoverIssue: onHoverIssue, onExpandedCategoriesChange: handleExpandedCategoriesChange }))) : filesActive ? treePaths.entries.length === 0 ? (_jsx("div", { style: { padding: 16, color: theme.colors.textSecondary }, children: "No files for this trail." })) : (_jsx(SubsystemFileTree, { files: treeFilePaths, selectedFile: openFile ? treePaths.toDisplay.get(openFile) : null, onSelectFile: (path) => {
2054
2063
  const file = treePaths.toFile.get(path);
2055
2064
  if (file)
2056
2065
  onOpenDeclarationFile(file);
2057
- } })) : trails && trails.length > 0 ? (_jsx(TrailsPanel, { drilldown: trailStepMode !== 'dim', trails: trails, expandedTrails: expandedTrails, focusedTrailId: focusedTrailId, focusedStepIndex: focusedStepIndex, hoveredTrailStep: hoveredTrailStep, onToggleCollapsed: toggleTrailCollapsed, onFocusFlow: focusTrailEdges, onClearFocus: clearTrailFocus, onFocusStep: focusTrailStep, onHoverStep: (tl, i) => {
2066
+ } })) : null;
2067
+ const trailNavigation = trails && trails.length > 0 ? (_jsx(TrailsPanel, { drilldown: trailStepMode !== 'dim', trails: trails, expandedTrails: expandedTrails, focusedTrailId: sidebarTrail?.id ?? focusedTrailId, focusedStepIndex: !sidebarTrail || focusedTrailId === sidebarTrail.id ? focusedStepIndex : null, detailContent: sidebarPanel, hoveredTrailStep: hoveredTrailStep, onToggleCollapsed: toggleTrailCollapsed, onFocusFlow: focusTrailEdges, onClearFocus: clearTrailFocus, onFocusStep: focusTrailStep, onHoverStep: (tl, i) => {
2058
2068
  setHoveredTrailStep({ trailId: tl.id, stepIndex: i });
2059
2069
  onTrailStepHover?.({ trailId: tl.id, stepIndex: i });
2060
2070
  }, onHoverFlow: (tl) => {
@@ -2064,6 +2074,9 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2064
2074
  setHoveredTrailStep(null);
2065
2075
  onTrailStepHover?.(null);
2066
2076
  }, onReorder: onReorderTrails, componentByAlias: componentByAlias, stepEmphasis: stepEmphasis, onRemoveStepEmphasis: onRemoveStepEmphasis })) : null;
2077
+ const sidebarBody = sidebarTrail && trailStepMode !== 'dim'
2078
+ ? trailNavigation
2079
+ : sidebarPanel ?? trailNavigation;
2067
2080
  const fileOverlayView = fileOverlay && (_jsxs("div", { style: {
2068
2081
  position: 'absolute',
2069
2082
  inset: 0,
@@ -2368,8 +2381,27 @@ export function SubsystemComponentGraph(props) {
2368
2381
  const wrapRef = useRef(null);
2369
2382
  const [size, setSize] = useState(null);
2370
2383
  const [filesOpen, setFilesOpen] = useState(false);
2371
- const fileCount = useMemo(() => buildTreePathMapping(props.components).entries.length, [props.components]);
2372
- const hasFiles = fileCount > 0;
2384
+ // Browsing a trail is independent of selecting one of its files or findings.
2385
+ const [sidebarTrailId, setSidebarTrailId] = useState(() => {
2386
+ const saved = readViewState(props.persistKey);
2387
+ return saved.sidebarTrailId !== undefined ? saved.sidebarTrailId : saved.focusedTrailId ?? null;
2388
+ });
2389
+ const sidebarScope = useMemo(() => buildTrailSidebarScope(props.components, props.trails, props.issues, sidebarTrailId), [props.components, props.trails, props.issues, sidebarTrailId]);
2390
+ const fileCount = sidebarScope.treePaths.entries.length;
2391
+ const trailViewLabel = sidebarScope.trail ? 'Trail' : 'Trails';
2392
+ const hasFiles = fileCount > 0 || sidebarScope.trail != null;
2393
+ const sidebarDiagnostic = sidebarScope.trail ? {
2394
+ ...props.diagnostic,
2395
+ status: props.issues == null ? props.diagnostic?.status ?? 'unknown'
2396
+ : sidebarScope.issues.length > 0 ? 'issues' : 'ok',
2397
+ issueCount: sidebarScope.issues.length,
2398
+ fixableCount: sidebarScope.issues.filter((issue) => issue.fix != null).length,
2399
+ title: undefined,
2400
+ } : props.diagnostic ?? { status: 'unknown', issueCount: props.issues?.length };
2401
+ useEffect(() => {
2402
+ if (sidebarTrailId != null && !sidebarScope.trail)
2403
+ setSidebarTrailId(null);
2404
+ }, [sidebarTrailId, sidebarScope.trail]);
2373
2405
  const [diagnosticsOpen, setDiagnosticsOpen] = useState(props.showIssues ?? (props.issues?.length ?? 0) > 0);
2374
2406
  const issuesActive = props.showIssues ?? diagnosticsOpen;
2375
2407
  const filesActive = filesOpen && hasFiles && !issuesActive;
@@ -2456,6 +2488,6 @@ export function SubsystemComponentGraph(props) {
2456
2488
  padding: 2,
2457
2489
  border: `1px solid ${theme.colors.border}`,
2458
2490
  borderRadius: 6,
2459
- }, children: [_jsxs("button", { type: "button", "aria-label": "Trails", "aria-pressed": !filesActive && !issuesActive, onClick: () => selectSidebarView('trails'), style: viewButtonStyle(!filesActive && !issuesActive), children: [_jsx(Route, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Trails" })] }), hasFiles && (_jsxs("button", { type: "button", "aria-label": `Files (${fileCount} files)`, title: "Show files", "aria-pressed": filesActive, onClick: () => selectSidebarView('files'), style: viewButtonStyle(filesActive), children: [_jsx(Files, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Files" }), _jsx("span", { style: { fontWeight: 600 }, children: fileCount })] })), _jsx(SubsystemDiagnosticToggle, { ...(props.diagnostic ?? { status: 'unknown', issueCount: props.issues?.length }), labelText: "Issues", segmented: true, active: issuesActive, onToggle: () => selectSidebarView('issues') })] })] })), _jsx("div", { ref: wrapRef, style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: constructsOnly ? (_jsx(ConstructsCatalog, { components: props.components, onSelect: props.onSelect, title: props.title, hideSidebar: props.hideSidebar, description: props.description, descriptionOpen: props.descriptionOpen, onDescriptionOpenChange: props.onDescriptionOpenChange, diagnostic: props.diagnostic, sidebarExtra: props.sidebarExtra, sidebarAfterDescription: props.sidebarAfterDescription, renderFileViewer: props.renderFileViewer, onFileSelect: props.onFileSelect, componentVerification: props.componentVerification, onInspectSymbol: props.onInspectSymbol })) : (_jsx(ReactFlowProvider, { children: _jsx(Inner, { ...props, showIssues: issuesActive, filesActive: filesActive, measured: size }) })) })] }));
2491
+ }, children: [_jsxs("button", { type: "button", "aria-label": trailViewLabel, "aria-pressed": !filesActive && !issuesActive, onClick: () => selectSidebarView('trails'), style: viewButtonStyle(!filesActive && !issuesActive), children: [_jsx(Route, { size: 14, "aria-hidden": true }), _jsx("span", { children: trailViewLabel })] }), hasFiles && (_jsxs("button", { type: "button", "aria-label": `Files (${fileCount} files)`, title: "Show files", "aria-pressed": filesActive, onClick: () => selectSidebarView('files'), style: viewButtonStyle(filesActive), children: [_jsx(Files, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Files" }), _jsx("span", { style: { fontWeight: 600 }, children: fileCount })] })), _jsx(SubsystemDiagnosticToggle, { ...sidebarDiagnostic, labelText: "Issues", segmented: true, active: issuesActive, onToggle: () => selectSidebarView('issues') })] })] })), _jsx("div", { ref: wrapRef, style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: constructsOnly ? (_jsx(ConstructsCatalog, { components: props.components, onSelect: props.onSelect, title: props.title, hideSidebar: props.hideSidebar, description: props.description, descriptionOpen: props.descriptionOpen, onDescriptionOpenChange: props.onDescriptionOpenChange, diagnostic: props.diagnostic, sidebarExtra: props.sidebarExtra, sidebarAfterDescription: props.sidebarAfterDescription, renderFileViewer: props.renderFileViewer, onFileSelect: props.onFileSelect, componentVerification: props.componentVerification, onInspectSymbol: props.onInspectSymbol })) : (_jsx(ReactFlowProvider, { children: _jsx(Inner, { ...props, showIssues: issuesActive, filesActive: filesActive, measured: size, sidebarScope: sidebarScope, onSidebarTrailChange: setSidebarTrailId }) })) })] }));
2460
2492
  }
2461
2493
  //# sourceMappingURL=SubsystemComponentGraph.js.map