Skip to content

Commit 0ccf757

Browse files
committed
uniform sidebar items + fix icon alignment on canvas nodes
1 parent e83b82b commit 0ccf757

2 files changed

Lines changed: 7 additions & 24 deletions

File tree

packages/fbp-graph-editor/src/components/GraphNode.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export function GraphNode({ node, onStartConnect, onEndConnect }: GraphNodeProps
134134
if (isRichNode) {
135135
const width = RICH_NODE_WIDTH;
136136
const description = definition?.description || '';
137-
const isInvocable = definition?.icon === 'zap';
138137
const secretsCount = getNodeProp(node, 'secretsCount') ?? 0;
139138
const configsCount = getNodeProp(node, 'configsCount') ?? 0;
140139
const scope = getNodeProp(node, 'scope') || definition?.context || 'platform';
@@ -192,15 +191,9 @@ export function GraphNode({ node, onStartConnect, onEndConnect }: GraphNodeProps
192191

193192
{/* Header: icon + name (same layout as compact) */}
194193
<g transform={`translate(14, ${RICH_HEADER_HEIGHT / 2})`}>
195-
{isInvocable ? (
196-
<g transform="translate(-2, -7)">
197-
<text fill="#22d3ee" fontSize={13} fontFamily="system-ui"></text>
198-
</g>
199-
) : (
200-
<g transform="translate(-2, -6)">
201-
<NodeIconSvg icon={definition?.icon || 'circle'} size={12} />
202-
</g>
203-
)}
194+
<g transform="translate(-2, -6)">
195+
<NodeIconSvg icon={definition?.icon || 'circle'} size={12} />
196+
</g>
204197
<text
205198
x={16}
206199
dominantBaseline="middle"

www/src/components/FlowsPanel.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -402,36 +402,26 @@ export function FlowsPanel() {
402402

403403
{/* Category items */}
404404
{!isCollapsed && (
405-
<div className="space-y-1 mb-2">
405+
<div className="space-y-0.5 mb-2">
406406
{items.map(({ def, fn }) => (
407407
<button
408408
key={`${def.context}:${def.name}`}
409409
onClick={() => handleAddNode(def, fn)}
410410
draggable
411411
onDragStart={(e) => handleDragStart(e, def)}
412-
className={`w-full text-left rounded-lg transition-colors cursor-grab active:cursor-grabbing ${
413-
isFunction
414-
? 'p-3 border border-zinc-800 hover:border-zinc-700 bg-zinc-900/50 hover:bg-zinc-900'
415-
: 'px-2.5 py-1.5 hover:bg-zinc-800/70 rounded-md'
416-
}`}
412+
title={fn?.description || def.description || ''}
413+
className="w-full text-left px-2.5 py-1.5 rounded-md hover:bg-zinc-800/70 transition-colors cursor-grab active:cursor-grabbing"
417414
>
418415
<div className="flex items-center gap-2">
419416
{isFunction ? (
420417
<Zap size={14} className="text-cyan-400 flex-shrink-0" />
421418
) : (
422419
def.icon && <NodeIcon icon={def.icon} size={14} className="text-zinc-500 flex-shrink-0" />
423420
)}
424-
<span className={`text-sm truncate ${
425-
isFunction
426-
? 'font-medium text-zinc-200 font-mono'
427-
: 'text-zinc-300'
428-
}`}>
421+
<span className="text-sm text-zinc-300 truncate">
429422
{def.name.split('/').pop()}
430423
</span>
431424
</div>
432-
{isFunction && fn?.description && (
433-
<p className="text-xs text-zinc-500 leading-relaxed mt-1 ml-6">{fn.description}</p>
434-
)}
435425
</button>
436426
))}
437427
{isFunction && functions.length > 0 && (

0 commit comments

Comments
 (0)