Skip to content

Self-improving AI Employees for everyone

fix(theme): sweep hardcoded dracula/hex off canvas nodes onto theme tokens

trohitg6141a455becf
diff --git a/client/src/components/AIAgentNode.tsx b/client/src/components/AIAgentNode.tsx
index 5a4032ed..4f136a40 100644
--- a/client/src/components/AIAgentNode.tsx
+++ b/client/src/components/AIAgentNode.tsx
@@ -7,24 +7,23 @@ import { useAppStore } from '../store/useAppStore';
import AIAgentExecutionService from '../services/execution/aiAgentExecutionService';
import { useAppTheme } from '../hooks/useAppTheme';
import { useNodeStatus } from '../contexts/WebSocketContext';
-import { dracula } from '../styles/theme';
import { useNodeSpec } from '../lib/nodeSpec';
import { NodeIcon } from '../assets/icons';
import { Badge } from '@/components/ui/badge';
-// Agent-loop phase icons and labels. Colors reference the dracula token
-// constants so a future palette change in tokens.css propagates without
-// editing each phase entry.
+// Agent-loop phase icons and labels. Colors reference the semantic theme
+// tokens (var(--*)) so each phase label recolors per active theme — init=info,
+// memory=agent-purple, building=warning, thinking/tool=trigger-pink, done=success.
const PHASE_CONFIG: Record<string, { icon: string; label: string; color: string }> = {
- initializing: { icon: '⚡', label: 'Initializing', color: dracula.cyan },
- loading_memory: { icon: '💾', label: 'Loading Memory', color: dracula.purple },
- memory_loaded: { icon: '✓', label: 'Memory Ready', color: dracula.green },
- building_tools: { icon: '🔧', label: 'Building Tools', color: dracula.orange },
- building_graph: { icon: '🔗', label: 'Building Graph', color: dracula.orange },
- invoking_llm: { icon: '🧠', label: 'Thinking...', color: dracula.pink },
- executing_tool: { icon: '⚡', label: 'Using Tool', color: dracula.pink },
- tool_completed: { icon: '✓', label: 'Tool Done', color: dracula.green },
- saving_memory: { icon: '💾', label: 'Saving Memory', color: dracula.purple },
+ initializing: { icon: '⚡', label: 'Initializing', color: 'var(--info)' },
+ loading_memory: { icon: '💾', label: 'Loading Memory', color: 'var(--node-agent)' },
+ memory_loaded: { icon: '✓', label: 'Memory Ready', color: 'var(--success)' },
+ building_tools: { icon: '🔧', label: 'Building Tools', color: 'var(--warning)' },
+ building_graph: { icon: '🔗', label: 'Building Graph', color: 'var(--warning)' },
+ invoking_llm: { icon: '🧠', label: 'Thinking...', color: 'var(--node-trigger)' },
+ executing_tool: { icon: '⚡', label: 'Using Tool', color: 'var(--node-trigger)' },
+ tool_completed: { icon: '✓', label: 'Tool Done', color: 'var(--success)' },
+ saving_memory: { icon: '💾', label: 'Saving Memory', color: 'var(--node-agent)' },
};
// Spec-driven handle record. Mirrors server/models/node_metadata.NodeHandle.
@@ -56,7 +55,7 @@ const AIAgentNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
// declares.
const spec = useNodeSpec(type || 'aiAgent');
const handles: SpecHandle[] = (spec?.handles as SpecHandle[] | undefined) ?? [];
- const accentColor = spec?.color || dracula.purple;
+ const accentColor = spec?.color || 'var(--node-agent)';
const width = (spec?.uiHints as any)?.width ?? 300;
const height = (spec?.uiHints as any)?.height ?? 200;
const title = data?.label || spec?.displayName || type || 'Agent';
diff --git a/client/src/components/GenericNode.tsx b/client/src/components/GenericNode.tsx
index 79788e2f..a3090770 100644
--- a/client/src/components/GenericNode.tsx
+++ b/client/src/components/GenericNode.tsx
@@ -48,7 +48,7 @@ const GenericNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
return (
<div style={{
padding: '8px 12px',
- backgroundColor: '#ef4444',
+ backgroundColor: 'var(--destructive)',
color: 'white',
borderRadius: '8px',
fontSize: '12px',
@@ -101,7 +101,7 @@ const GenericNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
// Node accent color — feeds the `--node-color` CSS custom property
// on the wrapper. Handle borders/backgrounds are now owned by
// `.node-handle` in base.css + per-theme overrides (Wave 26.C).
- const getNodeColor = () => definition.defaults.color || '#9E9E9E';
+ const getNodeColor = () => definition.defaults.color || 'var(--fg-muted)';
return (
// `node` + `selected` co-classes activate per-theme generic-node
@@ -133,7 +133,7 @@ const GenericNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
left: 0,
right: 0,
bottom: 0,
- backgroundColor: 'rgba(128, 128, 128, 0.4)',
+ backgroundColor: 'color-mix(in srgb, var(--fg-faint) 40%, transparent)',
borderRadius: 'inherit',
zIndex: 25,
display: 'flex',
diff --git a/client/src/components/SquareNode.tsx b/client/src/components/SquareNode.tsx
index 77af2aa6..e080a795 100644
--- a/client/src/components/SquareNode.tsx
+++ b/client/src/components/SquareNode.tsx
@@ -249,7 +249,7 @@ const SquareNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectab
const iconRef = (iconSpec?.icon as string | undefined) ?? (definition?.icon as string | undefined);
// Get the node color from definition or use default
- const nodeColor = definition?.defaults?.color || '#1A73E8';
+ const nodeColor = definition?.defaults?.color || 'var(--node-model)';
return (
// `sq-node` + `selected` co-classes are the design-handoff structural
@@ -297,7 +297,7 @@ const SquareNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectab
left: 0,
right: 0,
bottom: 0,
- backgroundColor: 'rgba(128, 128, 128, 0.4)',
+ backgroundColor: 'color-mix(in srgb, var(--fg-faint) 40%, transparent)',
borderRadius: 'inherit',
zIndex: 35,
display: 'flex',
@@ -442,7 +442,7 @@ const SquareNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectab
width: theme.nodeSize.outputBadge,
height: theme.nodeSize.outputBadge,
borderRadius: theme.borderRadius.sm,
- backgroundColor: theme.dracula.green,
+ backgroundColor: 'var(--success)',
border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
display: 'flex',
alignItems: 'center',
diff --git a/client/src/components/StartNode.tsx b/client/src/components/StartNode.tsx
index e3cd2c2a..3e352a90 100644
--- a/client/src/components/StartNode.tsx
+++ b/client/src/components/StartNode.tsx
@@ -17,9 +17,9 @@ const StartNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectabl
const defaultLabel = 'Start';
// Definition-driven color (Wave 26.A): backend NodeSpec is SSOT for
- // node color. Falls back to dracula cyan if the spec hasn't loaded.
+ // node color. Falls back to the workflow-role accent if the spec hasn't loaded.
const definition = resolveNodeDescription(type || '');
- const nodeColor = definition?.defaults?.color || theme.dracula.cyan;
+ const nodeColor = definition?.defaults?.color || 'var(--node-workflow)';
const handleLabelChange = useCallback(
(newLabel: string) => updateNodeData(id, { label: newLabel }),
diff --git a/client/src/components/TeamMonitorNode.tsx b/client/src/components/TeamMonitorNode.tsx
index 648c9614..5eb61d0b 100644
--- a/client/src/components/TeamMonitorNode.tsx
+++ b/client/src/components/TeamMonitorNode.tsx
@@ -48,7 +48,7 @@ const TeamMonitorNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConn
// Wave 6 Phase 3e: backend NodeSpec -> legacy fallback
const definition = resolveNodeDescription(type || '');
- const nodeColor = definition?.defaults?.color || '#8b5cf6';
+ const nodeColor = definition?.defaults?.color || 'var(--node-agent)';
// Find connected AI Employee/Orchestrator node to get workflow context
const connectedTeamLead = useMemo(() => {
@@ -114,10 +114,10 @@ const TeamMonitorNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConn
const getStatusColor = (status: string) => {
switch (status) {
- case 'completed': return theme.dracula.green;
- case 'in_progress': return theme.dracula.cyan;
- case 'failed': return theme.dracula.red;
- case 'pending': return theme.dracula.orange;
+ case 'completed': return 'var(--success)';
+ case 'in_progress': return 'var(--info)';
+ case 'failed': return 'var(--destructive)';
+ case 'pending': return 'var(--warning)';
default: return theme.colors.textSecondary;
}
};
@@ -161,25 +161,25 @@ const TeamMonitorNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConn
borderBottom: `1px solid ${theme.colors.border}`,
}}>
<div style={{ textAlign: 'center' }}>
- <div style={{ fontSize: 12, fontWeight: 'bold', color: theme.dracula.purple }}>
+ <div style={{ fontSize: 12, fontWeight: 'bold', color: 'var(--node-agent)' }}>
{teamStatus?.members?.length || 0}
</div>
<div style={{ fontSize: 8, color: theme.colors.textSecondary }}>Team</div>
</div>
<div style={{ textAlign: 'center' }}>
- <div style={{ fontSize: 12, fontWeight: 'bold', color: theme.dracula.cyan }}>
+ <div style={{ fontSize: 12, fontWeight: 'bold', color: 'var(--info)' }}>
{teamStatus?.tasks?.total || 0}
</div>
<div style={{ fontSize: 8, color: theme.colors.textSecondary }}>Tasks</div>
</div>
<div style={{ textAlign: 'center' }}>
- <div style={{ fontSize: 12, fontWeight: 'bold', color: theme.dracula.green }}>
+ <div style={{ fontSize: 12, fontWeight: 'bold', color: 'var(--success)' }}>
{teamStatus?.tasks?.completed || 0}
</div>
<div style={{ fontSize: 8, color: theme.colors.textSecondary }}>Done</div>
</div>
<div style={{ textAlign: 'center' }}>
- <div style={{ fontSize: 12, fontWeight: 'bold', color: theme.dracula.orange }}>
+ <div style={{ fontSize: 12, fontWeight: 'bold', color: 'var(--warning)' }}>
{teamStatus?.tasks?.active || 0}
</div>
<div style={{ fontSize: 8, color: theme.colors.textSecondary }}>Active</div>
diff --git a/client/src/components/ToolkitNode.tsx b/client/src/components/ToolkitNode.tsx
index 0070afa4..a7c284c5 100644
--- a/client/src/components/ToolkitNode.tsx
+++ b/client/src/components/ToolkitNode.tsx
@@ -61,8 +61,8 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
setSelectedNode({ id, type, data, position: { x: 0, y: 0 } });
};
- // Get the node color from definition or use Android green
- const nodeColor = definition?.defaults?.color || '#3DDC84';
+ // Get the node color from definition or use the tool-role accent
+ const nodeColor = definition?.defaults?.color || 'var(--node-tool)';
// Schema-driven icon dispatch with reactive subscription.
// <NodeIcon> resolves the ref and tints lucide icons via currentColor.
@@ -207,7 +207,7 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
width: theme.nodeSize.outputBadge,
height: theme.nodeSize.outputBadge,
borderRadius: theme.borderRadius.sm,
- backgroundColor: theme.dracula.green,
+ backgroundColor: 'var(--success)',
border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
display: 'flex',
alignItems: 'center',
diff --git a/client/src/components/TriggerNode.tsx b/client/src/components/TriggerNode.tsx
index 09ee89fc..895c255a 100644
--- a/client/src/components/TriggerNode.tsx
+++ b/client/src/components/TriggerNode.tsx
@@ -114,7 +114,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
const iconRef = (iconSpec?.icon as string | undefined) ?? (definition?.icon as string | undefined);
// Get the node color from definition or use default trigger color
- const nodeColor = definition?.defaults?.color || '#f59e0b';
+ const nodeColor = definition?.defaults?.color || 'var(--node-trigger)';
return (
// `sq-node` + `node-trigger` + `selected` co-classes activate per-theme
@@ -163,7 +163,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
left: 0,
right: 0,
bottom: 0,
- backgroundColor: 'rgba(128, 128, 128, 0.4)',
+ backgroundColor: 'color-mix(in srgb, var(--fg-faint) 40%, transparent)',
borderRadius: 'inherit',
zIndex: 35,
display: 'flex',
@@ -233,7 +233,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
width: theme.nodeSize.outputBadge,
height: theme.nodeSize.outputBadge,
borderRadius: theme.borderRadius.sm,
- backgroundColor: theme.dracula.yellow,
+ backgroundColor: 'var(--warning)',
border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
display: 'flex',
alignItems: 'center',
@@ -278,7 +278,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta
width: theme.nodeSize.outputBadge,
height: theme.nodeSize.outputBadge,
borderRadius: theme.borderRadius.sm,
- backgroundColor: theme.dracula.green,
+ backgroundColor: 'var(--success)',
border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
display: 'flex',
alignItems: 'center',
diff --git a/client/src/components/ui/MapSelector.tsx b/client/src/components/ui/MapSelector.tsx
index 7b2d2b04..b6a01333 100644
--- a/client/src/components/ui/MapSelector.tsx
+++ b/client/src/components/ui/MapSelector.tsx
@@ -196,11 +196,11 @@ const MapSelector: React.FC<MapSelectorProps> = ({
onClose();
}}
onMouseEnter={(e) => {
- e.currentTarget.style.backgroundColor = theme.dracula.red;
+ e.currentTarget.style.backgroundColor = theme.colors.error;
e.currentTarget.style.transform = 'scale(1.1)';
}}
onMouseLeave={(e) => {
- e.currentTarget.style.backgroundColor = theme.dracula.pink;
+ e.currentTarget.style.backgroundColor = theme.colors.actionStop;
e.currentTarget.style.transform = 'scale(1)';
}}
style={{
@@ -210,13 +210,13 @@ const MapSelector: React.FC<MapSelectorProps> = ({
width: '44px',
height: '44px',
borderRadius: '50%',
- backgroundColor: theme.dracula.pink,
+ backgroundColor: theme.colors.actionStop,
color: 'white',
border: 'none',
fontSize: '20px',
fontWeight: 'bold',
cursor: 'pointer',
- boxShadow: `0 6px 16px ${theme.dracula.pink}60`,
+ boxShadow: `0 6px 16px ${theme.colors.actionStop}60`,
zIndex: 2002,
display: 'flex',
alignItems: 'center',