Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
fix(icons): NodeIcon stops tinting parent color into resolved icons
trohitg5ac17a35c822
diff --git a/client/src/ParameterPanel.tsx b/client/src/ParameterPanel.tsxindex 7ee79580..2a90c457 100644--- a/client/src/ParameterPanel.tsx+++ b/client/src/ParameterPanel.tsx@@ -139,7 +139,6 @@ const ParameterPanel: React.FC = () => {<div className="flex items-center gap-2 text-[15px] font-semibold text-foreground"><NodeIconicon={nodeDefinition.icon}- color={nodeDefinition.defaults?.color}className="h-5 w-5 text-xl"/><span>{nodeDefinition.displayName}</span>diff --git a/client/src/assets/icons/NodeIcon.tsx b/client/src/assets/icons/NodeIcon.tsxindex 89060f64..790a1a84 100644--- a/client/src/assets/icons/NodeIcon.tsx+++ b/client/src/assets/icons/NodeIcon.tsx@@ -1,22 +1,26 @@/*** NodeIcon — single icon-rendering primitive.*- * Resolves any backend-declared icon string (`lucide:Battery`,- * `lobehub:Claude`, `asset:gmail`, emoji, URL, data URI) and renders+ * Resolves any backend-declared icon string (`lobehub:Claude`,+ * `asset:gmail`, `lucide:Battery`, emoji, URL, data URI) and renders* it inside a wrapper sized by Tailwind classes. The lucide / image* branches stretch to fill the wrapper; the emoji/text branch* inherits the wrapper's font size.*- * The wrapper carries `currentColor` from the optional `color` prop- * so lucide icons (which use `currentColor` for stroke) pick up the- * brand color. Image and lobehub `.Color` icons use explicit fills- * and ignore `color` — safe to pass at every call site.+ * The wrapper does NOT apply a parent color to the resolved icon.+ * Each icon source carries its own color contract:+ * - lobehub `.Color` SVGs: multi-color brand artwork (some paths+ * use `currentColor` — applying a parent `color` would mono-tint+ * the brand mark, which is wrong)+ * - asset SVGs: explicit per-path fills (`<img>` is immune to+ * parent CSS color)+ * - lucide icons: stroke-based currentColor (used for monochrome+ * glyphs only — backend nodes ship colored asset SVGs instead)+ * - emoji / text: native glyph color*- * Replaces the per-file `renderIcon` / `getServiceIcon` /- * `renderSkillIcon` helpers and the catalogue-adapter icon factory- * so the resolver branches live in one place and call sites use- * Tailwind sizing tokens (`h-6 w-6 text-2xl`) instead of pixel- * literals.+ * Sites that need a tinted backdrop set `style={{ color: brandColor }}`+ * on their parent container alongside `bg-tint-soft` / `border-tint`;+ * NodeIcon sits inside without contributing to the color cascade.*/import * as React from 'react';@@ -31,10 +35,6 @@ export interface NodeIconProps {/** Wrapper class. Use Tailwind sizing tokens for the box (`h-6 w-6`)* and a `text-X` class to size the emoji/text branch. */className?: string;- /** Brand color forwarded as currentColor (e.g. node `defaults.color`,- * provider `color`, skill `color`). Lucide picks it up for stroke;- * image / lobehub `.Color` icons ignore it. */- color?: string;/** Element rendered when the icon ref does not resolve. */fallback?: React.ReactNode;}@@ -42,14 +42,11 @@ export interface NodeIconProps {export const NodeIcon: React.FC<NodeIconProps> = ({icon,className,- color,fallback = null,}) => {let inner: React.ReactNode;const LibIcon = resolveLibraryIcon(icon);if (LibIcon) {- // Lucide accepts className; `h-full w-full` makes the SVG fill the- // wrapper, so size flows from the wrapper's Tailwind sizing class.inner = <LibIcon className="h-full w-full" />;} else {const resolved = resolveIcon(icon);@@ -64,10 +61,7 @@ export const NodeIcon: React.FC<NodeIconProps> = ({}}return (- <span- className={cn('inline-flex items-center justify-center', className)}- style={color ? { color } : undefined}- >+ <span className={cn('inline-flex items-center justify-center', className)}>{inner}</span>);diff --git a/client/src/components/GenericNode.tsx b/client/src/components/GenericNode.tsxindex ce08e20d..4a9dc2af 100644--- a/client/src/components/GenericNode.tsx+++ b/client/src/components/GenericNode.tsx@@ -216,7 +216,6 @@ const GenericNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta}}><NodeIconicon={iconSpec?.icon ?? definition.icon}- color={getNodeColor()}className="h-6 w-6 text-2xl"/><EditableNodeLabeldiff --git a/client/src/components/SquareNode.tsx b/client/src/components/SquareNode.tsxindex 989a46b7..a6e51261 100644--- a/client/src/components/SquareNode.tsx+++ b/client/src/components/SquareNode.tsx@@ -316,7 +316,7 @@ const SquareNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectab{/* Service Icon */}- <NodeIcon icon={iconRef} color={nodeColor} className="h-7 w-7 text-3xl" />+ <NodeIcon icon={iconRef} className="h-7 w-7 text-3xl" />{/* Parameters Button */}<buttondiff --git a/client/src/components/ToolkitNode.tsx b/client/src/components/ToolkitNode.tsxindex 64317a52..4bb8ec72 100644--- a/client/src/components/ToolkitNode.tsx+++ b/client/src/components/ToolkitNode.tsx@@ -122,7 +122,7 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta}}>{/* Service Icon */}- <NodeIcon icon={iconRef} color={nodeColor} className="h-7 w-7 text-3xl" />+ <NodeIcon icon={iconRef} className="h-7 w-7 text-3xl" />{/* Parameters Button */}<buttondiff --git a/client/src/components/TriggerNode.tsx b/client/src/components/TriggerNode.tsxindex 798fb629..09edff35 100644--- a/client/src/components/TriggerNode.tsx+++ b/client/src/components/TriggerNode.tsx@@ -191,7 +191,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta)}{/* Trigger Icon */}- <NodeIcon icon={iconRef} color={nodeColor} className="h-7 w-7 text-3xl" />+ <NodeIcon icon={iconRef} className="h-7 w-7 text-3xl" />{/* Parameters Button */}<buttondiff --git a/client/src/components/credentials/CredentialsPalette.tsx b/client/src/components/credentials/CredentialsPalette.tsxindex 9013ea0e..f4af0c67 100644--- a/client/src/components/credentials/CredentialsPalette.tsx+++ b/client/src/components/credentials/CredentialsPalette.tsx@@ -161,7 +161,6 @@ const ProviderRow = memo<RowProps>(function ProviderRow({ provider, selected, on><NodeIconicon={provider.iconRef}- color={provider.color}className="h-3.5 w-3.5 shrink-0 text-sm"/><span className="flex-1 truncate">{provider.name}</span>diff --git a/client/src/components/credentials/panels/ApiKeyPanel.tsx b/client/src/components/credentials/panels/ApiKeyPanel.tsxindex 8dc6b587..3377d5bf 100644--- a/client/src/components/credentials/panels/ApiKeyPanel.tsx+++ b/client/src/components/credentials/panels/ApiKeyPanel.tsx@@ -55,7 +55,6 @@ const ApiKeyPanel: React.FC<{ config: ProviderConfig; visible: boolean }> = ({ c><NodeIconicon={config.iconRef}- color={config.color}className="h-12 w-12 text-2xl"/></div>diff --git a/client/src/components/credentials/panels/EmailPanel.tsx b/client/src/components/credentials/panels/EmailPanel.tsxindex 413d9417..72fe240b 100644--- a/client/src/components/credentials/panels/EmailPanel.tsx+++ b/client/src/components/credentials/panels/EmailPanel.tsx@@ -157,7 +157,7 @@ const EmailPanel: React.FC<{ config: ProviderConfig; visible: boolean }> = ({ coreturn (<div className="flex min-h-0 flex-1 flex-col gap-4 p-5"><StatusCard- icon={<NodeIcon icon={config.iconRef} color={config.color} className="h-6 w-6 text-2xl" />}+ icon={<NodeIcon icon={config.iconRef} className="h-6 w-6 text-2xl" />}title={config.name}status={{ stored, address }}rows={[diff --git a/client/src/components/credentials/panels/OAuthPanel.tsx b/client/src/components/credentials/panels/OAuthPanel.tsxindex 7bc5dab0..6ee467b9 100644--- a/client/src/components/credentials/panels/OAuthPanel.tsx+++ b/client/src/components/credentials/panels/OAuthPanel.tsx@@ -21,7 +21,7 @@ const OAuthPanel: React.FC<{ config: ProviderConfig; visible: boolean }> = ({ co<OAuthConnectconfig={config} form={panel.form} connected={connected}stored={panel.stored} loading={panel.loading} error={panel.error}- icon={<NodeIcon icon={config.iconRef} color={config.color} className="h-6 w-6 text-2xl" />}+ icon={<NodeIcon icon={config.iconRef} className="h-6 w-6 text-2xl" />}onSaveCredentials={() => {const missing = config.fields?.find(f => f.required && !panel.form.getFieldValue(f.key)?.trim());if (missing) { panel.setError(`${missing.label} is required`); return; }diff --git a/client/src/components/credentials/panels/QrPairingPanel.tsx b/client/src/components/credentials/panels/QrPairingPanel.tsxindex 73f32f3d..66dc9564 100644--- a/client/src/components/credentials/panels/QrPairingPanel.tsx+++ b/client/src/components/credentials/panels/QrPairingPanel.tsx@@ -65,7 +65,7 @@ const QrPairingPanel: React.FC<{ config: ProviderConfig; visible: boolean }> = (/>}{config.statusRows && (<StatusCard- icon={<NodeIcon icon={config.iconRef} color={config.color} className="h-6 w-6 text-2xl" />}+ icon={<NodeIcon icon={config.iconRef} className="h-6 w-6 text-2xl" />}title={config.name}rows={config.statusRows}status={status}diff --git a/client/src/components/parameterPanel/InputSection.tsx b/client/src/components/parameterPanel/InputSection.tsxindex cc18933d..907ce26e 100644--- a/client/src/components/parameterPanel/InputSection.tsx+++ b/client/src/components/parameterPanel/InputSection.tsx@@ -93,9 +93,6 @@ interface NodeData {name: string;type: string;icon: string;- /** Source node's brand color (`defaults.color`) — passed to NodeIcon- * so lucide icons inherit it via currentColor. */- color?: string;inputData?: any;outputSchema: Record<string, any>;hasExecutionData: boolean;@@ -321,7 +318,6 @@ const InputSection: React.FC<InputSectionProps> = ({ nodeId, visible = true }) =name: displayName,type: nodeType,icon: nodeDef?.icon || '',- color: nodeDef?.defaults?.color,inputData,outputSchema,hasExecutionData,@@ -542,7 +538,7 @@ const InputSection: React.FC<InputSectionProps> = ({ nodeId, visible = true }) =className="flex cursor-pointer items-center justify-between bg-muted px-3 py-2 transition-colors hover:bg-card"><div className="flex items-center gap-2">- <NodeIcon icon={node.icon} color={node.color} className="h-5 w-5 text-lg" />+ <NodeIcon icon={node.icon} className="h-5 w-5 text-lg" /><span className="text-sm font-semibold text-foreground">{node.name}</span></div><div className="flex items-center gap-2">diff --git a/client/src/components/parameterPanel/MasterSkillEditor.tsx b/client/src/components/parameterPanel/MasterSkillEditor.tsxindex 8ed454f1..f11c4f45 100644--- a/client/src/components/parameterPanel/MasterSkillEditor.tsx+++ b/client/src/components/parameterPanel/MasterSkillEditor.tsx@@ -637,7 +637,7 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({}}onClick={(e) => e.stopPropagation()}/>- <NodeIcon icon={skill.icon} color={skill.color} className="h-4 w-4 text-base" />+ <NodeIcon icon={skill.icon} className="h-4 w-4 text-base" /><spanclassName="flex-1 overflow-hidden text-sm whitespace-nowrap text-ellipsis"style={{@@ -711,7 +711,7 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({style={{ color: pendingSkillData.color }}>{pendingSkillData.icon- ? <NodeIcon icon={pendingSkillData.icon} color={pendingSkillData.color} className="h-5 w-5 text-xl" />+ ? <NodeIcon icon={pendingSkillData.icon} className="h-5 w-5 text-xl" />: <Plus className="h-5 w-5" />}</div><div style={{ flex: 1 }}>@@ -841,7 +841,7 @@ const MasterSkillEditor: React.FC<MasterSkillEditorProps> = ({alignItems: 'center',gap: theme.spacing.md}}>- <NodeIcon icon={selectedSkillInfo.icon} color={selectedSkillInfo.color} className="h-6 w-6 text-2xl" />+ <NodeIcon icon={selectedSkillInfo.icon} className="h-6 w-6 text-2xl" /><div style={{ flex: 1 }}>{isEditingUserSkill ? (<Inputdiff --git a/client/src/components/ui/ComponentItem.tsx b/client/src/components/ui/ComponentItem.tsxindex 43b0c3c7..7eda8279 100644--- a/client/src/components/ui/ComponentItem.tsx+++ b/client/src/components/ui/ComponentItem.tsx@@ -15,12 +15,11 @@ const ComponentItem: React.FC<ComponentItemProps> = ({ definition: localDefiniticonst [isDragging, setIsDragging] = useState(false);// Subscribe to the backend NodeSpec cache so the palette icon- // populates the moment prefetch lands. Icon + color come from the- // spec; display fields fall back to the bundled definition.+ // populates the moment prefetch lands. Icon ref comes from the spec;+ // display fields fall back to the bundled definition.const spec = useNodeSpec(localDefinition.name);const definition = localDefinition;const iconRaw = spec?.icon ?? definition.icon;- const brandColor = spec?.color ?? definition.defaults?.color;return (<Card@@ -41,7 +40,6 @@ const ComponentItem: React.FC<ComponentItemProps> = ({ definition: localDefiniti<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-muted ring-1 ring-foreground/10"><NodeIconicon={iconRaw}- color={brandColor}className="h-5 w-5 text-lg"fallback={<span>📦</span>}/>diff --git a/client/src/components/ui/ComponentPalette.tsx b/client/src/components/ui/ComponentPalette.tsxindex 40da327e..fb747260 100644--- a/client/src/components/ui/ComponentPalette.tsx+++ b/client/src/components/ui/ComponentPalette.tsx@@ -163,7 +163,6 @@ const ComponentPalette: React.FC<ComponentPaletteProps> = ({><NodeIconicon={config.icon}- color={config.color}className="h-4 w-4 text-base"fallback={<span>📦</span>}/>