Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
feat(lint): design-system adherence rules + the token fixes they caught
trohitg7bc238c01642
diff --git a/client/eslint.config.js b/client/eslint.config.jsindex 31459537..9eea90c4 100644--- a/client/eslint.config.js+++ b/client/eslint.config.js@@ -44,4 +44,41 @@ export default tseslint.config('react-hooks/rules-of-hooks': 'warn',},},+ // ── Design-system adherence (from the design-handoff bundle's+ // _adherence.oxlintrc.json, ported to the existing ESLint gate) ──+ //+ // Scope is deliberately narrow: inline `style={}` attributes. Tailwind+ // classes are already token-driven, and a global hex/px scan would+ // false-positive on ids, URLs, SVG path data, and arbitrary-value+ // classes like `max-w-[150px]`. ActionButton intent misuse needs no+ // lint — the cva union type makes it a typecheck error.+ {+ files: ['src/**/*.{ts,tsx}'],+ ignores: [+ // Grandfathered: legacy JS-side palettes and SVG glyph assets that+ // legitimately hold literal values (canvas/maps color packs, brand+ // icons, 290 themed glyphs). New code goes through theme tokens.+ 'src/styles/theme.ts',+ 'src/hooks/useAppTheme.ts',+ 'src/components/icons/**',+ 'src/assets/icons/**',+ 'src/**/__tests__/**',+ ],+ rules: {+ 'no-restricted-syntax': [+ 'error',+ {+ selector: 'JSXAttribute[name.name="style"] Literal[value=/#[0-9a-fA-F]{3,8}\\b/]',+ message:+ 'No hex colors in inline styles — use a theme token via var(--...) (see docs-internal/theme_system.md).',+ },+ {+ selector:+ 'JSXAttribute[name.name="style"] Property[key.name="fontFamily"] Literal:not([value=/^var\\(--font-/])',+ message:+ 'No literal font stacks in inline styles — use var(--font-display) / var(--font-body) / var(--font-mono) so per-theme faces apply.',+ },+ ],+ },+ },)diff --git a/client/src/components/SquareNode.tsx b/client/src/components/SquareNode.tsxindex a1439ce7..fc6a990c 100644--- a/client/src/components/SquareNode.tsx+++ b/client/src/components/SquareNode.tsx@@ -317,7 +317,7 @@ const SquareNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectabdisplay: 'flex',flexDirection: 'column',alignItems: 'center',- fontFamily: 'system-ui, -apple-system, sans-serif',+ fontFamily: 'var(--font-body)',fontSize: '11px',cursor: 'pointer',} as NodeStyle}@@ -449,7 +449,7 @@ const SquareNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectabheight: theme.nodeSize.outputBadge,borderRadius: theme.borderRadius.sm,backgroundColor: 'var(--success)',- border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,+ border: '1px solid var(--bg-canvas)',display: 'flex',alignItems: 'center',justifyContent: 'center',diff --git a/client/src/components/StartNode.tsx b/client/src/components/StartNode.tsxindex 3e352a90..b96f7b99 100644--- a/client/src/components/StartNode.tsx+++ b/client/src/components/StartNode.tsx@@ -51,7 +51,7 @@ const StartNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectabldisplay: 'flex',flexDirection: 'column',alignItems: 'center',- fontFamily: 'system-ui, -apple-system, sans-serif',+ fontFamily: 'var(--font-body)',fontSize: '11px',cursor: 'pointer',} as NodeStyle}diff --git a/client/src/components/TeamMonitorNode.tsx b/client/src/components/TeamMonitorNode.tsxindex a4b96825..ef7af814 100644--- a/client/src/components/TeamMonitorNode.tsx+++ b/client/src/components/TeamMonitorNode.tsx@@ -165,7 +165,7 @@ const TeamMonitorNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConn'--node-color': nodeColor,width: 200,minHeight: 120,- fontFamily: 'system-ui, -apple-system, sans-serif',+ fontFamily: 'var(--font-body)',fontSize: 10,overflow: 'hidden',} as NodeStyle}diff --git a/client/src/components/ToolkitNode.tsx b/client/src/components/ToolkitNode.tsxindex c139d030..13065941 100644--- a/client/src/components/ToolkitNode.tsx+++ b/client/src/components/ToolkitNode.tsx@@ -89,7 +89,7 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectadisplay: 'flex',flexDirection: 'column',alignItems: 'center',- fontFamily: 'system-ui, -apple-system, sans-serif',+ fontFamily: 'var(--font-body)',fontSize: '11px',cursor: 'pointer',} as NodeStyle}@@ -181,7 +181,7 @@ const ToolkitNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectaheight: theme.nodeSize.outputBadge,borderRadius: theme.borderRadius.sm,backgroundColor: 'var(--success)',- border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,+ border: '1px solid var(--bg-canvas)',display: 'flex',alignItems: 'center',justifyContent: 'center',diff --git a/client/src/components/TriggerNode.tsx b/client/src/components/TriggerNode.tsxindex a1d858d0..948e8da2 100644--- a/client/src/components/TriggerNode.tsx+++ b/client/src/components/TriggerNode.tsx@@ -150,7 +150,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectadisplay: 'flex',flexDirection: 'column',alignItems: 'center',- fontFamily: 'system-ui, -apple-system, sans-serif',+ fontFamily: 'var(--font-body)',fontSize: '11px',cursor: 'pointer',} as NodeStyle}@@ -253,7 +253,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectaheight: theme.nodeSize.outputBadge,borderRadius: theme.borderRadius.sm,backgroundColor: isPaused ? 'var(--fg-faint)' : 'var(--warning)',- border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,+ border: '1px solid var(--bg-canvas)',display: 'flex',alignItems: 'center',justifyContent: 'center',@@ -265,7 +265,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnecta}}title={isPaused ? 'Trigger paused — events will run after resume' : 'Trigger Node - Starts workflow execution'}>- <span style={{ lineHeight: 1, color: theme.isDarkMode ? theme.colors.background : '#1a1d21' }}>{isPaused ? 'Ⅱ' : '⚡'}</span>+ <span style={{ lineHeight: 1, color: 'var(--fg-on-warning)' }}>{isPaused ? 'Ⅱ' : '⚡'}</span></div>{/* Backend NodeSpec owns every trigger output, including the@@ -310,7 +310,7 @@ const TriggerNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectaheight: theme.nodeSize.outputBadge,borderRadius: theme.borderRadius.sm,backgroundColor: 'var(--success)',- border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,+ border: '1px solid var(--bg-canvas)',display: 'flex',alignItems: 'center',justifyContent: 'center',diff --git a/client/src/components/maps/MapsPreviewPanel.tsx b/client/src/components/maps/MapsPreviewPanel.tsxindex 3b92762b..eb947182 100644--- a/client/src/components/maps/MapsPreviewPanel.tsx+++ b/client/src/components/maps/MapsPreviewPanel.tsx@@ -87,7 +87,7 @@ const MapsPreviewPanel: React.FC<MapsPreviewPanelProps> = ({backgroundColor: theme.colors.backgroundAlt,fontSize: theme.fontSize.xs,color: theme.colors.textSecondary,- fontFamily: 'monospace',+ fontFamily: 'var(--font-mono)',flexShrink: 0}}><div style={{ display: 'flex', justifyContent: 'space-between' }}>diff --git a/client/src/components/ui/CodeEditor.tsx b/client/src/components/ui/CodeEditor.tsxindex a1c8ec53..1f10351e 100644--- a/client/src/components/ui/CodeEditor.tsx+++ b/client/src/components/ui/CodeEditor.tsx@@ -43,7 +43,7 @@ const CodeEditor: React.FC<CodeEditorProps> = ({// properties; font + sizing must live on the editor's style// prop. Colors come from .code-editor-container in index.css.style={{- fontFamily: "'Consolas', 'Monaco', 'Fira Code', monospace",+ fontFamily: 'var(--font-mono)',fontSize: 13,lineHeight: 1.5,minHeight: '100%',