Skip to content

Commit 99bbdb7

Browse files
author
Jurij Skornik
committed
fix(node-ui): keep context graph primitives neutral
1 parent fc4aba3 commit 99bbdb7

5 files changed

Lines changed: 15 additions & 13 deletions

File tree

packages/node-ui/src/ui/components/ActivityFeed.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from '../hooks/useProjectActivity.js';
2525
import { useAgentsContext } from '../hooks/useAgents.js';
2626
import { useProjectProfileContext } from '../hooks/useProjectProfile.js';
27-
import { EmptyState } from '../views/project/primitives.js';
27+
import { EmptyState } from './ContextGraphPrimitives.js';
2828
import { AgentChip } from './AgentChip.js';
2929

3030
const LAYER_COLOR: Record<TrustLevel, string> = {

packages/node-ui/src/ui/views/project/primitives.tsx renamed to packages/node-ui/src/ui/components/ContextGraphPrimitives.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from 'react';
22
import type { ReactNode } from 'react';
3-
import { LAYER_CONFIG } from './helpers.js';
43

5-
export type EmptyStateTone = 'neutral' | 'wm' | 'swm' | 'vm' | 'danger' | 'query';
4+
type ContextGraphLayer = 'wm' | 'swm' | 'vm';
5+
6+
export type EmptyStateTone = 'neutral' | ContextGraphLayer | 'danger' | 'query';
67

78
type EmptyStateAction = {
89
label: string;
@@ -12,14 +13,14 @@ type EmptyStateAction = {
1213

1314
const EMPTY_STATE_ACCENTS: Record<EmptyStateTone, string> = {
1415
neutral: 'var(--border-strong)',
15-
wm: LAYER_CONFIG.wm.color,
16-
swm: LAYER_CONFIG.swm.color,
17-
vm: LAYER_CONFIG.vm.color,
16+
wm: 'var(--layer-working, #64748b)',
17+
swm: 'var(--layer-shared, #f59e0b)',
18+
vm: 'var(--layer-verified, #22c55e)',
1819
danger: 'var(--text-danger)',
1920
query: '#38bdf8',
2021
};
2122

22-
export function toneForLayer(layer: 'wm' | 'swm' | 'vm'): EmptyStateTone {
23+
export function toneForLayer(layer: ContextGraphLayer): EmptyStateTone {
2324
return layer;
2425
}
2526

@@ -94,12 +95,12 @@ export function StatStrip({
9495
className = '',
9596
}: {
9697
items: StatStripItem[];
97-
layer?: 'wm' | 'swm' | 'vm';
98+
layer?: ContextGraphLayer;
9899
compact?: boolean;
99100
className?: string;
100101
}) {
101102
const style = layer
102-
? ({ '--v10-stat-accent': LAYER_CONFIG[layer].color } as React.CSSProperties)
103+
? ({ '--v10-stat-accent': EMPTY_STATE_ACCENTS[layer] } as React.CSSProperties)
103104
: undefined;
104105

105106
return (

packages/node-ui/src/ui/styles.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4148,9 +4148,10 @@ body.light .v10-vm-hero {
41484148
.v10-vm-hero-empty {
41494149
gap: 16px;
41504150
}
4151-
.v10-vm-empty-state {
4151+
.v10-empty-state.v10-vm-empty-state {
41524152
display: flex;
41534153
align-items: flex-start;
4154+
justify-content: flex-start;
41544155
gap: 12px;
41554156
padding: 16px;
41564157
background: var(--v10-vm-surface);
@@ -5928,7 +5929,7 @@ body.light .v10-me-graph-legend { background: rgba(255,255,255,0.8); }
59285929
text-transform: uppercase; letter-spacing: 0.06em;
59295930
color: var(--text-tertiary);
59305931
}
5931-
.v10-activity-feed-empty-state { min-height: 96px; }
5932+
.v10-empty-state.v10-activity-feed-empty-state { min-height: 96px; }
59325933
.v10-overview-activity.v10-activity-feed-empty {
59335934
min-height: 140px;
59345935
}

packages/node-ui/src/ui/views/project/components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import {
5757
type LayerView, type LayerContentTab, type KAPane,
5858
type SubGraphTab, type SubGraphEntitySort,
5959
} from './helpers.js';
60-
import { EmptyState, StatStrip, toneForLayer } from './primitives.js';
60+
import { EmptyState, StatStrip, toneForLayer } from '../../components/ContextGraphPrimitives.js';
6161

6262
export const RdfGraph = lazy(() =>
6363
import('@origintrail-official/dkg-graph-viz/react').then(m => ({ default: m.RdfGraph }))

packages/node-ui/test/context-graph-empty-stat-components.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ vi.mock('../src/ui/api.js', () => ({
2626
const {
2727
EmptyState,
2828
StatStrip,
29-
} = await import('../src/ui/views/project/primitives.js');
29+
} = await import('../src/ui/components/ContextGraphPrimitives.js');
3030

3131
const {
3232
AssertionsList,

0 commit comments

Comments
 (0)