Skip to content

Commit 1c43353

Browse files
committed
fix(ui): unique icons for every node, fix sidebar icon rendering
- Add unique icon to every function: mail, send, code, terminal - Add unique icon to every inline node: plus, x, minus, hash, type, toggle, filter, git-merge, braces, scissors, quote, shield, repeat - Fix sidebar: use def.icon for all nodes (not just non-functions) - Color icons by type: amber for inline, cyan for HTTP, zinc for built-in - Add missing MOCK_FUNCTIONS: const/number, const/string, const/boolean, json/object (now 17 total: 4 HTTP + 13 inline) - Regenerate seed SQL with updated icons
1 parent a151684 commit 1c43353

4 files changed

Lines changed: 36 additions & 8 deletions

File tree

functions/python-example/handler.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
{ "name": "status", "type": "string", "description": "Processing status" },
2626
{ "name": "echo", "type": "string", "description": "Echo of the input message" }
2727
],
28-
"icon": "code",
28+
"icon": "terminal",
2929
"category": "custom"
3030
}

functions/send-verification-link/handler.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
{ "name": "result", "type": "json", "description": "Send result with status and message ID" }
8484
],
8585
"volatile": true,
86-
"icon": "mail",
86+
"icon": "send",
8787
"category": "email",
8888
"dependencies": {
8989
"@constructive-io/postmaster": "^1.5.2",

pgpm/constructive-infra-seed/deploy/schemas/constructive_compute_public/tables/platform_function_definitions/fixtures/seed_built_in_functions.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ VALUES
4444
'[{"name":"status","type":"string","description":"Processing status"},{"name":"echo","type":"string","description":"Echo of the input message"}]'::jsonb,
4545
'[]'::jsonb,
4646
false,
47-
'code',
47+
'terminal',
4848
'custom',
4949
'http'
5050
),
@@ -100,7 +100,7 @@ VALUES
100100
'[{"name":"result","type":"json","description":"Send result with status and message ID"}]'::jsonb,
101101
'[]'::jsonb,
102102
true,
103-
'mail',
103+
'send',
104104
'email',
105105
'http'
106106
),

www/src/components/FlowsPanel.tsx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,34 @@ const MOCK_FUNCTIONS: FunctionNode[] = [
156156
outputs: [{ name: 'difference', type: 'number' }],
157157
icon: 'minus', category: 'math',
158158
},
159+
{
160+
name: 'const/number', taskIdentifier: 'const/number', isInvocable: true, isBuiltIn: true,
161+
scope: 'platform', description: 'Emit a constant number', runtime: 'inline',
162+
outputs: [{ name: 'value', type: 'number' }],
163+
props: [{ name: 'value', type: 'number', default: 0 }],
164+
icon: 'hash', category: 'const',
165+
},
166+
{
167+
name: 'const/string', taskIdentifier: 'const/string', isInvocable: true, isBuiltIn: true,
168+
scope: 'platform', description: 'Emit a constant string', runtime: 'inline',
169+
outputs: [{ name: 'value', type: 'string' }],
170+
props: [{ name: 'value', type: 'string', default: '' }],
171+
icon: 'type', category: 'const',
172+
},
173+
{
174+
name: 'const/boolean', taskIdentifier: 'const/boolean', isInvocable: true, isBuiltIn: true,
175+
scope: 'platform', description: 'Emit a constant boolean', runtime: 'inline',
176+
outputs: [{ name: 'value', type: 'boolean' }],
177+
props: [{ name: 'value', type: 'boolean', default: false }],
178+
icon: 'toggle', category: 'const',
179+
},
159180
{
160181
name: 'json/select', taskIdentifier: 'json/select', isInvocable: true, isBuiltIn: true,
161182
scope: 'platform', description: 'Extract a value from JSON by dot-path', runtime: 'inline',
162183
inputs: [{ name: 'obj', type: 'json' }],
163184
outputs: [{ name: 'value', type: 'any' }],
164185
props: [{ name: 'path', type: 'string', default: '' }],
165-
icon: 'circle', category: 'json',
186+
icon: 'filter', category: 'json',
166187
},
167188
{
168189
name: 'json/merge', taskIdentifier: 'json/merge', isInvocable: true, isBuiltIn: true,
@@ -171,6 +192,13 @@ const MOCK_FUNCTIONS: FunctionNode[] = [
171192
outputs: [{ name: 'value', type: 'json' }],
172193
icon: 'git-merge', category: 'json',
173194
},
195+
{
196+
name: 'json/object', taskIdentifier: 'json/object', isInvocable: true, isBuiltIn: true,
197+
scope: 'platform', description: 'Wrap all inputs into a JSON object', runtime: 'inline',
198+
inputs: [{ name: 'value', type: 'any' }],
199+
outputs: [{ name: 'value', type: 'json' }],
200+
icon: 'braces', category: 'json',
201+
},
174202
{
175203
name: 'json/split', taskIdentifier: 'json/split', isInvocable: true, isBuiltIn: true,
176204
scope: 'platform', description: 'Split a JSON object by key list', runtime: 'inline',
@@ -1023,10 +1051,10 @@ export function FlowsPanel() {
10231051
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"
10241052
>
10251053
<div className="flex items-center gap-2">
1026-
{isFunction ? (
1027-
<Zap size={14} className="text-cyan-400 flex-shrink-0" />
1054+
{def.icon ? (
1055+
<NodeIcon icon={def.icon} size={14} className={fn?.runtime === 'inline' ? 'text-amber-500 flex-shrink-0' : isFunction ? 'text-cyan-400 flex-shrink-0' : 'text-zinc-500 flex-shrink-0'} />
10281056
) : (
1029-
def.icon && <NodeIcon icon={def.icon} size={14} className="text-zinc-500 flex-shrink-0" />
1057+
<Zap size={14} className={isFunction ? 'text-cyan-400 flex-shrink-0' : 'text-zinc-500 flex-shrink-0'} />
10301058
)}
10311059
<span className="text-sm text-zinc-300 truncate">
10321060
{def.name.split('/').pop()}

0 commit comments

Comments
 (0)