@principal-ai/subsystems-react 0.56.35 → 0.56.36
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/subsystem/SubsystemComponentGraph.d.ts +50 -8
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +291 -50
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/TrailStepsNav.d.ts +1 -1
- package/dist/subsystem/TrailStepsNav.d.ts.map +1 -1
- package/dist/subsystem/TrailStepsNav.js +2 -1
- package/dist/subsystem/TrailStepsNav.js.map +1 -1
- package/dist/subsystem/TrailsPanel.d.ts +5 -5
- package/dist/subsystem/TrailsPanel.d.ts.map +1 -1
- package/dist/subsystem/TrailsPanel.js +23 -43
- package/dist/subsystem/TrailsPanel.js.map +1 -1
- package/dist/subsystem/model.d.ts +21 -6
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +48 -45
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodeIconography.d.ts +25 -0
- package/dist/subsystem/nodeIconography.d.ts.map +1 -0
- package/dist/subsystem/nodeIconography.js +55 -0
- package/dist/subsystem/nodeIconography.js.map +1 -0
- package/dist/subsystem/nodes.d.ts +4 -3
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +125 -211
- package/dist/subsystem/nodes.js.map +1 -1
- package/dist/subsystem/stepEmphasis.d.ts +5 -0
- package/dist/subsystem/stepEmphasis.d.ts.map +1 -1
- package/dist/subsystem/stepEmphasis.js +7 -0
- package/dist/subsystem/stepEmphasis.js.map +1 -1
- package/package.json +1 -1
- package/src/stories/Canvases/Subsystem/AgentDrivenWalkthrough.stories.tsx +229 -157
- package/src/stories/Canvases/Subsystem/Deprecated.stories.tsx +1 -1
- package/src/stories/Canvases/Subsystem/NodeAnatomy.stories.tsx +17 -21
- package/src/stories/Canvases/Subsystem/NodeIconography.stories.tsx +791 -21
- package/src/stories/Canvases/Subsystem/Spotlights.stories.tsx +1 -1
- package/src/subsystem/SubsystemComponentGraph.tsx +359 -62
- package/src/subsystem/TrailStepsNav.tsx +2 -2
- package/src/subsystem/TrailsPanel.tsx +35 -89
- package/src/subsystem/model.test.ts +17 -13
- package/src/subsystem/model.ts +60 -48
- package/src/subsystem/nodeIconography.ts +88 -0
- package/src/subsystem/nodes.component.test.tsx +177 -0
- package/src/subsystem/nodes.tsx +225 -268
- package/src/subsystem/stepEmphasis.ts +8 -0
package/src/subsystem/nodes.tsx
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* Subsystem component/group node + edge renderers.
|
|
3
3
|
*
|
|
4
4
|
* Lightweight, purpose-built for the subsystem component graph: a component
|
|
5
|
-
* renders
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* renders a primary construct icon + label above its name, with secondary
|
|
6
|
+
* role/storage/deprecation badges below and host-local state markers at the
|
|
7
|
+
* corners. Groups render as package containers. Clicking a component calls
|
|
8
|
+
* `onSelect` (to open the entry point / file).
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
|
-
import { createContext, useContext, useState, type ReactNode } from 'react';
|
|
11
|
+
import { createContext, useContext, useState, type CSSProperties, type ReactNode } from 'react';
|
|
11
12
|
import {
|
|
12
13
|
Handle,
|
|
13
14
|
Position,
|
|
@@ -35,17 +36,17 @@ import {
|
|
|
35
36
|
moduleBadgeHoverLabel,
|
|
36
37
|
moduleBadgeWidth,
|
|
37
38
|
packageColor,
|
|
39
|
+
HOST_PROPOSAL_COLOR,
|
|
38
40
|
FOLDER_FRAME_COLOR,
|
|
39
41
|
isFolderFrame,
|
|
40
42
|
isCardFrame,
|
|
41
43
|
type SubsystemGraphNodeData,
|
|
42
44
|
type SubsystemGroupNodeData,
|
|
43
45
|
type SubsystemGraphEdge,
|
|
44
|
-
type SubsystemNodeIssue,
|
|
45
46
|
} from './model';
|
|
46
47
|
import { componentColor } from '../pierre/constructColors';
|
|
47
48
|
import { resolvePierreSyntaxThemeName } from '../pierre/pierreSyntaxTheme';
|
|
48
|
-
import { ISSUE_KIND_ICON
|
|
49
|
+
import { ISSUE_KIND_ICON } from './IssueList';
|
|
49
50
|
import {
|
|
50
51
|
CARD_GAP,
|
|
51
52
|
CARD_PAD_X,
|
|
@@ -57,8 +58,25 @@ import {
|
|
|
57
58
|
TOGGLE_SIZE,
|
|
58
59
|
} from './containerCard';
|
|
59
60
|
import { MORPH_MS } from './graphMorph';
|
|
60
|
-
import { technologyBrand } from './techIcons';
|
|
61
|
-
import {
|
|
61
|
+
import { TechMark, technologyBrand } from './techIcons';
|
|
62
|
+
import {
|
|
63
|
+
DEPRECATED_ICON,
|
|
64
|
+
ROLE_ICON,
|
|
65
|
+
STORAGE_ICON,
|
|
66
|
+
iconForComponent,
|
|
67
|
+
} from './nodeIconography';
|
|
68
|
+
import {
|
|
69
|
+
AppWindow,
|
|
70
|
+
CirclePlus,
|
|
71
|
+
CircleX,
|
|
72
|
+
Component,
|
|
73
|
+
Database,
|
|
74
|
+
Maximize2,
|
|
75
|
+
Minimize2,
|
|
76
|
+
Package,
|
|
77
|
+
TriangleAlert,
|
|
78
|
+
WandSparkles,
|
|
79
|
+
} from 'lucide-react';
|
|
62
80
|
import type { LucideIcon } from 'lucide-react';
|
|
63
81
|
|
|
64
82
|
export const CONSTRUCT_LABEL: Record<string, string> = {
|
|
@@ -133,34 +151,61 @@ function useSubsystemCallbacks(): SubsystemGraphCallbacks {
|
|
|
133
151
|
return useContext(SubsystemCallbacksContext) ?? SUBSYSTEM_CALLBACKS;
|
|
134
152
|
}
|
|
135
153
|
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
/** A compact host-local state marker, anchored over a node corner. */
|
|
155
|
+
function NodeStateMarker({
|
|
156
|
+
label,
|
|
157
|
+
color,
|
|
158
|
+
Icon,
|
|
159
|
+
anchor,
|
|
160
|
+
count,
|
|
161
|
+
}: {
|
|
162
|
+
label: string;
|
|
163
|
+
color: string;
|
|
164
|
+
Icon: LucideIcon;
|
|
165
|
+
anchor: 'top-right' | 'bottom-right';
|
|
166
|
+
count?: number;
|
|
167
|
+
}) {
|
|
147
168
|
const { theme } = useTheme();
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
? (theme.colors.error ?? '#e5534b')
|
|
151
|
-
: (theme.colors.warning ?? '#d4a017');
|
|
152
|
-
const Icon = issue.rung
|
|
153
|
-
? ISSUE_RUNG_ICON[issue.rung]
|
|
154
|
-
: issue.kind
|
|
155
|
-
? (ISSUE_KIND_ICON[issue.kind] ?? Search)
|
|
156
|
-
: Search;
|
|
169
|
+
const nodeBg = theme.colors.backgroundSecondary ?? theme.colors.background;
|
|
170
|
+
const showCount = (count ?? 0) > 1;
|
|
157
171
|
return (
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
172
|
+
<div
|
|
173
|
+
title={label}
|
|
174
|
+
aria-label={showCount ? `${label}: ${count}` : label}
|
|
175
|
+
style={{
|
|
176
|
+
position: 'absolute',
|
|
177
|
+
zIndex: 2,
|
|
178
|
+
display: 'inline-flex',
|
|
179
|
+
alignItems: 'center',
|
|
180
|
+
justifyContent: 'center',
|
|
181
|
+
gap: showCount ? 4 : 0,
|
|
182
|
+
width: showCount ? undefined : 26,
|
|
183
|
+
minWidth: 26,
|
|
184
|
+
height: 26,
|
|
185
|
+
boxSizing: 'border-box',
|
|
186
|
+
padding: showCount ? '0 5px' : 0,
|
|
187
|
+
border: `2px solid ${color}`,
|
|
188
|
+
borderRadius: 5,
|
|
189
|
+
background: nodeBg,
|
|
190
|
+
color,
|
|
191
|
+
fontFamily: theme.fonts.monospace,
|
|
192
|
+
fontSize: theme.fontSizes[1],
|
|
193
|
+
fontWeight: 700,
|
|
194
|
+
lineHeight: 1.1,
|
|
195
|
+
pointerEvents: 'none',
|
|
196
|
+
...(anchor === 'top-right'
|
|
197
|
+
? { top: -10, right: -8 }
|
|
198
|
+
: { bottom: -8, right: -8 }),
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
201
|
+
<Icon
|
|
202
|
+
className={label === 'working' ? 'agent-working-icon' : undefined}
|
|
203
|
+
size={14}
|
|
204
|
+
strokeWidth={2}
|
|
205
|
+
aria-hidden="true"
|
|
206
|
+
/>
|
|
207
|
+
{showCount ? <span>{count}</span> : null}
|
|
208
|
+
</div>
|
|
164
209
|
);
|
|
165
210
|
}
|
|
166
211
|
|
|
@@ -221,101 +266,79 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
221
266
|
const c = data.component;
|
|
222
267
|
const [hover, setHover] = useState(false);
|
|
223
268
|
// Construct owns node color, derived from the active Pierre syntax theme —
|
|
224
|
-
// the same palette the declaration panel and file drawer render with.
|
|
225
|
-
//
|
|
226
|
-
// come later. A component-authored `color` override wins over the construct.
|
|
269
|
+
// the same palette the declaration panel and file drawer render with. A
|
|
270
|
+
// component-authored `color` override wins over the construct.
|
|
227
271
|
const color = componentColor(c, resolvePierreSyntaxThemeName(mode));
|
|
228
|
-
// Host-local proposals use the same warning color as the Trails panel. The
|
|
229
|
-
// box keeps its construct badge, but its border/name/badge mark it as not yet
|
|
230
|
-
// part of the portable model.
|
|
231
272
|
const proposed = data.proposed === true;
|
|
232
|
-
const proposalColor =
|
|
233
|
-
// Host-local working indicator: a static ring plus a compact icon on the
|
|
234
|
-
// component the agent is currently working on.
|
|
273
|
+
const proposalColor = HOST_PROPOSAL_COLOR;
|
|
235
274
|
const working = data.working === true;
|
|
236
275
|
const workingColor = theme.colors.accent ?? theme.colors.primary ?? '#a78bfa';
|
|
237
|
-
// Host-local removal ghost: the box stays in its slot, dimmed and badged,
|
|
238
|
-
// so the user can see what disappeared instead of only the surviving graph.
|
|
239
276
|
const removed = data.removed === true;
|
|
240
277
|
const removedColor = DEPRECATED_COLOR;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
278
|
+
const issue = data.issue;
|
|
279
|
+
const issueColor =
|
|
280
|
+
issue?.severity === 'error'
|
|
281
|
+
? (theme.colors.error ?? '#e5534b')
|
|
282
|
+
: (theme.colors.warning ?? '#d4a017');
|
|
283
|
+
// Primary identity: framework stereotypes may override the construct glyph
|
|
284
|
+
// with an official technology mark; custom entities use their authored kind.
|
|
285
|
+
const PrimaryIcon = iconForComponent(c);
|
|
286
|
+
const primaryBrand =
|
|
287
|
+
c.framework && c.stereotype ? technologyBrand(c.framework) : undefined;
|
|
288
|
+
const primaryLabel = constructBadgeLabel(c);
|
|
289
|
+
const primaryColor = constructBadgeColor(c) ?? color;
|
|
244
290
|
const configuredMax = callbacks.maxNodeWidth;
|
|
245
291
|
const maxWidth = configuredMax ?? 300;
|
|
246
|
-
// `symbol` is the source of truth; `name` is derived from it consistently.
|
|
247
292
|
const displayName = deriveNameFromSymbol(c.symbol, c.construct, c.name, c.file, c.stereotype);
|
|
248
|
-
// Top badges are absolutely positioned — widen the node so they nowrap
|
|
249
|
-
// instead of wrapping, including when construct + role share the top.
|
|
250
|
-
// Host-local badges must not feed back into geometry: proposal/working flags
|
|
251
|
-
// are stamped after ELK has sized the frames and after the camera has fit
|
|
252
|
-
// those rects. Growing the box here would overflow the container and leave
|
|
253
|
-
// the newly proposed node clipped. They use stacked vertical slots instead.
|
|
254
293
|
const badgeMinWidth = nodeMinWidthForBadges(c);
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
|
|
294
|
+
const roleLabel = rightBadgeLabel(c);
|
|
295
|
+
const roleColor = rightBadgeColor(c);
|
|
296
|
+
const RoleIcon =
|
|
297
|
+
roleLabel === 'entry' || roleLabel === 'service' ? ROLE_ICON[roleLabel] : undefined;
|
|
258
298
|
const storageLabel = storageBadgeLabel(c);
|
|
259
299
|
const storageColor = storageBadgeColor(c);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
// removal provenance, which is the whole reason the badge exists.
|
|
300
|
+
const storageIconKey = storageLabel === 'db' ? 'external' : storageLabel?.toLowerCase();
|
|
301
|
+
const StorageIcon = storageIconKey ? STORAGE_ICON[storageIconKey] : undefined;
|
|
263
302
|
const deprecatedLabel = deprecatedBadgeLabel(c);
|
|
264
303
|
const deprecatedColor = deprecatedBadgeColor(c);
|
|
265
304
|
const removal = c.removedIn;
|
|
266
305
|
const [showRemoval, setShowRemoval] = useState(false);
|
|
267
|
-
// Set while a file is open in the drawer: true → spotlight, false → dim,
|
|
268
|
-
// absent (no file open) → neutral.
|
|
269
306
|
const fileMatch = data.fileMatch as boolean | undefined;
|
|
270
|
-
// Node fill lifts on hover as the clickability affordance; badges share it
|
|
271
|
-
// so they read as tabs on the same surface rather than floating patches.
|
|
272
307
|
const nodeBg = theme.colors.backgroundSecondary ?? theme.colors.background;
|
|
273
308
|
const hoverBg =
|
|
274
309
|
theme.colors.backgroundHover ?? theme.colors.backgroundTertiary ?? nodeBg;
|
|
275
|
-
//
|
|
276
|
-
// since it means "not a live claim"; construct color stays on the left
|
|
277
|
-
// badge. File-open spotlight still wins with primary.
|
|
310
|
+
// State rides on markers and the name, not on a different border hue.
|
|
278
311
|
const borderColor = removed
|
|
279
312
|
? removedColor
|
|
280
|
-
:
|
|
281
|
-
?
|
|
282
|
-
:
|
|
283
|
-
? theme.colors.primary
|
|
284
|
-
: c.deprecated
|
|
285
|
-
? DEPRECATED_COLOR
|
|
286
|
-
: color;
|
|
287
|
-
// Selection is stamped into data by the graph component — React Flow's own
|
|
288
|
-
// `selected` never updates because the node stops click propagation.
|
|
313
|
+
: fileMatch
|
|
314
|
+
? theme.colors.primary
|
|
315
|
+
: color;
|
|
289
316
|
const isSelected = selected || (data.isSelected as boolean | undefined) === true;
|
|
290
|
-
// Externals are "outside" the system — square corners on the node + badges.
|
|
291
317
|
const isExternal = c.construct === 'external';
|
|
292
318
|
const nodeRadius = isExternal ? 0 : 8;
|
|
293
319
|
const badgeRadius = isExternal ? 0 : 4;
|
|
294
|
-
// The border thickens on selection / file-match. Absolutely-positioned
|
|
295
|
-
// badges are laid out from the padding box (inside the border), so a raw
|
|
296
|
-
// `top` / `left` would slide with the border. Anchor them to the border box
|
|
297
|
-
// instead, offsetting by the border width. Side badges sit flush with the
|
|
298
|
-
// node's left / right edge (`-borderW`); the top reference stays at -9.
|
|
299
320
|
const borderW = proposed ? 3 : isSelected || fileMatch ? 4 : 2;
|
|
300
|
-
const
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
:
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
321
|
+
const badgeBottom = -9 - borderW;
|
|
322
|
+
const borderStyle = removed || proposed ? 'dashed' : 'solid';
|
|
323
|
+
const secondaryBadgeStyle: CSSProperties = {
|
|
324
|
+
display: 'inline-flex',
|
|
325
|
+
alignItems: 'center',
|
|
326
|
+
justifyContent: 'center',
|
|
327
|
+
boxSizing: 'border-box',
|
|
328
|
+
gap: 5,
|
|
329
|
+
height: 26,
|
|
330
|
+
padding: '2px 8px',
|
|
331
|
+
fontFamily: theme.fonts.monospace,
|
|
332
|
+
fontSize: theme.fontSizes[1],
|
|
333
|
+
fontWeight: 700,
|
|
334
|
+
letterSpacing: 0.5,
|
|
335
|
+
lineHeight: '17px',
|
|
336
|
+
textTransform: 'uppercase',
|
|
337
|
+
whiteSpace: 'nowrap',
|
|
338
|
+
background: nodeBg,
|
|
339
|
+
border: `2px solid currentColor`,
|
|
340
|
+
borderRadius: badgeRadius,
|
|
341
|
+
};
|
|
319
342
|
|
|
320
343
|
return (
|
|
321
344
|
<div
|
|
@@ -335,19 +358,20 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
335
358
|
position: 'relative',
|
|
336
359
|
display: 'flex',
|
|
337
360
|
flexDirection: 'column',
|
|
338
|
-
justifyContent: '
|
|
361
|
+
justifyContent: 'flex-start',
|
|
339
362
|
alignItems: 'center',
|
|
340
363
|
boxSizing: 'border-box',
|
|
341
364
|
width: nodeWidth,
|
|
342
365
|
height: nodeHeight,
|
|
343
366
|
minWidth: badgeMinWidth,
|
|
344
367
|
maxWidth,
|
|
345
|
-
|
|
368
|
+
gap: 8,
|
|
369
|
+
padding: '14px 16px 0',
|
|
370
|
+
overflow: 'visible',
|
|
346
371
|
borderRadius: nodeRadius,
|
|
347
372
|
background: hover ? hoverBg : nodeBg,
|
|
348
|
-
//
|
|
349
|
-
//
|
|
350
|
-
// one; the left construct badge keeps construct color either way.
|
|
373
|
+
// Selection / file-match thickens the border. Proposed and removed
|
|
374
|
+
// ghosts are dashed; all other states keep the construct-colored border.
|
|
351
375
|
border: `${borderW}px ${borderStyle} ${borderColor}`,
|
|
352
376
|
boxShadow: working
|
|
353
377
|
? `0 0 0 3px ${workingColor}55, 0 0 18px ${workingColor}44`
|
|
@@ -364,134 +388,89 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
364
388
|
fontFamily: theme.fonts.body,
|
|
365
389
|
}}
|
|
366
390
|
>
|
|
367
|
-
{/*
|
|
368
|
-
React UI unit reads as "react · component" instead of "function".
|
|
369
|
-
Persistent; pointer-events none so clicks pass through to the node.
|
|
370
|
-
Framework badges use brand color; border stays construct-colored. */}
|
|
391
|
+
{/* Primary identity — construct / framework / entity icon and label. */}
|
|
371
392
|
<div
|
|
393
|
+
title={primaryLabel}
|
|
394
|
+
aria-label={primaryLabel}
|
|
372
395
|
style={{
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
lineHeight:
|
|
382
|
-
whiteSpace: 'nowrap',
|
|
383
|
-
color: badgeColor,
|
|
384
|
-
background: nodeBg,
|
|
385
|
-
border: `2px solid ${badgeColor}`,
|
|
386
|
-
borderRadius: badgeRadius,
|
|
387
|
-
padding: '2px 8px',
|
|
396
|
+
display: 'inline-flex',
|
|
397
|
+
alignItems: 'center',
|
|
398
|
+
justifyContent: 'center',
|
|
399
|
+
gap: 6,
|
|
400
|
+
maxWidth: '100%',
|
|
401
|
+
height: 24,
|
|
402
|
+
flex: '0 0 auto',
|
|
403
|
+
color: primaryColor,
|
|
404
|
+
lineHeight: 1,
|
|
388
405
|
}}
|
|
389
406
|
>
|
|
390
|
-
{
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
407
|
+
{primaryBrand ? (
|
|
408
|
+
<TechMark brand={primaryBrand} size={24} showTitle={false} />
|
|
409
|
+
) : (
|
|
410
|
+
<PrimaryIcon
|
|
411
|
+
size={c.construct === 'function' ? 34 : 24}
|
|
412
|
+
strokeWidth={2}
|
|
413
|
+
aria-hidden="true"
|
|
414
|
+
/>
|
|
415
|
+
)}
|
|
416
|
+
<span
|
|
398
417
|
style={{
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
zIndex: 1,
|
|
418
|
+
minWidth: 0,
|
|
419
|
+
overflow: 'hidden',
|
|
420
|
+
textOverflow: 'ellipsis',
|
|
403
421
|
fontFamily: theme.fonts.monospace,
|
|
404
422
|
fontSize: theme.fontSizes[1],
|
|
405
|
-
|
|
423
|
+
fontWeight: 600,
|
|
424
|
+
letterSpacing: 0.25,
|
|
425
|
+
lineHeight: '16px',
|
|
406
426
|
textTransform: 'uppercase',
|
|
407
|
-
lineHeight: '17px',
|
|
408
427
|
whiteSpace: 'nowrap',
|
|
409
|
-
color: removedColor,
|
|
410
|
-
background: nodeBg,
|
|
411
|
-
border: `2px solid ${removedColor}`,
|
|
412
|
-
borderRadius: badgeRadius,
|
|
413
|
-
padding: '2px 8px',
|
|
414
|
-
pointerEvents: 'none',
|
|
415
428
|
}}
|
|
416
429
|
>
|
|
417
|
-
|
|
418
|
-
</
|
|
419
|
-
|
|
430
|
+
{primaryLabel.toUpperCase()}
|
|
431
|
+
</span>
|
|
432
|
+
</div>
|
|
420
433
|
|
|
421
|
-
{
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
434
|
+
{working && (
|
|
435
|
+
<NodeStateMarker
|
|
436
|
+
label="working"
|
|
437
|
+
color={workingColor}
|
|
438
|
+
Icon={WandSparkles}
|
|
439
|
+
anchor="top-right"
|
|
440
|
+
/>
|
|
441
|
+
)}
|
|
442
|
+
{issue && (
|
|
443
|
+
<NodeStateMarker
|
|
444
|
+
label="issue"
|
|
445
|
+
color={issueColor}
|
|
446
|
+
Icon={TriangleAlert}
|
|
447
|
+
anchor="bottom-right"
|
|
448
|
+
count={issue.count}
|
|
449
|
+
/>
|
|
450
|
+
)}
|
|
426
451
|
{proposed && (
|
|
427
|
-
<
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
fontFamily: theme.fonts.monospace,
|
|
434
|
-
fontSize: theme.fontSizes[1],
|
|
435
|
-
letterSpacing: 0.5,
|
|
436
|
-
textTransform: 'uppercase',
|
|
437
|
-
lineHeight: '17px',
|
|
438
|
-
whiteSpace: 'nowrap',
|
|
439
|
-
color: proposalColor,
|
|
440
|
-
background: nodeBg,
|
|
441
|
-
border: `2px solid ${proposalColor}`,
|
|
442
|
-
borderRadius: badgeRadius,
|
|
443
|
-
padding: '2px 8px',
|
|
444
|
-
pointerEvents: 'none',
|
|
445
|
-
}}
|
|
446
|
-
>
|
|
447
|
-
proposed
|
|
448
|
-
</div>
|
|
452
|
+
<NodeStateMarker
|
|
453
|
+
label="proposed"
|
|
454
|
+
color={proposalColor}
|
|
455
|
+
Icon={CirclePlus}
|
|
456
|
+
anchor="top-right"
|
|
457
|
+
/>
|
|
449
458
|
)}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
aria-label="working"
|
|
458
|
-
title="working"
|
|
459
|
-
style={{
|
|
460
|
-
position: 'absolute',
|
|
461
|
-
top: badgeTop,
|
|
462
|
-
right: badgeEdge,
|
|
463
|
-
zIndex: 1,
|
|
464
|
-
display: 'flex',
|
|
465
|
-
alignItems: 'center',
|
|
466
|
-
justifyContent: 'center',
|
|
467
|
-
width: 24,
|
|
468
|
-
height: 24,
|
|
469
|
-
color: workingColor,
|
|
470
|
-
background: nodeBg,
|
|
471
|
-
border: `1px solid ${workingColor}66`,
|
|
472
|
-
borderRadius: badgeRadius,
|
|
473
|
-
pointerEvents: 'none',
|
|
474
|
-
}}
|
|
475
|
-
>
|
|
476
|
-
<WandSparkles
|
|
477
|
-
className="agent-working-icon"
|
|
478
|
-
size={14}
|
|
479
|
-
strokeWidth={2}
|
|
480
|
-
aria-hidden="true"
|
|
481
|
-
/>
|
|
482
|
-
</div>
|
|
459
|
+
{removed && (
|
|
460
|
+
<NodeStateMarker
|
|
461
|
+
label="removed"
|
|
462
|
+
color={removedColor}
|
|
463
|
+
Icon={CircleX}
|
|
464
|
+
anchor="top-right"
|
|
465
|
+
/>
|
|
483
466
|
)}
|
|
484
467
|
|
|
485
|
-
{/* Secondary
|
|
486
|
-
|
|
487
|
-
Persistent; pointer-events pass through.
|
|
488
|
-
Sits astride the bottom edge, centered (mirroring the top construct
|
|
489
|
-
badge's straddle), so the top edge stays free for the construct tag. */}
|
|
490
|
-
{(topRightLabel != null || storageLabel != null || deprecatedLabel != null) && (
|
|
468
|
+
{/* Secondary badges — orthogonal role, storage backing, and deprecation. */}
|
|
469
|
+
{(roleLabel != null || storageLabel != null || deprecatedLabel != null) && (
|
|
491
470
|
<div
|
|
492
471
|
style={{
|
|
493
472
|
position: 'absolute',
|
|
494
|
-
bottom:
|
|
473
|
+
bottom: badgeBottom,
|
|
495
474
|
left: '50%',
|
|
496
475
|
transform: 'translateX(-50%)',
|
|
497
476
|
zIndex: 1,
|
|
@@ -500,46 +479,27 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
500
479
|
whiteSpace: 'nowrap',
|
|
501
480
|
}}
|
|
502
481
|
>
|
|
503
|
-
{storageLabel != null && storageColor != null && (
|
|
482
|
+
{storageLabel != null && storageColor != null && StorageIcon && (
|
|
504
483
|
<span
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
letterSpacing: 0.5,
|
|
509
|
-
textTransform: 'uppercase',
|
|
510
|
-
lineHeight: '17px',
|
|
511
|
-
color: storageColor,
|
|
512
|
-
background: nodeBg,
|
|
513
|
-
border: `2px solid ${storageColor}`,
|
|
514
|
-
borderRadius: badgeRadius,
|
|
515
|
-
padding: '2px 8px',
|
|
516
|
-
}}
|
|
484
|
+
title={storageLabel}
|
|
485
|
+
aria-label={storageLabel}
|
|
486
|
+
style={{ ...secondaryBadgeStyle, color: storageColor }}
|
|
517
487
|
>
|
|
518
|
-
{
|
|
488
|
+
<StorageIcon size={14} strokeWidth={2} aria-hidden="true" />
|
|
489
|
+
<span>{storageLabel}</span>
|
|
519
490
|
</span>
|
|
520
491
|
)}
|
|
521
|
-
{
|
|
492
|
+
{roleLabel != null && roleColor != null && RoleIcon && (
|
|
522
493
|
<span
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
letterSpacing: 0.5,
|
|
527
|
-
textTransform: 'uppercase',
|
|
528
|
-
lineHeight: '17px',
|
|
529
|
-
color: topRightColor,
|
|
530
|
-
background: nodeBg,
|
|
531
|
-
border: `2px solid ${topRightColor}`,
|
|
532
|
-
borderRadius: badgeRadius,
|
|
533
|
-
padding: '2px 8px',
|
|
534
|
-
}}
|
|
494
|
+
title={roleLabel}
|
|
495
|
+
aria-label={roleLabel}
|
|
496
|
+
style={{ ...secondaryBadgeStyle, color: roleColor }}
|
|
535
497
|
>
|
|
536
|
-
{
|
|
498
|
+
<RoleIcon size={14} strokeWidth={2} aria-hidden="true" />
|
|
499
|
+
<span>{roleLabel}</span>
|
|
537
500
|
</span>
|
|
538
501
|
)}
|
|
539
502
|
{deprecatedLabel != null && deprecatedColor != null && (
|
|
540
|
-
// Its own click target: stops propagation so opening the provenance
|
|
541
|
-
// doesn't also select the node, and toggles a popover rather than
|
|
542
|
-
// leaning on a title tooltip (which truncates the commit subject).
|
|
543
503
|
<span
|
|
544
504
|
role="button"
|
|
545
505
|
tabIndex={0}
|
|
@@ -560,22 +520,10 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
560
520
|
setShowRemoval((v) => !v);
|
|
561
521
|
}
|
|
562
522
|
}}
|
|
563
|
-
style={{
|
|
564
|
-
position: 'relative',
|
|
565
|
-
fontFamily: theme.fonts.monospace,
|
|
566
|
-
fontSize: theme.fontSizes[1],
|
|
567
|
-
letterSpacing: 0.5,
|
|
568
|
-
textTransform: 'uppercase',
|
|
569
|
-
lineHeight: '17px',
|
|
570
|
-
color: deprecatedColor,
|
|
571
|
-
background: nodeBg,
|
|
572
|
-
border: `2px solid ${deprecatedColor}`,
|
|
573
|
-
borderRadius: badgeRadius,
|
|
574
|
-
padding: '2px 8px',
|
|
575
|
-
cursor: 'pointer',
|
|
576
|
-
}}
|
|
523
|
+
style={{ ...secondaryBadgeStyle, color: deprecatedColor, cursor: 'pointer' }}
|
|
577
524
|
>
|
|
578
|
-
{
|
|
525
|
+
<DEPRECATED_ICON size={14} strokeWidth={2} aria-hidden="true" />
|
|
526
|
+
<span>{deprecatedLabel}</span>
|
|
579
527
|
</span>
|
|
580
528
|
)}
|
|
581
529
|
</div>
|
|
@@ -684,8 +632,6 @@ export function SubsystemComponentNode(props: NodeProps<Node<SubsystemGraphNodeD
|
|
|
684
632
|
</div>
|
|
685
633
|
)}
|
|
686
634
|
|
|
687
|
-
{data.issue && <NodeIssueOverlay issue={data.issue} />}
|
|
688
|
-
|
|
689
635
|
<Handle type="target" position={Position.Left} style={{ opacity: 0 }} />
|
|
690
636
|
<Handle type="source" position={Position.Right} style={{ opacity: 0 }} />
|
|
691
637
|
</div>
|
|
@@ -1096,15 +1042,26 @@ export function SubsystemEdge({
|
|
|
1096
1042
|
// MECHANISM_* tables, graphify-native relations use the separate
|
|
1097
1043
|
// GRAPHIFY_RELATION_* palette (see edgeColor / edgeStrokeStyle).
|
|
1098
1044
|
const edgeRef = { mechanism, provenance: data?.provenance };
|
|
1099
|
-
const
|
|
1045
|
+
const ghost = data?.ghost === true;
|
|
1046
|
+
const proposed = data?.proposed === true;
|
|
1047
|
+
const color = proposed
|
|
1048
|
+
? HOST_PROPOSAL_COLOR
|
|
1049
|
+
: edgeColor(edgeRef);
|
|
1100
1050
|
// Dash style encodes provenance (graphify) and relationship kind (dashed =
|
|
1101
1051
|
// inverted-control or observational: hierarchy, registration, watches).
|
|
1102
|
-
|
|
1052
|
+
// Host-local proposal/previous-state edges are dashed too.
|
|
1053
|
+
const isDashed = proposed || ghost || edgeStrokeStyle(edgeRef) === 'dashed';
|
|
1103
1054
|
const dimmed = data?.dimmed === true;
|
|
1104
1055
|
// Dim the stroke by color, never via path `opacity`. SVG markers are shared
|
|
1105
1056
|
// by id; opacity on the referencing path paints every arrowhead that uses
|
|
1106
1057
|
// the same marker — including the focused edge's target.
|
|
1107
|
-
const stroke =
|
|
1058
|
+
const stroke = proposed
|
|
1059
|
+
? color
|
|
1060
|
+
: ghost
|
|
1061
|
+
? hexWithAlpha(color, 0.45)
|
|
1062
|
+
: dimmed
|
|
1063
|
+
? hexWithAlpha(color, EDGE_DIM_ALPHA)
|
|
1064
|
+
: color;
|
|
1108
1065
|
|
|
1109
1066
|
return (
|
|
1110
1067
|
<>
|
|
@@ -1124,7 +1081,7 @@ export function SubsystemEdge({
|
|
|
1124
1081
|
d={path}
|
|
1125
1082
|
fill="none"
|
|
1126
1083
|
stroke={stroke}
|
|
1127
|
-
strokeWidth={1.5}
|
|
1084
|
+
strokeWidth={ghost || proposed ? 1 : 1.5}
|
|
1128
1085
|
strokeDasharray={isDashed ? '6 4' : undefined}
|
|
1129
1086
|
markerEnd={markerEnd}
|
|
1130
1087
|
style={{ pointerEvents: 'none' }}
|