Skip to content

Commit 4c76290

Browse files
authored
Tweak styles on edge sidepane, add label for graph settings (#510)
1 parent e4f0d59 commit 4c76290

File tree

3 files changed

+75
-12
lines changed

3 files changed

+75
-12
lines changed

.changeset/eight-jobs-make.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@inkeep/agents-manage-ui": patch
3+
---
4+
5+
Tweak styling on edge pane, graph settings label

agents-manage-ui/src/components/graph/sidepane/edges/edge-editor.tsx

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { type Edge, useNodesData, useReactFlow } from '@xyflow/react';
22
import { Spline } from 'lucide-react';
33
import { DashedSplineIcon } from '@/components/icons/dashed-spline';
4+
import { Badge } from '@/components/ui/badge';
45
import { Checkbox } from '@/components/ui/checkbox';
56
import { Label } from '@/components/ui/label';
67
import { useGraphActions } from '@/features/graph/state/use-graph-store';
78
import type { A2AEdgeData } from '../../configuration/edge-types';
89

910
type RelationshipOptionProps = {
1011
id: string;
11-
label: string;
12+
label: string | React.ReactNode;
1213
onCheckedChange: (id: string, checked: boolean) => void;
1314
checked: boolean;
1415
};
@@ -20,9 +21,12 @@ function RelationshipOption({ id, label, onCheckedChange, checked }: Relationshi
2021
id={id}
2122
onCheckedChange={(checked) => onCheckedChange(id, checked as boolean)}
2223
checked={checked}
24+
className="mt-[5px]"
2325
/>
2426
<div className="grid gap-2">
25-
<Label htmlFor={id}>{label}</Label>
27+
<Label htmlFor={id} className="font-normal">
28+
{label}
29+
</Label>
2630
</div>
2731
</div>
2832
);
@@ -32,7 +36,7 @@ type RelationshipSectionProps = {
3236
icon: React.ReactNode;
3337
title: string;
3438
description: string;
35-
options: Array<{ id: string; label: string }>;
39+
options: Array<{ id: string; label: string | React.ReactNode }>;
3640
onCheckedChange: (id: string, checked: boolean) => void;
3741
checkedValues: A2AEdgeData['relationships'];
3842
};
@@ -131,35 +135,89 @@ function EdgeEditor({ selectedEdge }: EdgeEditorProps) {
131135
? [
132136
{
133137
id: 'transferSourceToTarget',
134-
label: `${sourceNode?.data.name} can transfer to itself`,
138+
label: (
139+
<div>
140+
<Badge variant="code" className="my-0.5">
141+
{sourceNode?.data.name as string}
142+
</Badge>{' '}
143+
can transfer to itself
144+
</div>
145+
),
135146
},
136147
]
137148
: [
138149
{
139150
id: 'transferSourceToTarget',
140-
label: `${sourceNode?.data.name} can transfer to ${targetNode?.data.name}`,
151+
label: (
152+
<div>
153+
<Badge variant="code" className="my-0.5">
154+
{sourceNode?.data.name as string}
155+
</Badge>{' '}
156+
can transfer to{' '}
157+
<Badge variant="code" className="my-0.5">
158+
{targetNode?.data.name as string}
159+
</Badge>
160+
</div>
161+
),
141162
},
142163
{
143164
id: 'transferTargetToSource',
144-
label: `${targetNode?.data.name} can transfer to ${sourceNode?.data.name}`,
165+
label: (
166+
<div>
167+
<Badge variant="code" className="my-0.5">
168+
{targetNode?.data.name as string}
169+
</Badge>{' '}
170+
can transfer to{' '}
171+
<Badge variant="code" className="my-0.5">
172+
{sourceNode?.data.name as string}
173+
</Badge>
174+
</div>
175+
),
145176
},
146177
];
147178

148179
const delegateOptions = isSelfLoop
149180
? [
150181
{
151182
id: 'delegateSourceToTarget',
152-
label: `${sourceNode?.data.name} can delegate to itself`,
183+
label: (
184+
<div>
185+
<Badge variant="code" className="my-0.5">
186+
{sourceNode?.data.name as string}
187+
</Badge>{' '}
188+
can delegate to itself
189+
</div>
190+
),
153191
},
154192
]
155193
: [
156194
{
157195
id: 'delegateSourceToTarget',
158-
label: `${sourceNode?.data.name} can delegate to ${targetNode?.data.name}`,
196+
label: (
197+
<div>
198+
<Badge variant="code" className="my-0.5">
199+
{sourceNode?.data.name as string}
200+
</Badge>{' '}
201+
can delegate to{' '}
202+
<Badge variant="code" className="my-0.5">
203+
{targetNode?.data.name as string}
204+
</Badge>
205+
</div>
206+
),
159207
},
160208
{
161209
id: 'delegateTargetToSource',
162-
label: `${targetNode?.data.name} can delegate to ${sourceNode?.data.name}`,
210+
label: (
211+
<div>
212+
<Badge variant="code" className="my-0.5">
213+
{targetNode?.data.name as string}
214+
</Badge>{' '}
215+
can delegate to{' '}
216+
<Badge variant="code" className="my-0.5">
217+
{sourceNode?.data.name as string}
218+
</Badge>
219+
</div>
220+
),
163221
},
164222
];
165223

agents-manage-ui/src/components/graph/toolbar/toolbar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Play, Settings } from 'lucide-react';
2+
import { useEffect, useRef } from 'react';
23
import { Button } from '@/components/ui/button';
34
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
45
import { useGraphStore } from '@/features/graph/state/use-graph-store';
5-
import { useEffect, useRef } from 'react';
66
import { isMacOs } from '@/lib/utils';
77

88
interface ToolbarProps {
@@ -71,9 +71,9 @@ export function Toolbar({
7171
>
7272
{isPreviewDisabled ? 'Save' : 'Save changes'}
7373
</Button>
74-
<Button type="button" variant="ghost" onClick={toggleSidePane}>
75-
<span className="sr-only">Toggle side pane</span>
74+
<Button type="button" variant="outline" onClick={toggleSidePane}>
7675
<Settings className="w-4 h-4" />
76+
Graph Settings
7777
</Button>
7878
</div>
7979
);

0 commit comments

Comments
 (0)