Skip to content

Self-improving AI Employees for everyone

feat(design-system): Phase 0 - tokens + core primitives

trohitg2209dba02f92
diff --git a/client/package.json b/client/package.json
index 7e54ee21..46b1bab0 100644
--- a/client/package.json
+++ b/client/package.json
@@ -15,6 +15,7 @@
"@lobehub/icons": "^2.45.0",
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-dialog": "^1.1.15",
+ "@radix-ui/react-slot": "^1.2.4",
"@tailwindcss/typography": "^0.5.19",
"@tanstack/react-query": "^5",
"@types/google.maps": "^3.58.1",
@@ -27,6 +28,8 @@
"@vitejs/plugin-react": "^5.0.0",
"antd": "^5.27.4",
"autoprefixer": "^10.4.21",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
"cmdk": "^1",
"eslint": "^9.33.0",
"eslint-plugin-react-hooks": "^7.0.1",
@@ -48,6 +51,7 @@
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.1",
"styled-components": "^6.1.19",
+ "tailwind-merge": "^3.5.0",
"tailwindcss": "^4.1.13",
"typescript": "^5.9.2",
"vite": "^7.1.2",
diff --git a/client/src/design-system/index.ts b/client/src/design-system/index.ts
new file mode 100644
index 00000000..81a7bc58
--- /dev/null
+++ b/client/src/design-system/index.ts
@@ -0,0 +1,32 @@
+/**
+ * Owned design-system public API.
+ *
+ * Primitives replace antd equivalents. See docs-internal/ui_migration_plan.md.
+ * Tokens: client/src/design-system/tokens/index.css (imported once in main.tsx).
+ */
+
+export { cn } from './lib/cn';
+
+export { Button, buttonVariants } from './primitives/Button';
+export type { ButtonProps } from './primitives/Button';
+
+export { Badge, badgeVariants } from './primitives/Badge';
+export type { BadgeProps } from './primitives/Badge';
+
+export { Stack } from './primitives/Stack';
+export type { StackProps } from './primitives/Stack';
+
+export { Inline } from './primitives/Inline';
+export type { InlineProps } from './primitives/Inline';
+
+export { Spinner, SpinnerOverlay } from './primitives/Spinner';
+export type { SpinnerProps, SpinnerOverlayProps } from './primitives/Spinner';
+
+export { Alert, AlertTitle, AlertDescription } from './primitives/Alert';
+export type { AlertProps } from './primitives/Alert';
+
+export { Text } from './primitives/Text';
+export type { TextProps } from './primitives/Text';
+
+export { Heading } from './primitives/Heading';
+export type { HeadingProps } from './primitives/Heading';
diff --git a/client/src/design-system/lib/cn.ts b/client/src/design-system/lib/cn.ts
new file mode 100644
index 00000000..2819a830
--- /dev/null
+++ b/client/src/design-system/lib/cn.ts
@@ -0,0 +1,6 @@
+import { clsx, type ClassValue } from 'clsx';
+import { twMerge } from 'tailwind-merge';
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
diff --git a/client/src/design-system/primitives/Alert.tsx b/client/src/design-system/primitives/Alert.tsx
new file mode 100644
index 00000000..41557a57
--- /dev/null
+++ b/client/src/design-system/primitives/Alert.tsx
@@ -0,0 +1,63 @@
+import * as React from 'react';
+import { cva, type VariantProps } from 'class-variance-authority';
+import { cn } from '../lib/cn';
+
+const alertVariants = cva(
+ 'relative w-full rounded-[var(--radius-md)] border px-4 py-3 text-sm ' +
+ '[&>svg]:text-[hsl(var(--color-fg-muted))] [&>svg+*]:mt-0.5',
+ {
+ variants: {
+ variant: {
+ default:
+ 'border-[hsl(var(--color-border))] bg-[hsl(var(--color-surface))] text-[hsl(var(--color-fg))]',
+ success:
+ 'border-[hsl(var(--color-success)/0.4)] bg-[hsl(var(--color-success)/0.1)] text-[hsl(var(--color-success))]',
+ warning:
+ 'border-[hsl(var(--color-warning)/0.4)] bg-[hsl(var(--color-warning)/0.1)] text-[hsl(var(--color-warning))]',
+ danger:
+ 'border-[hsl(var(--color-danger)/0.4)] bg-[hsl(var(--color-danger)/0.1)] text-[hsl(var(--color-danger))]',
+ info:
+ 'border-[hsl(var(--color-info)/0.4)] bg-[hsl(var(--color-info)/0.1)] text-[hsl(var(--color-info))]',
+ },
+ },
+ defaultVariants: {
+ variant: 'default',
+ },
+ }
+);
+
+export interface AlertProps
+ extends React.HTMLAttributes<HTMLDivElement>,
+ VariantProps<typeof alertVariants> {}
+
+export const Alert = React.forwardRef<HTMLDivElement, AlertProps>(
+ ({ className, variant, ...props }, ref) => (
+ <div
+ ref={ref}
+ role="alert"
+ className={cn(alertVariants({ variant }), className)}
+ {...props}
+ />
+ )
+);
+Alert.displayName = 'Alert';
+
+export const AlertTitle = React.forwardRef<
+ HTMLHeadingElement,
+ React.HTMLAttributes<HTMLHeadingElement>
+>(({ className, ...props }, ref) => (
+ <h5
+ ref={ref}
+ className={cn('mb-1 font-medium leading-none tracking-tight', className)}
+ {...props}
+ />
+));
+AlertTitle.displayName = 'AlertTitle';
+
+export const AlertDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes<HTMLParagraphElement>
+>(({ className, ...props }, ref) => (
+ <div ref={ref} className={cn('text-sm opacity-90 [&_p]:leading-relaxed', className)} {...props} />
+));
+AlertDescription.displayName = 'AlertDescription';
diff --git a/client/src/design-system/primitives/Badge.tsx b/client/src/design-system/primitives/Badge.tsx
new file mode 100644
index 00000000..2748ef03
--- /dev/null
+++ b/client/src/design-system/primitives/Badge.tsx
@@ -0,0 +1,44 @@
+import * as React from 'react';
+import { cva, type VariantProps } from 'class-variance-authority';
+import { cn } from '../lib/cn';
+
+const badgeVariants = cva(
+ 'inline-flex items-center gap-1 rounded-[var(--radius-sm)] border px-2 py-0.5 text-xs font-medium ' +
+ 'transition-colors whitespace-nowrap',
+ {
+ variants: {
+ variant: {
+ default:
+ 'border-transparent bg-[hsl(var(--color-bg-alt))] text-[hsl(var(--color-fg))]',
+ secondary:
+ 'border-transparent bg-[hsl(var(--color-accent)/0.15)] text-[hsl(var(--color-accent))]',
+ success:
+ 'border-transparent bg-[hsl(var(--color-success)/0.15)] text-[hsl(var(--color-success))]',
+ warning:
+ 'border-transparent bg-[hsl(var(--color-warning)/0.15)] text-[hsl(var(--color-warning))]',
+ danger:
+ 'border-transparent bg-[hsl(var(--color-danger)/0.15)] text-[hsl(var(--color-danger))]',
+ info:
+ 'border-transparent bg-[hsl(var(--color-info)/0.15)] text-[hsl(var(--color-info))]',
+ outline:
+ 'border-[hsl(var(--color-border))] bg-transparent text-[hsl(var(--color-fg))]',
+ },
+ },
+ defaultVariants: {
+ variant: 'default',
+ },
+ }
+);
+
+export interface BadgeProps
+ extends React.HTMLAttributes<HTMLSpanElement>,
+ VariantProps<typeof badgeVariants> {}
+
+export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
+ ({ className, variant, ...props }, ref) => (
+ <span ref={ref} className={cn(badgeVariants({ variant }), className)} {...props} />
+ )
+);
+Badge.displayName = 'Badge';
+
+export { badgeVariants };
diff --git a/client/src/design-system/primitives/Button.tsx b/client/src/design-system/primitives/Button.tsx
new file mode 100644
index 00000000..34ee09c8
--- /dev/null
+++ b/client/src/design-system/primitives/Button.tsx
@@ -0,0 +1,59 @@
+import * as React from 'react';
+import { Slot } from '@radix-ui/react-slot';
+import { cva, type VariantProps } from 'class-variance-authority';
+import { cn } from '../lib/cn';
+
+const buttonVariants = cva(
+ 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-md)] text-sm font-medium ' +
+ 'transition-colors duration-[var(--duration-fast)] ' +
+ 'focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[hsl(var(--color-border-focus)/0.35)] ' +
+ 'disabled:pointer-events-none disabled:opacity-50 ' +
+ '[&_svg]:pointer-events-none [&_svg:not([data-size])]:size-4 [&_svg]:shrink-0',
+ {
+ variants: {
+ variant: {
+ default:
+ 'bg-[hsl(var(--color-primary))] text-[hsl(var(--color-primary-fg))] hover:bg-[hsl(var(--color-primary)/0.9)]',
+ secondary:
+ 'bg-[hsl(var(--color-bg-alt))] text-[hsl(var(--color-fg))] hover:bg-[hsl(var(--color-surface-hover))]',
+ ghost:
+ 'text-[hsl(var(--color-fg))] hover:bg-[hsl(var(--color-surface-hover))]',
+ outline:
+ 'border border-[hsl(var(--color-border))] bg-transparent text-[hsl(var(--color-fg))] ' +
+ 'hover:bg-[hsl(var(--color-surface-hover))]',
+ destructive:
+ 'bg-[hsl(var(--color-danger))] text-white hover:bg-[hsl(var(--color-danger)/0.9)]',
+ link:
+ 'text-[hsl(var(--color-primary))] underline-offset-4 hover:underline',
+ },
+ size: {
+ sm: 'h-8 px-3 text-xs',
+ md: 'h-9 px-4',
+ lg: 'h-10 px-6 text-base',
+ icon: 'h-9 w-9',
+ },
+ },
+ defaultVariants: {
+ variant: 'default',
+ size: 'md',
+ },
+ }
+);
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
+ VariantProps<typeof buttonVariants> {
+ asChild?: boolean;
+}
+
+export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : 'button';
+ return (
+ <Comp className={cn(buttonVariants({ variant, size }), className)} ref={ref} {...props} />
+ );
+ }
+);
+Button.displayName = 'Button';
+
+export { buttonVariants };
diff --git a/client/src/design-system/primitives/Heading.tsx b/client/src/design-system/primitives/Heading.tsx
new file mode 100644
index 00000000..5c086d36
--- /dev/null
+++ b/client/src/design-system/primitives/Heading.tsx
@@ -0,0 +1,29 @@
+import * as React from 'react';
+import { cn } from '../lib/cn';
+
+type Level = 1 | 2 | 3 | 4 | 5;
+
+const levelClass: Record<Level, string> = {
+ 1: 'text-3xl font-bold leading-tight tracking-tight',
+ 2: 'text-2xl font-semibold leading-tight tracking-tight',
+ 3: 'text-xl font-semibold leading-snug',
+ 4: 'text-lg font-semibold leading-snug',
+ 5: 'text-base font-semibold',
+};
+
+export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
+ level?: Level;
+}
+
+/** Heading element. Replaces antd `<Typography.Title level>`. */
+export const Heading = React.forwardRef<HTMLHeadingElement, HeadingProps>(
+ ({ level = 2, className, ...rest }, ref) => {
+ const Tag = `h${level}` as const;
+ return React.createElement(Tag, {
+ ref,
+ className: cn('text-[hsl(var(--color-fg))]', levelClass[level], className),
+ ...rest,
+ });
+ }
+);
+Heading.displayName = 'Heading';
diff --git a/client/src/design-system/primitives/Inline.tsx b/client/src/design-system/primitives/Inline.tsx
new file mode 100644
index 00000000..d300d890
--- /dev/null
+++ b/client/src/design-system/primitives/Inline.tsx
@@ -0,0 +1,77 @@
+import * as React from 'react';
+import { cn } from '../lib/cn';
+
+type Gap = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
+type Align = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
+type Justify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
+type WrapMode = 'wrap' | 'nowrap';
+
+const gapClass: Record<Gap, string> = {
+ '0': 'gap-0',
+ '1': 'gap-[2px]',
+ '2': 'gap-1',
+ '3': 'gap-2',
+ '4': 'gap-3',
+ '5': 'gap-4',
+ '6': 'gap-5',
+ '7': 'gap-6',
+ '8': 'gap-8',
+};
+
+const alignClass: Record<Align, string> = {
+ start: 'items-start',
+ center: 'items-center',
+ end: 'items-end',
+ stretch: 'items-stretch',
+ baseline: 'items-baseline',
+};
+
+const justifyClass: Record<Justify, string> = {
+ start: 'justify-start',
+ center: 'justify-center',
+ end: 'justify-end',
+ between: 'justify-between',
+ around: 'justify-around',
+ evenly: 'justify-evenly',
+};
+
+export interface InlineProps extends React.HTMLAttributes<HTMLDivElement> {
+ gap?: Gap;
+ align?: Align;
+ justify?: Justify;
+ wrap?: WrapMode;
+ as?: keyof React.JSX.IntrinsicElements;
+}
+
+/** Horizontal flex row. Replaces antd `<Space>` / `<Flex>` default. */
+export const Inline = React.forwardRef<HTMLDivElement, InlineProps>(
+ (
+ {
+ gap = '3',
+ align = 'center',
+ justify,
+ wrap = 'nowrap',
+ as: Comp = 'div',
+ className,
+ ...rest
+ },
+ ref
+ ) => {
+ const Component = Comp as unknown as React.ElementType;
+ return (
+ <Component
+ ref={ref}
+ className={cn(
+ 'flex flex-row',
+ gapClass[gap],
+ alignClass[align],
+ justify && justifyClass[justify],
+ wrap === 'wrap' ? 'flex-wrap' : 'flex-nowrap',
+ className
+ )}
+ {...rest}
+ />
+ );
+ }
+);
+Inline.displayName = 'Inline';
diff --git a/client/src/design-system/primitives/Spinner.tsx b/client/src/design-system/primitives/Spinner.tsx
new file mode 100644
index 00000000..ea168b98
--- /dev/null
+++ b/client/src/design-system/primitives/Spinner.tsx
@@ -0,0 +1,64 @@
+import * as React from 'react';
+import { cn } from '../lib/cn';
+
+type Size = 'sm' | 'md' | 'lg';
+
+const sizeClass: Record<Size, string> = {
+ sm: 'h-3 w-3 border',
+ md: 'h-4 w-4 border-2',
+ lg: 'h-6 w-6 border-2',
+};
+
+export interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
+ size?: Size;
+ label?: string;
+}
+
+/** Indeterminate loading spinner. Replaces antd `<Spin />`. */
+export const Spinner = React.forwardRef<HTMLSpanElement, SpinnerProps>(
+ ({ size = 'md', label = 'Loading', className, ...rest }, ref) => (
+ <span
+ ref={ref}
+ role="status"
+ aria-live="polite"
+ aria-label={label}
+ className={cn(
+ 'inline-block animate-spin rounded-full border-solid border-current border-r-transparent',
+ 'text-[hsl(var(--color-fg-muted))]',
+ sizeClass[size],
+ className
+ )}
+ {...rest}
+ />
+ )
+);
+Spinner.displayName = 'Spinner';
+
+export interface SpinnerOverlayProps extends React.HTMLAttributes<HTMLDivElement> {
+ spinning: boolean;
+ children: React.ReactNode;
+ size?: Size;
+ label?: string;
+}
+
+/** `<SpinnerOverlay spinning={x}>{children}</SpinnerOverlay>` replaces `<Spin spinning={x}>...</Spin>`. */
+export const SpinnerOverlay: React.FC<SpinnerOverlayProps> = ({
+ spinning,
+ children,
+ size = 'md',
+ label,
+ className,
+ ...rest
+}) => (
+ <div className={cn('relative', className)} {...rest}>
+ {children}
+ {spinning && (
+ <div
+ aria-hidden="false"
+ className="absolute inset-0 flex items-center justify-center bg-[hsl(var(--color-surface)/0.6)] backdrop-blur-[1px]"
+ >
+ <Spinner size={size} label={label} />
+ </div>
+ )}
+ </div>
+);
diff --git a/client/src/design-system/primitives/Stack.tsx b/client/src/design-system/primitives/Stack.tsx
new file mode 100644
index 00000000..60ca47ad
--- /dev/null
+++ b/client/src/design-system/primitives/Stack.tsx
@@ -0,0 +1,63 @@
+import * as React from 'react';
+import { cn } from '../lib/cn';
+
+type Gap = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
+type Align = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
+type Justify = 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';
+
+const gapClass: Record<Gap, string> = {
+ '0': 'gap-0',
+ '1': 'gap-[2px]',
+ '2': 'gap-1',
+ '3': 'gap-2',
+ '4': 'gap-3',
+ '5': 'gap-4',
+ '6': 'gap-5',
+ '7': 'gap-6',
+ '8': 'gap-8',
+};
+
+const alignClass: Record<Align, string> = {
+ start: 'items-start',
+ center: 'items-center',
+ end: 'items-end',
+ stretch: 'items-stretch',
+ baseline: 'items-baseline',
+};
+
+const justifyClass: Record<Justify, string> = {
+ start: 'justify-start',
+ center: 'justify-center',
+ end: 'justify-end',
+ between: 'justify-between',
+ around: 'justify-around',
+ evenly: 'justify-evenly',
+};
+
+export interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
+ gap?: Gap;
+ align?: Align;
+ justify?: Justify;
+ as?: keyof React.JSX.IntrinsicElements;
+}
+
+/** Vertical flex column. Replaces antd `<Space direction="vertical">`. */
+export const Stack = React.forwardRef<HTMLDivElement, StackProps>(
+ ({ gap = '4', align, justify, as: Comp = 'div', className, ...rest }, ref) => {
+ const Component = Comp as unknown as React.ElementType;
+ return (
+ <Component
+ ref={ref}
+ className={cn(
+ 'flex flex-col',
+ gapClass[gap],
+ align && alignClass[align],
+ justify && justifyClass[justify],
+ className
+ )}
+ {...rest}
+ />
+ );
+ }
+);
+Stack.displayName = 'Stack';
diff --git a/client/src/design-system/primitives/Text.tsx b/client/src/design-system/primitives/Text.tsx
new file mode 100644
index 00000000..0b4bf487
--- /dev/null
+++ b/client/src/design-system/primitives/Text.tsx
@@ -0,0 +1,51 @@
+import * as React from 'react';
+import { cn } from '../lib/cn';
+
+type Size = 'xs' | 'sm' | 'base' | 'lg';
+type Weight = 'normal' | 'medium' | 'semibold' | 'bold';
+
+const sizeClass: Record<Size, string> = {
+ xs: 'text-xs',
+ sm: 'text-sm',
+ base: 'text-base',
+ lg: 'text-lg',
+};
+
+const weightClass: Record<Weight, string> = {
+ normal: 'font-normal',
+ medium: 'font-medium',
+ semibold: 'font-semibold',
+ bold: 'font-bold',
+};
+
+export interface TextProps extends React.HTMLAttributes<HTMLSpanElement> {
+ size?: Size;
+ weight?: Weight;
+ muted?: boolean;
+ mono?: boolean;
+ as?: keyof React.JSX.IntrinsicElements;
+}
+
+/** Inline text. Replaces antd `<Typography.Text>`. */
+export const Text = React.forwardRef<HTMLSpanElement, TextProps>(
+ (
+ { size = 'base', weight = 'normal', muted = false, mono = false, as: Comp = 'span', className, ...rest },
+ ref
+ ) => {
+ const Component = Comp as unknown as React.ElementType;
+ return (
+ <Component
+ ref={ref}
+ className={cn(
+ sizeClass[size],
+ weightClass[weight],
+ muted && 'text-[hsl(var(--color-fg-muted))]',
+ mono && 'font-mono',
+ className
+ )}
+ {...rest}
+ />
+ );
+ }
+);
+Text.displayName = 'Text';
diff --git a/client/src/design-system/tokens/colors.css b/client/src/design-system/tokens/colors.css
new file mode 100644
index 00000000..70258eec
--- /dev/null
+++ b/client/src/design-system/tokens/colors.css
@@ -0,0 +1,83 @@
+/**
+ * Color tokens — HSL triplets (space-separated, no hsl() wrapper) so Tailwind
+ * utilities can compose alpha via `hsl(var(--color-x) / 0.5)`.
+ *
+ * Source of truth: client/src/styles/theme.ts (lightColors, darkColors, dracula).
+ * Keep both in sync until Phase 7 removes the old theme.ts.
+ */
+
+:root,
+[data-theme="light"] {
+ /* Surfaces */
+ --color-bg: 218 22% 97%; /* #f5f7fa */
+ --color-bg-alt: 215 18% 95%; /* #eef1f5 */
+ --color-bg-canvas: 215 17% 92%; /* #e8ecf1 */
+ --color-surface: 0 0% 100%; /* #ffffff */
+ --color-surface-raised: 0 0% 100%; /* #ffffff */
+ --color-surface-hover: 0 0% 0% / 0.05;
+ --color-surface-active: 0 0% 0% / 0.08;
+
+ /* Text */
+ --color-fg: 214 11% 12%; /* #1a1d21 */
+ --color-fg-secondary: 218 14% 27%; /* #374151 */
+ --color-fg-muted: 217 12% 34%; /* #4b5563 */
+
+ /* Borders */
+ --color-border: 216 12% 84%; /* #d1d5db */
+ --color-border-hover: 218 11% 65%; /* #9ca3af */
+ --color-border-focus: 217 91% 60%; /* #3b82f6 */
+
+ /* Semantic */
+ --color-primary: 221 83% 53%; /* #2563eb */
+ --color-primary-fg: 0 0% 100%;
+ --color-success: 161 94% 30%; /* #059669 */
+ --color-warning: 32 95% 44%; /* #d97706 */
+ --color-danger: 0 74% 51%; /* #dc2626 */
+ --color-info: 192 91% 36%; /* #0891b2 */
+
+ /* Accent */
+ --color-accent: 262 83% 58%; /* #7c3aed — template variables */
+}
+
+[data-theme="dark"] {
+ /* Surfaces (Solarized dark) */
+ --color-bg: 192 100% 11%; /* #002b36 base03 */
+ --color-bg-alt: 192 81% 14%; /* #073642 base02 */
+ --color-bg-canvas: 192 100% 11%; /* base03 */
+ --color-surface: 192 81% 14%; /* base02 */
+ --color-surface-raised: 206 55% 12%; /* #0d1f2d */
+ --color-surface-hover: 0 0% 100% / 0.04;
+ --color-surface-active: 0 0% 100% / 0.08;
+
+ /* Text (Dracula foreground for contrast) */
+ --color-fg: 60 30% 96%; /* #f8f8f2 */
+ --color-fg-secondary: 0 0% 75%; /* #bfbfbf */
+ --color-fg-muted: 225 27% 51%; /* #6272a4 dracula comment */
+
+ /* Borders */
+ --color-border: 194 14% 40% / 0.4; /* #586e75 base01 @ 0.4 */
+ --color-border-hover: 194 14% 40%; /* #586e75 */
+ --color-border-focus: 205 69% 49%; /* #268bd2 blue */
+
+ /* Semantic (Solarized) */
+ --color-primary: 205 69% 49%; /* #268bd2 */
+ --color-primary-fg: 60 30% 96%;
+ --color-success: 68 100% 30%; /* #859900 */
+ --color-warning: 45 100% 35%; /* #b58900 */
+ --color-danger: 1 71% 52%; /* #dc322f */
+ --color-info: 175 59% 40%; /* #2aa198 */
+
+ /* Accent */
+ --color-accent: 191 97% 77%; /* dracula cyan */
+}
+
+/* Dracula action palette — same across themes, used for vibrant buttons/edges */
+:root {
+ --color-dracula-green: 135 94% 65%; /* #50fa7b */
+ --color-dracula-purple: 265 89% 78%; /* #bd93f9 */
+ --color-dracula-pink: 326 100% 74%; /* #ff79c6 */
+ --color-dracula-cyan: 191 97% 77%; /* #8be9fd */
+ --color-dracula-red: 0 100% 67%; /* #ff5555 */
+ --color-dracula-orange: 27 100% 71%; /* #ffb86c */
+ --color-dracula-yellow: 65 92% 76%; /* #f1fa8c */
+}
diff --git a/client/src/design-system/tokens/elevation.css b/client/src/design-system/tokens/elevation.css
new file mode 100644
index 00000000..35fb408d
--- /dev/null
+++ b/client/src/design-system/tokens/elevation.css
@@ -0,0 +1,14 @@
+:root,
+[data-theme="light"] {
+ --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
+ --shadow-md: 0 2px 8px rgb(0 0 0 / 0.1), 0 4px 16px rgb(0 0 0 / 0.06);
+ --shadow-lg: 0 10px 25px rgb(0 0 0 / 0.12), 0 4px 10px rgb(0 0 0 / 0.08);
+ --shadow-focus: 0 0 0 3px hsl(var(--color-border-focus) / 0.25);
+}
+
+[data-theme="dark"] {
+ --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.25);
+ --shadow-md: 0 2px 12px rgb(0 0 0 / 0.3);
+ --shadow-lg: 0 10px 30px rgb(0 0 0 / 0.5);
+ --shadow-focus: 0 0 0 3px hsl(var(--color-border-focus) / 0.3);
+}
diff --git a/client/src/design-system/tokens/index.css b/client/src/design-system/tokens/index.css
new file mode 100644
index 00000000..628d1301
--- /dev/null
+++ b/client/src/design-system/tokens/index.css
@@ -0,0 +1,6 @@
+@import './colors.css';
+@import './radius.css';
+@import './spacing.css';
+@import './typography.css';
+@import './motion.css';
+@import './elevation.css';
diff --git a/client/src/design-system/tokens/motion.css b/client/src/design-system/tokens/motion.css
new file mode 100644
index 00000000..ddd621e2
--- /dev/null
+++ b/client/src/design-system/tokens/motion.css
@@ -0,0 +1,8 @@
+:root {
+ --duration-fast: 120ms;
+ --duration-medium: 200ms;
+ --duration-slow: 300ms;
+
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
+}
diff --git a/client/src/design-system/tokens/radius.css b/client/src/design-system/tokens/radius.css
new file mode 100644
index 00000000..a14a36de
--- /dev/null
+++ b/client/src/design-system/tokens/radius.css
@@ -0,0 +1,7 @@
+:root {
+ --radius-sm: 4px;
+ --radius-md: 6px;
+ --radius-lg: 8px;
+ --radius-xl: 12px;
+ --radius-full: 9999px;
+}
diff --git a/client/src/design-system/tokens/spacing.css b/client/src/design-system/tokens/spacing.css
new file mode 100644
index 00000000..6d3d087c
--- /dev/null
+++ b/client/src/design-system/tokens/spacing.css
@@ -0,0 +1,13 @@
+:root {
+ --space-0: 0px;
+ --space-1: 2px;
+ --space-2: 4px;
+ --space-3: 8px;
+ --space-4: 12px;
+ --space-5: 16px;
+ --space-6: 20px;
+ --space-7: 24px;
+ --space-8: 32px;
+ --space-9: 40px;
+ --space-10: 48px;
+}
diff --git a/client/src/design-system/tokens/typography.css b/client/src/design-system/tokens/typography.css
new file mode 100644
index 00000000..7201513c
--- /dev/null
+++ b/client/src/design-system/tokens/typography.css
@@ -0,0 +1,21 @@
+:root {
+ --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
+ --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
+
+ --text-xs: 11px;
+ --text-sm: 12px;
+ --text-base: 14px;
+ --text-lg: 16px;
+ --text-xl: 18px;
+ --text-2xl: 22px;
+ --text-3xl: 28px;
+
+ --leading-tight: 1.25;
+ --leading-normal: 1.5;
+ --leading-relaxed: 1.6;
+
+ --font-weight-normal: 400;
+ --font-weight-medium: 500;
+ --font-weight-semibold: 600;
+ --font-weight-bold: 700;
+}
diff --git a/client/src/main.tsx b/client/src/main.tsx
index 247b1b6d..d0c4a652 100644
--- a/client/src/main.tsx
+++ b/client/src/main.tsx
@@ -1,6 +1,7 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import './design-system/tokens/index.css'
import './index.css'
import App from './App'
import { ThemeProvider } from './contexts/ThemeContext'
diff --git a/client/tailwind.config.js b/client/tailwind.config.js
index 126cde97..7a98c41d 100644
--- a/client/tailwind.config.js
+++ b/client/tailwind.config.js
@@ -15,38 +15,38 @@ export default {
},
extend: {
colors: {
- border: "hsl(var(--border))",
- input: "hsl(var(--input))",
- ring: "hsl(var(--ring))",
- background: "hsl(var(--background))",
- foreground: "hsl(var(--foreground))",
- primary: {
- DEFAULT: "hsl(var(--primary))",
- foreground: "hsl(var(--primary-foreground))",
- },
- secondary: {
- DEFAULT: "hsl(var(--secondary))",
- foreground: "hsl(var(--secondary-foreground))",
- },
- destructive: {
- DEFAULT: "hsl(var(--destructive))",
- foreground: "hsl(var(--destructive-foreground))",
+ // Design-system tokens (HSL triplets from src/design-system/tokens/colors.css).
+ // These are the forward-looking names; prefer these in new code.
+ bg: "hsl(var(--color-bg) / <alpha-value>)",
+ "bg-alt": "hsl(var(--color-bg-alt) / <alpha-value>)",
+ "bg-canvas": "hsl(var(--color-bg-canvas) / <alpha-value>)",
+ surface: "hsl(var(--color-surface) / <alpha-value>)",
+ "surface-raised": "hsl(var(--color-surface-raised) / <alpha-value>)",
+ fg: "hsl(var(--color-fg) / <alpha-value>)",
+ "fg-secondary": "hsl(var(--color-fg-secondary) / <alpha-value>)",
+ "fg-muted": "hsl(var(--color-fg-muted) / <alpha-value>)",
+ border: {
+ DEFAULT: "hsl(var(--color-border))",
+ hover: "hsl(var(--color-border-hover))",
+ focus: "hsl(var(--color-border-focus))",
},
- muted: {
- DEFAULT: "hsl(var(--muted))",
- foreground: "hsl(var(--muted-foreground))",
- },
- accent: {
- DEFAULT: "hsl(var(--accent))",
- foreground: "hsl(var(--accent-foreground))",
- },
- popover: {
- DEFAULT: "hsl(var(--popover))",
- foreground: "hsl(var(--popover-foreground))",
+ primary: {
+ DEFAULT: "hsl(var(--color-primary) / <alpha-value>)",
+ foreground: "hsl(var(--color-primary-fg) / <alpha-value>)",
},
- card: {
- DEFAULT: "hsl(var(--card))",
- foreground: "hsl(var(--card-foreground))",
+ success: "hsl(var(--color-success) / <alpha-value>)",
+ warning: "hsl(var(--color-warning) / <alpha-value>)",
+ danger: "hsl(var(--color-danger) / <alpha-value>)",
+ info: "hsl(var(--color-info) / <alpha-value>)",
+ accent: "hsl(var(--color-accent) / <alpha-value>)",
+ dracula: {
+ green: "hsl(var(--color-dracula-green) / <alpha-value>)",
+ purple: "hsl(var(--color-dracula-purple) / <alpha-value>)",
+ pink: "hsl(var(--color-dracula-pink) / <alpha-value>)",
+ cyan: "hsl(var(--color-dracula-cyan) / <alpha-value>)",
+ red: "hsl(var(--color-dracula-red) / <alpha-value>)",
+ orange: "hsl(var(--color-dracula-orange) / <alpha-value>)",
+ yellow: "hsl(var(--color-dracula-yellow) / <alpha-value>)",
},
},
borderRadius: {
diff --git a/docs-internal/ui_migration_plan.md b/docs-internal/ui_migration_plan.md
new file mode 100644
index 00000000..419fb758
--- /dev/null
+++ b/docs-internal/ui_migration_plan.md
@@ -0,0 +1,226 @@
+# Frontend UI Stack Migration — antd → shadcn/ui + Base UI + Tailwind 4
+
+## Context
+
+The MachinaOs frontend is coupled to Ant Design (40 files, 187-line theme file, `ConfigProvider` at root). Session docs — [frontend_ui_stack_recommendation.md](./frontend_ui_stack_recommendation.md), [frontend_system_design_rfc.md](./frontend_system_design_rfc.md), [frontend_ui_framework_research.md](./frontend_ui_framework_research.md) — prescribe moving to shadcn/ui (ownership model) + Base UI / Radix primitives + React Aria (surgical a11y) + Tailwind 4 + JSON Forms for a schema-driven inspector.
+
+Motivation: antd's enterprise chrome blocks distinctive product UI; per-node-type branching in `ParameterRenderer.tsx` doesn't scale; the frontend should be a schema consumer of backend `NodeSpec`. The credentials subsystem is the documented exemplar.
+
+Intended outcome: each phase ships independently, app stays green throughout, final state removes antd + styled-components, bundle shrinks ~200-400 KB gzipped, inspector becomes spec-driven.
+
+## Codebase facts (from audit, 2026-04-13)
+
+- **antd usage:** 40 files. Top components by import count: `Space` (20), `Button` (16), `Flex` (13), `Tag` (11), `Spin` (10), `Alert` (10), `Typography` (9), `InputNumber` (7), `Collapse` (7), `Input` (6), `Card` (6), `Form` (5), `Statistic` (4), `Select` (4), `Switch` (3)
+- **ConfigProvider:** only in [client/src/App.tsx](../client/src/App.tsx); theme config in [client/src/config/antdTheme.ts](../client/src/config/antdTheme.ts) mirrors [client/src/styles/theme.ts](../client/src/styles/theme.ts)
+- **Already installed:** Tailwind 4.1.13, `@radix-ui/react-dialog`, `@radix-ui/react-collapsible`, `react-hook-form`, `[email protected]` (scoped to `components/credentials/` in [client/vite.config.js](../client/vite.config.js)), `@uiw/react-json-view`
+- **styled-components:** exactly 1 file — [client/src/components/shared/JSONTreeRenderer.tsx](../client/src/components/shared/JSONTreeRenderer.tsx)
+- **Imperative antd APIs:** 26 calls to `message.*` / `notification.*` across 6 files (`MasterSkillEditor`, `MiddleSection`, `PricingConfigModal`, `SettingsPanel`, `useApiKeyValidation`, `formatters`)
+- **antd Form:** 7 files, mostly under `components/credentials/panels/` + `sections/`
+- **Existing Radix primitive:** [client/src/components/ui/Modal.tsx](../client/src/components/ui/Modal.tsx) already uses `@radix-ui/react-dialog`
+- **Exemplar subsystem (credentials):**
+ - Zustand (UI-only): [useCredentialRegistry.ts](../client/src/store/useCredentialRegistry.ts)
+ - TanStack Query + `idb-keyval` warm-start: [useCatalogueQuery.ts](../client/src/hooks/useCatalogueQuery.ts)
+ - Server JSON hydration: [catalogueAdapter.ts](../client/src/components/credentials/catalogueAdapter.ts)
+ - Backend endpoint: `get_credential_catalogue` in [server/routers/websocket.py](../server/routers/websocket.py)
+- **No NodeSpec contract on frontend today.** `nodeDefinitions/*` are static TS modules.
+- **No test runner, no Storybook.**
+
+## Phases
+
+Each phase is independently shippable. Dependency order: 0 → {1, 2, 3} parallelizable → 4 → 5 → 7; 6 can overlap 5 if staffed separately.
+
+---
+
+### Phase 0 — Design-system foundation
+
+**Goal:** owned tokens + core primitives. Nothing removed yet. Blocks everything else.
+
+**New directory:** `client/src/design-system/`
+
+- `tokens/{colors,radius,spacing,typography,motion,elevation}.css` — CSS custom props lifted from [client/src/styles/theme.ts](../client/src/styles/theme.ts) as HSL triplets (no `hsl()` wrapper → Tailwind alpha composition works).
+- `tokens/index.css` — imports + `[data-theme="dark"]` override block.
+- `lib/cn.ts` — `clsx` + `tailwind-merge` helper.
+- `primitives/{Button,Badge,Stack,Inline,Spinner,Alert,Text,Heading}.tsx` — shadcn-style for `Button`/`Badge`/`Alert`; owned thin wrappers for `Stack`/`Inline`/`Spinner`/`Text`/`Heading`.
+- `index.ts` — barrel.
+
+**Modified files:**
+- [client/tailwind.config.js](../client/tailwind.config.js) — point the existing `hsl(var(--...))` scaffolding at the new token names.
+- `client/src/main.tsx` — `import '@/design-system/tokens/index.css'` before antd stylesheet.
+
+**Deps to add:** `class-variance-authority@^0.7.1`, `clsx@^2.1.1`, `tailwind-merge@^2.5.4`, `@radix-ui/react-slot@^1.1.0`
+
+**Verification:** temporary `/design-system` dev route renders every primitive in both themes; `pnpm build` green; no user-visible app change.
+
+**Effort:** 3-4 days.
+
+---
+
+### Phase 1 — Toasts (antd `message` / `notification` → `sonner`)
+
+**Goal:** atomic swap of 26 call-sites across 6 files.
+
+- New: `client/src/design-system/primitives/Toaster.tsx` + `lib/toast.ts` (thin adapter preserving `toast.success/error/info/warning/loading/promise` signatures close to antd's).
+- Modify [client/src/App.tsx](../client/src/App.tsx) — mount `<Toaster />` alongside (not replacing) `ConfigProvider`.
+- Grep replace in: `MasterSkillEditor.tsx`, `MiddleSection.tsx`, `PricingConfigModal.tsx`, `SettingsPanel.tsx`, `hooks/useApiKeyValidation.ts`, `utils/formatters.ts`.
+
+**Deps to add:** `sonner@^1.7.1`
+
+**Verification:** trigger each call-site manually; grep confirms zero `message|notification` imports from `'antd'`.
+
+**Effort:** 0.5-1 day. Independent of all other phases.
+
+---
+
+### Phase 2 — Visual primitives (`Tag`, `Space`, `Flex`, `Spin`, `Alert`, `Typography`)
+
+**Goal:** replace ~73 pure-presentational call-sites. Zero behavior changes.
+
+Sub-PRs (one per primitive):
+- **2a `Tag` → `Badge`** — map antd `color` prop: `red→danger`, `green→success`, `gold|orange→warning`, `blue|cyan→info`, `purple|magenta→secondary`.
+- **2b `Space` / `Flex` → `Stack` / `Inline`** — `<Space size="middle">` → `<Inline gap="3">`; `direction="vertical"` → `<Stack>`.
+- **2c `Spin` → `Spinner` / `SpinnerOverlay`** — build `SpinnerOverlay` for the `<Spin spinning>{children}</Spin>` idiom.
+- **2d `Alert` → `Alert`** — map `type` to variant; `message` → children; `description` → secondary slot.
+- **2e `Typography`** — `Title level` → `<Heading level>`; `Text type="secondary"` → `<Text muted>`.
+
+**Impact:** `components/shared/*`, `components/credentials/panels/*`, [OutputPanel.tsx](../client/src/components/output/OutputPanel.tsx) (already uses `Flex`/`Tag`/`Space`), inspector panels.
+
+**Verification:** smoke-test every route/panel; grep confirms zero hits for the 6 component names from `'antd'`.
+
+**Effort:** 2-3 days.
+
+---
+
+### Phase 3 — Overlays & disclosure (`Modal`, `Collapse`, `Popover`, `Tooltip`, `Dropdown`, `Tabs`)
+
+**Goal:** extend the existing Radix pattern from [client/src/components/ui/Modal.tsx](../client/src/components/ui/Modal.tsx).
+
+- New primitives under `client/src/design-system/primitives/`:
+ - `Dialog.tsx` — absorb existing `Modal` behind same public API
+ - `Collapsible.tsx` — replaces 7 antd `Collapse` sites incl. `OutputPanel`
+ - `Popover.tsx`, `Tooltip.tsx`, `DropdownMenu.tsx`, `Tabs.tsx`
+- Eventually redirect imports from [Modal.tsx](../client/src/components/ui/Modal.tsx) and delete.
+
+**Deps to add:** `@radix-ui/react-popover@^1.1.2`, `@radix-ui/react-tooltip@^1.1.4`, `@radix-ui/react-dropdown-menu@^2.1.2`, `@radix-ui/react-tabs@^1.1.1`
+
+**Verification:** open every modal; expand/collapse every panel; keyboard nav (Tab/Esc/Enter).
+
+**Effort:** 2-3 days.
+
+---
+
+### Phase 4 — Simple inputs (`Button`, `Input`, `InputNumber`, `Select`, `Switch`, `Card`, `Statistic`)
+
+**Goal:** replace remaining chrome outside `Form` contexts. After this, only antd `Form` + `ParameterRenderer` remain.
+
+- New primitives:
+ - `Input.tsx` (shadcn)
+ - `NumberField.tsx` (React Aria — locale-aware, stepper)
+ - `Select.tsx` (Radix)
+ - `Switch.tsx` (Radix)
+ - `Card.tsx` (shadcn with `Header`/`Title`/`Description`/`Content`/`Footer`)
+ - `Statistic.tsx` (custom, label+value+delta)
+- Button migration mapping: `type="primary"`→`variant="default"`, `type="link"`→`variant="link"`, `type="text"`→`variant="ghost"`, `danger`→`variant="destructive"`, `loading` prop → compose `<Spinner />`.
+
+**Deps to add:** `@radix-ui/react-select@^2.1.2`, `@radix-ui/react-switch@^1.1.1`, `@radix-ui/react-label@^2.1.0`, `react-aria-components@^1.4.1`
+
+**Verification:** every button/input/select smoke-tested; `NumberField` step/min/max/precision verified.
+
+**Effort:** 3-4 days.
+
+---
+
+### Phase 5 — Form migration (credentials subsystem)
+
+**Goal:** replace 7 antd Form files using `react-hook-form` (already installed) + new primitives. Credentials is the exemplar — set the pattern here, reuse elsewhere.
+
+- New primitive: `client/src/design-system/form/Form.tsx` — shadcn composition (`Form`, `FormField`, `FormItem`, `FormLabel`, `FormControl`, `FormDescription`, `FormMessage`).
+- For each panel (mostly under [client/src/components/credentials/panels/](../client/src/components/credentials/panels/) + [sections/](../client/src/components/credentials/sections/)):
+ 1. `Form.useForm()` → `useForm<Schema>({ resolver: zodResolver(schema) })`
+ 2. `<Form.Item rules={...}>` → `<FormField name render>` + zod schema
+ 3. Per-panel schema file: `credentials/panels/schemas/{provider}CredentialSchema.ts`
+- Leave `useCredentialRegistry`, `useCatalogueQuery`, `catalogueAdapter.ts` untouched — only rendering layer changes.
+
+**Deps to add:** `@hookform/resolvers@^3.9.1`, `zod@^3.23.8` (verify)
+
+**Verification:** CRUD every credential type; validation errors surface on correct fields.
+
+**Effort:** 4-6 days. Largest single slice.
+
+---
+
+### Phase 6 — `ParameterRenderer` → JSON Forms + renderer registry
+
+**Goal:** replace 15+ branch switch in [ParameterRenderer.tsx](../client/src/components/ParameterRenderer.tsx) with schema-driven system. Depends on backend emitting `NodeSpec`.
+
+**Prerequisite (backend):** `get_node_spec` WebSocket handler returning `NodeSpec { jsonSchema, uiSchema, _uiHints? }` per RFC.
+
+- New directory: `client/src/components/inspector/`
+ - `renderers/` — one file per renderer: `StringRenderer`, `NumberRenderer`, `BooleanRenderer`, `EnumRenderer`, `ObjectRenderer`, `ArrayRenderer`, `CodeRenderer`, `SecretRenderer`, `CredentialRefRenderer`, `ExpressionRenderer`, `FileRenderer`, `DateTimeRenderer` (enumerate from current switch branches)
+ - `renderers/registry.ts` — `[{ tester, renderer }]` priority array, mirrors credentials registry pattern
+ - `NodeInspector.tsx` — wraps `<JsonForms schema uischema renderers data onChange />`
+ - `hooks/useNodeSpec.ts` — TanStack Query + `idb-keyval`, mirrors [useCatalogueQuery.ts](../client/src/hooks/useCatalogueQuery.ts)
+- Wire `_uiHints` into [client/src/components/output/OutputPanel.tsx](../client/src/components/output/OutputPanel.tsx) (currently noted as "future"; this is the natural home).
+- Broaden React Compiler scope in [client/vite.config.js](../client/vite.config.js) to include `components/inspector/`.
+- Feature flag `VITE_USE_NODESPEC` for phased rollout; delete old `ParameterRenderer.tsx` once stable.
+
+**Deps to add:** `@jsonforms/core@^3.3.0`, `@jsonforms/react@^3.3.0` (NOT material/vanilla renderers — own the registry)
+
+**Verification:** every node type in `nodeDefinitions/*` renders via inspector; `VITE_USE_NODESPEC=false` falls back to old renderer; no layout jank on 50-parameter nodes.
+
+**Effort:** 6-10 days + backend coordination.
+
+---
+
+### Phase 7 — Retire antd, `ConfigProvider`, styled-components
+
+**Goal:** delete the old stack. Bundle shrinks ~200-400 KB gzipped.
+
+- Verify zero `from 'antd'` imports remain.
+- Migrate [client/src/components/shared/JSONTreeRenderer.tsx](../client/src/components/shared/JSONTreeRenderer.tsx) — rewrite styled-components as Tailwind classes.
+- Delete: [client/src/config/antdTheme.ts](../client/src/config/antdTheme.ts), `ConfigProvider` wrapper in [client/src/App.tsx](../client/src/App.tsx), antd reset CSS import in `main.tsx`; inline remaining [client/src/styles/theme.ts](../client/src/styles/theme.ts) usages against CSS vars then delete.
+- Remove from [client/package.json](../client/package.json): `antd`, `styled-components`, `@types/styled-components`.
+- Broaden React Compiler scope to whole `src/`.
+
+**Verification:** full app regression; record bundle size before/after; `pnpm build` + `tsc --noEmit` green.
+
+**Rollback:** keep `pre-phase-7` branch; antd reinstalls cleanly if regression found post-deploy.
+
+**Effort:** 1-2 days.
+
+---
+
+## Cross-cutting
+
+### Testing posture
+No test runner exists. Before Phase 5, decide:
+- **Minimum:** Playwright smoke tests for credential CRUD, inspector edit, output render (~2 days).
+- **Ideal:** Vitest + Testing Library for primitives + Storybook for design system (~4-5 days).
+
+All verification steps above are manual unless tests are added.
+
+### Total effort
+~22-33 dev-days (~6-8 weeks focused work).
+
+### Critical files
+- [client/src/App.tsx](../client/src/App.tsx) — `ConfigProvider` removal in Phase 7
+- [client/src/config/antdTheme.ts](../client/src/config/antdTheme.ts) — theme migration source
+- [client/src/styles/theme.ts](../client/src/styles/theme.ts) — token source for Phase 0
+- [client/tailwind.config.js](../client/tailwind.config.js) — Phase 0 rewiring
+- [client/vite.config.js](../client/vite.config.js) — React Compiler scope expansion
+- [client/src/components/ParameterRenderer.tsx](../client/src/components/ParameterRenderer.tsx) — Phase 6 target
+- [client/src/components/credentials/](../client/src/components/credentials/) — exemplar for Phase 5 and 6
+- [client/src/components/output/OutputPanel.tsx](../client/src/components/output/OutputPanel.tsx) — `_uiHints` wiring in Phase 6
+- [client/src/components/ui/Modal.tsx](../client/src/components/ui/Modal.tsx) — subsume into `Dialog` in Phase 3
+- [client/src/components/shared/JSONTreeRenderer.tsx](../client/src/components/shared/JSONTreeRenderer.tsx) — last styled-components site
+
+### Rollout / rollback
+Each phase is behind no flag except Phase 6 (`VITE_USE_NODESPEC`). Rollback = single-PR revert; antd coexists with new stack until Phase 7.
+
+## End-to-end verification (post Phase 7)
+
+1. `pnpm install && pnpm build` — green, bundle size recorded
+2. `pnpm exec tsc --noEmit` — zero errors
+3. Full manual regression: workflow open/save, node CRUD, credential CRUD per provider type, parameter edit, workflow run, output render (markdown/JSON/error), theme toggle light↔dark, keyboard nav (Tab/Esc/Enter on all modals/menus)
+4. Bundle analyzer (`vite-bundle-visualizer`): confirm antd + moment/dayjs locales removed
+5. `grep -r "from 'antd'" client/src/` returns zero
+6. `grep -r "styled-components" client/src/` returns zero
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e8322e54..a7228a4c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -44,6 +44,9 @@ importers:
'@radix-ui/react-dialog':
specifier: ^1.1.15
+ '@radix-ui/react-slot':
+ specifier: ^1.2.4
+ version: 1.2.4(@types/[email protected])([email protected])
'@tailwindcss/typography':
specifier: ^0.5.19
version: 0.5.19([email protected])
@@ -80,6 +83,12 @@ importers:
autoprefixer:
specifier: ^10.4.21
version: 10.4.22([email protected])
+ class-variance-authority:
+ specifier: ^0.7.1
+ version: 0.7.1
+ clsx:
+ specifier: ^2.1.1
+ version: 2.1.1
cmdk:
specifier: ^1
@@ -143,6 +152,9 @@ importers:
styled-components:
specifier: ^6.1.19
+ tailwind-merge:
+ specifier: ^3.5.0
+ version: 3.5.0
tailwindcss:
specifier: ^4.1.13
version: 4.1.17
@@ -4330,6 +4342,9 @@ packages:
resolution: {integrity: sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ==}
+ resolution: {integrity: sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==}
+
resolution: {integrity: sha512-j9Ee2YjuQqYT9bbRTfTZht9W/ytp5H+jJpZKiYdP/bpnXARAuELt9ofP0lPnmHjbga7SNQIxdTAXCmtKVYjN+Q==}
@@ -9778,6 +9793,8 @@ snapshots:
+