diff --git a/.gitignore b/.gitignore index 498db9c..457674a 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ packages/nodes/tsconfig.tsbuildinfo .agents/rules/code-mentor.md standard the output.md packages/kafka/tsconfig.tsbuildinfo +.agents/rules/ diff --git a/apps/http-backend/src/routes/userRoutes/userRoutes.ts b/apps/http-backend/src/routes/userRoutes/userRoutes.ts index 29c500e..a0ab4bd 100644 --- a/apps/http-backend/src/routes/userRoutes/userRoutes.ts +++ b/apps/http-backend/src/routes/userRoutes/userRoutes.ts @@ -295,6 +295,27 @@ router.get("/dashboard/overview", description: true, createdAt: true, status: true, + nodes: { + select: { + id: true, + name: true, + stage: true, + }, + }, + Trigger: { + select: { + id: true, + name: true, + }, + }, + executions: { + orderBy: { startAt: "desc" }, + take: 1, + select: { + status: true, + startAt: true, + }, + }, }, }), prismaClient.credential.findMany({ @@ -344,6 +365,16 @@ router.get("/dashboard/overview", const googleSheetsConnected = hasSharedGoogleOAuth || credentialTypes.has("gsheet_oauth"); + const formattedRecentWorkflows = recentWorkflows.map((wf) => ({ + id: wf.id, + name: wf.name, + description: wf.description, + createdAt: wf.createdAt, + status: (wf as any).executions?.[0]?.status || wf.status || null, + lastExecutionAt: (wf as any).executions?.[0]?.startAt || null, + nodeCount: ((wf as any).nodes?.length || 0) + ((wf as any).Trigger ? 1 : 0), + })); + return res.status(statusCodes.OK).json({ message: "Dashboard overview fetched successfully", data: { @@ -365,7 +396,7 @@ router.get("/dashboard/overview", connected: googleSheetsConnected, }, ], - recentWorkflows, + recentWorkflows: formattedRecentWorkflows, }, }); } catch (error) { @@ -563,6 +594,32 @@ router.get("/workflows", where: { userId, }, + include: { + nodes: { + select: { + id: true, + name: true, + stage: true, + }, + }, + Trigger: { + select: { + id: true, + name: true, + }, + }, + executions: { + orderBy: { startAt: "desc" }, + take: 1, + select: { + status: true, + startAt: true, + }, + }, + }, + orderBy: { + createdAt: "desc", + }, }); // console.log(workflows); return res diff --git a/apps/web/app/apple-icon.png b/apps/web/app/apple-icon.png new file mode 100644 index 0000000..f4667a3 Binary files /dev/null and b/apps/web/app/apple-icon.png differ diff --git a/apps/web/app/components/Actions/ActionSidebar.tsx b/apps/web/app/components/Actions/ActionSidebar.tsx index c3c32a8..5e1e95e 100644 --- a/apps/web/app/components/Actions/ActionSidebar.tsx +++ b/apps/web/app/components/Actions/ActionSidebar.tsx @@ -42,44 +42,44 @@ export const ActionSideBar = ({ isOpen, onClose, onSelectAction }: SideBarProps) return ( !open && onClose()}> - +
-
- +
+
- Add Action Step -

Choose a tool, app, or transform node

+ Add Action Step +

Choose a tool, app, or transform node

{/* Search */}
- + setSearch(e.target.value)} - className="w-full pl-10 pr-4 py-2.5 rounded-2xl bg-white border border-gray-200 text-xs text-gray-900 placeholder-gray-400 focus:outline-none focus:border-black focus:ring-1 focus:ring-black/10 transition-all shadow-sm" + className="w-full pl-10 pr-4 py-2.5 rounded-xl bg-secondary border border-border text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary/50 transition-all font-medium" />
{/* Actions list */}
{loading ? ( -
- +
+ Loading available actions...
) : error ? ( -
+
Error fetching actions.
) : filteredActions.length === 0 ? ( -
+
No actions found matching "{search}"
) : ( @@ -95,7 +95,7 @@ export const ActionSideBar = ({ isOpen, onClose, onSelectAction }: SideBarProps) }); onClose(); }} - className="group p-4 rounded-3xl bg-white border border-gray-200 hover:border-gray-900 hover:shadow-md transition-all cursor-pointer flex items-center justify-between" + className="group p-4 rounded-2xl bg-card border border-border hover:border-primary/50 hover:bg-secondary/40 hover:shadow-md transition-all cursor-pointer flex items-center justify-between" >
-
+
{action.name}
- + {action.description || `Node type: ${action.type}`}
- +
)) )} diff --git a/apps/web/app/components/ExecutionHistoryFooter.tsx b/apps/web/app/components/ExecutionHistoryFooter.tsx index 539e5f2..c6f2458 100644 --- a/apps/web/app/components/ExecutionHistoryFooter.tsx +++ b/apps/web/app/components/ExecutionHistoryFooter.tsx @@ -9,12 +9,18 @@ import { ChevronDown, ArrowLeft, X, + CheckCircle2, + AlertCircle, + Loader2, + Clock, + RotateCcw, + PlayCircle, + Ban, } from 'lucide-react'; import { WorkflowExecutionLog, NodeExecutionLog } from '@/app/types/execution.types'; import { formatDate, formatDuration, - getStatusIcon, } from '@/app/lib/formatters'; interface ExecutionHistoryFooterProps { @@ -25,35 +31,51 @@ interface ExecutionHistoryFooterProps { } // ─── Status Badge ─── +const renderStatusIcon = (status: string) => { + switch (status) { + case 'Completed': + return ; + case 'Failed': + return ; + case 'InProgress': + return ; + case 'Pending': + return ; + case 'ReConnecting': + return ; + case 'Start': + return ; + case 'Skipped': + return ; + default: + return ; + } +}; + const StatusBadge: React.FC<{ status: string }> = ({ status }) => { - const styles: Record = { - Completed: 'background:rgba(16,185,129,0.15);color:#34d399;border:1px solid rgba(16,185,129,0.3);', - Failed: 'background:rgba(239,68,68,0.15);color:#f87171;border:1px solid rgba(239,68,68,0.3);', - InProgress: 'background:rgba(99,102,241,0.15);color:#818cf8;border:1px solid rgba(99,102,241,0.3);', - Pending: 'background:rgba(245,158,11,0.15);color:#fbbf24;border:1px solid rgba(245,158,11,0.3);', - Start: 'background:rgba(148,163,184,0.15);color:#cbd5e1;border:1px solid rgba(148,163,184,0.3);', - ReConnecting: 'background:rgba(249,115,22,0.15);color:#fb923c;border:1px solid rgba(249,115,22,0.3);', - Skipped: 'background:rgba(100,116,139,0.15);color:#94a3b8;border:1px solid rgba(100,116,139,0.3);', + const getBadgeClass = (s: string) => { + switch (s) { + case 'Completed': + return 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20'; + case 'Failed': + return 'bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/20'; + case 'InProgress': + return 'bg-primary/10 text-primary border-primary/20'; + case 'Pending': + return 'bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20'; + case 'ReConnecting': + return 'bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20'; + case 'Skipped': + return 'bg-muted text-muted-foreground border-border dark:border-white/10'; + default: + return 'bg-muted text-muted-foreground border-border dark:border-white/10'; + } }; + return ( - { - const [k, v] = s.split(':'); - return [k!.trim().replace(/-([a-z])/g, (_, l) => l.toUpperCase()), v!.trim()]; - })), - padding: '3px 10px', - borderRadius: '6px', - fontSize: '11px', - fontWeight: 600, - letterSpacing: '0.3px', - display: 'inline-flex', - alignItems: 'center', - gap: '4px', - whiteSpace: 'nowrap' as const, - }} - > - {getStatusIcon(status)} {status} + + {renderStatusIcon(status)} + {status} ); }; @@ -303,8 +325,8 @@ export default function ExecutionHistoryFooter({ left: sidebarWidth, right: 0, height: '48px', - background: 'rgba(15, 16, 18, 0.95)', - borderTop: '1px solid #27282d', + background: 'var(--chassis)', + borderTop: '1px solid rgba(255, 255, 255, 0.1)', zIndex: 9, display: 'flex', alignItems: 'center', @@ -316,14 +338,14 @@ export default function ExecutionHistoryFooter({ > {/* Left */}
- + Executions - + Last: - + {executions.length} runs
@@ -334,13 +356,13 @@ export default function ExecutionHistoryFooter({ onClick={fetchExecutionLogs} disabled={footerLoading} style={{ - padding: '4px 12px', + padding: '5px 14px', fontSize: '11px', fontWeight: 600, - background: footerLoading ? '#18191c' : '#ffffff', - color: footerLoading ? '#9ca3af' : '#000000', - border: 'none', - borderRadius: '6px', + background: footerLoading ? 'rgba(255, 255, 255, 0.05)' : 'rgba(255, 255, 255, 0.10)', + color: footerLoading ? 'rgba(255, 255, 255, 0.4)' : '#ffffff', + border: '1px solid rgba(255, 255, 255, 0.12)', + borderRadius: '8px', cursor: footerLoading ? 'wait' : 'pointer', transition: 'all 0.15s ease', display: 'flex', @@ -363,13 +385,13 @@ export default function ExecutionHistoryFooter({ if (!isExpanded) setSelectedExecution(null); }} style={{ - padding: '4px 12px', + padding: '5px 14px', fontSize: '11px', fontWeight: 600, - background: isExpanded ? '#18191c' : '#ffffff', - color: isExpanded ? '#9ca3af' : '#000000', - border: isExpanded ? '1px solid #27282d' : 'none', - borderRadius: '6px', + background: isExpanded ? 'rgba(255, 255, 255, 0.05)' : 'rgba(255, 255, 255, 0.10)', + color: '#ffffff', + border: '1px solid rgba(255, 255, 255, 0.12)', + borderRadius: '8px', cursor: 'pointer', transition: 'all 0.15s ease', display: 'flex', diff --git a/apps/web/app/components/dashboard/DashboardSidebar.tsx b/apps/web/app/components/dashboard/DashboardSidebar.tsx index 7fec8b3..60dfae8 100644 --- a/apps/web/app/components/dashboard/DashboardSidebar.tsx +++ b/apps/web/app/components/dashboard/DashboardSidebar.tsx @@ -4,7 +4,7 @@ import React from "react"; import Link from "next/link"; import { LayoutGrid, - Workflow, + GitBranch, BarChart2, Boxes, Settings, @@ -13,6 +13,7 @@ import { } from "lucide-react"; import { DashboardTab } from "@/app/types/dashboard.types"; import { signOut } from "next-auth/react"; +import { Logo } from "@/app/components/ui/Logo"; interface SidebarProps { activeTab: DashboardTab; @@ -24,7 +25,7 @@ interface SidebarProps { const NAV_ITEMS: { id: DashboardTab; label: string; icon: any }[] = [ { id: "dashboard", label: "Home", icon: LayoutGrid }, - { id: "automations", label: "Workflows", icon: Workflow }, + { id: "automations", label: "Workflows", icon: GitBranch }, { id: "executions", label: "Progress", icon: BarChart2 }, { id: "integrations", label: "Integrations", icon: Boxes }, { id: "profile", label: "Settings", icon: Settings }, @@ -46,117 +47,141 @@ export default function DashboardSidebar({ signOut({ callbackUrl: "/login" }); }; - const sidebarContent = ( -
-
- {/* Brand Header */} -
- -
- B -
-
- - BuildFlow - -
- + return ( + <> + {/* ── Desktop Docked Sidebar (Fixed 240px with Bezier Concave Fillets) ── */} + + + {/* ── Mobile Slide-Over Backdrop ── */} + {isOpenMobile && ( +
+ )} - {/* Mobile Close Button */} - {onCloseMobile && ( + {/* ── Mobile Slide-Over Drawer (Normal Curved Buttons) ── */} +
- ); - })} - -
- - {/* Bottom Footer: Sign Out Button */} -
- -
-
- ); - - return ( - <> - {/* Desktop Fixed Docked Sidebar */} - - - {/* Mobile Slide-Over Backdrop */} - {isOpenMobile && ( -
- )} - - {/* Mobile Slide-Over Drawer */} - ); diff --git a/apps/web/app/components/dashboard/DashboardStatCard.tsx b/apps/web/app/components/dashboard/DashboardStatCard.tsx index 5f9e630..c8af604 100644 --- a/apps/web/app/components/dashboard/DashboardStatCard.tsx +++ b/apps/web/app/components/dashboard/DashboardStatCard.tsx @@ -27,13 +27,13 @@ export default function DashboardStatCard({ if (loading) { return (
-
+
-
-
-
+
+
+
); @@ -41,24 +41,24 @@ export default function DashboardStatCard({ return (
-
+
{icon}
-

{label}

+

{label}

-

{value}

+

{value}

{trend && ( {trend.positive ? : } @@ -66,7 +66,7 @@ export default function DashboardStatCard({ )}
- {hint &&

{hint}

} + {hint &&

{hint}

}
); diff --git a/apps/web/app/components/dashboard/ExecutionHealthGauge.tsx b/apps/web/app/components/dashboard/ExecutionHealthGauge.tsx index 1a15276..b253a97 100644 --- a/apps/web/app/components/dashboard/ExecutionHealthGauge.tsx +++ b/apps/web/app/components/dashboard/ExecutionHealthGauge.tsx @@ -2,7 +2,6 @@ import { useMemo } from "react"; import { PieChart, Pie, Cell, ResponsiveContainer } from "recharts"; -import { MoreHorizontal } from "lucide-react"; import { DashboardOverview } from "@/app/types/dashboard.types"; interface ExecutionHealthProps { @@ -15,21 +14,16 @@ export default function ExecutionHealthGauge({ overview }: ExecutionHealthProps) const delayedRate = Math.max(0, 100 - successRate - failedRate); const gaugeData = useMemo(() => [ - { name: "Success", value: successRate, color: "#10b981" }, - { name: "Delayed", value: delayedRate, color: "#f59e0b" }, - { name: "Failed", value: failedRate || 0.5, color: "#ef4444" }, + { name: "Success", value: successRate, color: "var(--success)" }, + { name: "Delayed", value: delayedRate, color: "var(--warning)" }, + { name: "Failed", value: failedRate || 0.5, color: "var(--destructive)" }, ], [successRate, failedRate, delayedRate]); return ( -
-
-
-
-

Execution Health

-
- +
+
+
+

Execution Health

{/* Gauge */} @@ -56,8 +50,8 @@ export default function ExecutionHealthGauge({ overview }: ExecutionHealthProps) {/* Center text */}
- {successRate.toFixed(1)}% - + {successRate.toFixed(1)}% + System Healthy
@@ -66,20 +60,20 @@ export default function ExecutionHealthGauge({ overview }: ExecutionHealthProps) {/* Legend */}
-
- Success +
+ Success
-
- Delayed +
+ Delayed
-
- Failed +
+ Failed
-

+

Health calculated across all runtime channels (Past 7 days)

diff --git a/apps/web/app/components/dashboard/IntegrationStatus.tsx b/apps/web/app/components/dashboard/IntegrationStatus.tsx index 4632e55..1706092 100644 --- a/apps/web/app/components/dashboard/IntegrationStatus.tsx +++ b/apps/web/app/components/dashboard/IntegrationStatus.tsx @@ -1,6 +1,5 @@ "use client"; -import { MoreHorizontal } from "lucide-react"; import { DashboardOverview } from "@/app/types/dashboard.types"; interface IntegrationStatusProps { @@ -11,37 +10,34 @@ export default function IntegrationStatus({ overview }: IntegrationStatusProps) const integrations = overview?.integrations ?? []; const iconMap: Record = { - gmail: { label: "Gmail", color: "#ef4444", src: "/gmail.svg" }, - googleSheets: { label: "Google Drive", color: "#10b981", src: "/google_sheet.svg" }, + gmail: { label: "Gmail", color: "var(--destructive)", src: "/gmail.svg" }, + googleSheets: { label: "Google Sheets", color: "var(--success)", src: "/google_sheet.svg" }, }; return ( -
+
-

Integration Status

- +

Integration Status

{/* Bar visualization */}
{integrations.length === 0 && ( -
+
No integrations found.
)} {integrations.map((int) => { - const info = iconMap[int.key] || { label: int.label, color: "#6366f1", src: "/globe.png" }; + const info = iconMap[int.key] || { label: int.label, color: "var(--primary)", src: "/globe.png" }; return (
-
+
@@ -53,13 +49,13 @@ export default function IntegrationStatus({ overview }: IntegrationStatusProps) {/* Labels */}
{integrations.map((int) => { - const info = iconMap[int.key] || { label: int.label, color: "#6366f1", src: "/globe.png" }; + const info = iconMap[int.key] || { label: int.label, color: "var(--primary)", src: "/globe.png" }; return (
-
+
{info.label}
- {info.label} + {info.label}
); })} diff --git a/apps/web/app/components/dashboard/RecentWorkflows.tsx b/apps/web/app/components/dashboard/RecentWorkflows.tsx index 48f4be6..6d4368e 100644 --- a/apps/web/app/components/dashboard/RecentWorkflows.tsx +++ b/apps/web/app/components/dashboard/RecentWorkflows.tsx @@ -1,6 +1,6 @@ "use client"; -import { MoreHorizontal, CheckCircle2, Clock, Circle } from "lucide-react"; +import { CheckCircle2, Clock, Circle, XCircle, Loader2 } from "lucide-react"; import { DashboardOverview } from "@/app/types/dashboard.types"; interface RecentWorkflowsProps { @@ -32,63 +32,96 @@ export default function RecentWorkflows({ overview }: RecentWorkflowsProps) { switch (status?.toLowerCase()) { case "active": case "completed": - return ; + return ; + case "failed": + return ; + case "inprogress": + case "running": + return ; case "pending": - case "draft": - return ; + return ; default: - return ; + return ; } }; const getStatusDot = (status?: string | null) => { - const isSuccess = status?.toLowerCase() === "active" || status?.toLowerCase() === "completed"; + const s = status?.toLowerCase(); + if (s === "completed" || s === "active") { + return ( + + + Success + + ); + } + if (s === "failed") { + return ( + + + Failed + + ); + } + if (s === "inprogress" || s === "running") { + return ( + + + Running + + ); + } + if (s === "pending") { + return ( + + + Pending + + ); + } return ( - - {status || "Draft"} + + Never run ); }; return ( -
-
-

Recent Workflows

- +
+
+

Recent Workflows

{workflows.length === 0 ? ( -
+
No workflows drafted yet
) : (
- - - - - + + + + + - + {workflows.slice(0, 5).map((wf) => ( - + - + - + ))} diff --git a/apps/web/app/components/dashboard/WorkflowActivityChart.tsx b/apps/web/app/components/dashboard/WorkflowActivityChart.tsx index a6771fc..b6fc501 100644 --- a/apps/web/app/components/dashboard/WorkflowActivityChart.tsx +++ b/apps/web/app/components/dashboard/WorkflowActivityChart.tsx @@ -10,7 +10,7 @@ import { XAxis, YAxis, } from "recharts"; -import { MoreHorizontal, Activity } from "lucide-react"; +import { Activity } from "lucide-react"; import { DashboardExecutionTrend, DashboardRange } from "@/app/types/dashboard.types"; const RANGE_OPTIONS: DashboardRange[] = ["7d", "30d", "90d"]; @@ -45,23 +45,18 @@ export default function WorkflowActivityChart({ }, [chartData]); return ( -
-
-
-
-

Workflow Activity Trend

-
- +
+
+
+

Workflow Activity Trend

{/* Peak indicator */} {peakValue.value > 0 ? (
- Peak Executions - {peakValue.value} - + Peak Executions + {peakValue.value} + ▲ {((peakValue.value / (trend?.totals.total || 1)) * 100).toFixed(0)}%
@@ -77,8 +72,8 @@ export default function WorkflowActivityChart({ onClick={() => onRangeChange(r)} className={`px-3 py-1.5 text-xs font-semibold uppercase rounded-xl transition-all cursor-pointer ${ selectedRange === r - ? "bg-white text-black shadow-sm font-bold" - : "text-[#9ca3af] hover:text-white hover:bg-[#1e2025]" + ? "bg-primary text-primary-foreground shadow-xs font-bold" + : "text-muted-foreground hover:text-foreground hover:bg-secondary" }`} type="button" > @@ -95,47 +90,47 @@ export default function WorkflowActivityChart({ {[40, 65, 30, 85, 55, 90, 70].map((h, i) => (
))}
-
+
) : trendError ? ( -
{trendError}
+
{trendError}
) : chartData.length === 0 ? ( -
- +
+ No activity recorded for this period
) : ( - - - + + + - - - + + + - - - + + + - - + + )} diff --git a/apps/web/app/components/nodes/BaseNode.tsx b/apps/web/app/components/nodes/BaseNode.tsx index f059589..0912aa1 100644 --- a/apps/web/app/components/nodes/BaseNode.tsx +++ b/apps/web/app/components/nodes/BaseNode.tsx @@ -31,68 +31,59 @@ function getNodeTheme(name: string, isTrigger: boolean) { const lower = name.toLowerCase(); if (lower.includes("sheet") || lower.includes("drive")) { return { - cardBg: "bg-[#ecfdf5] border-[#a7f3d0] text-[#065f46]", - iconBg: "bg-white shadow-sm", - badge: "bg-emerald-100/80 text-emerald-800 border-emerald-200", - accent: "text-emerald-700", + iconBg: "bg-emerald-500/15 border border-emerald-500/30 text-emerald-400", + badge: "bg-emerald-500/15 text-emerald-400 border border-emerald-500/30", + accent: "text-emerald-400", handle: "!bg-emerald-500", }; } if (lower.includes("mail") || lower.includes("gmail") || lower.includes("webhook")) { return { - cardBg: "bg-[#fdf2f8] border-[#fbcfe8] text-[#9d174d]", - iconBg: "bg-white shadow-sm", - badge: "bg-pink-100/80 text-pink-800 border-pink-200", - accent: "text-pink-700", - handle: "!bg-pink-500", + iconBg: "bg-rose-500/15 border border-rose-500/30 text-rose-400", + badge: "bg-rose-500/15 text-rose-400 border border-rose-500/30", + accent: "text-rose-400", + handle: "!bg-rose-500", }; } if (lower.includes("slack") || lower.includes("http") || lower.includes("api") || lower.includes("request")) { return { - cardBg: "bg-[#f0f9ff] border-[#bae6fd] text-[#0369a1]", - iconBg: "bg-white shadow-sm", - badge: "bg-sky-100/80 text-sky-800 border-sky-200", - accent: "text-sky-700", + iconBg: "bg-sky-500/15 border border-sky-500/30 text-sky-400", + badge: "bg-sky-500/15 text-sky-400 border border-sky-500/30", + accent: "text-sky-400", handle: "!bg-sky-500", }; } if (lower.includes("if") || lower.includes("canva") || lower.includes("logic")) { return { - cardBg: "bg-[#faf5ff] border-[#e9d5ff] text-[#6b21a8]", - iconBg: "bg-white shadow-sm", - badge: "bg-purple-100/80 text-purple-800 border-purple-200", - accent: "text-purple-700", + iconBg: "bg-purple-500/15 border border-purple-500/30 text-purple-400", + badge: "bg-purple-500/15 text-purple-400 border border-purple-500/30", + accent: "text-purple-400", handle: "!bg-purple-500", }; } if (lower.includes("filter") || lower.includes("iterator") || lower.includes("loop")) { return { - cardBg: "bg-[#fffbeb] border-[#fde68a] text-[#92400e]", - iconBg: "bg-white shadow-sm", - badge: "bg-amber-100/80 text-amber-800 border-amber-200", - accent: "text-amber-700", + iconBg: "bg-amber-500/15 border border-amber-500/30 text-amber-400", + badge: "bg-amber-500/15 text-amber-400 border border-amber-500/30", + accent: "text-amber-400", handle: "!bg-amber-500", }; } if (lower.includes("notion")) { return { - cardBg: "bg-[#18181b] border-zinc-800 text-white", - iconBg: "bg-zinc-800 text-white", - badge: "bg-zinc-800 text-zinc-300 border-zinc-700", + iconBg: "bg-white/10 border border-white/20 text-white", + badge: "bg-white/10 text-white/90 border border-white/20", accent: "text-white", handle: "!bg-zinc-700", }; } - // Default clean card + // Default clean dark card theme return { - cardBg: isTrigger - ? "bg-[#fff7ed] border-[#fed7aa] text-[#9a3412]" - : "bg-white border-gray-200 text-gray-900", - iconBg: "bg-gray-50 shadow-sm", - badge: "bg-gray-100 text-gray-700 border-gray-200", - accent: "text-gray-700", - handle: "!bg-[#18181b]", + iconBg: "bg-white/10 border border-white/10 text-white", + badge: "bg-white/10 text-white/80 border border-white/15", + accent: "text-white", + handle: "!bg-primary", }; } @@ -118,29 +109,30 @@ export default function BaseNode({ id, type, data }: BaseNodeProps) { const currentStatus = executionStatus || data.status; const statusRing = currentStatus === "running" - ? "ring-4 ring-blue-500/80 shadow-[0_0_20px_rgba(59,130,246,0.6)] animate-pulse" + ? "border-primary ring-4 ring-primary/40 shadow-[0_0_25px_rgba(59,130,246,0.5)] animate-pulse" : currentStatus === "completed" || currentStatus === "success" - ? "ring-4 ring-emerald-500/80 shadow-[0_0_15px_rgba(16,185,129,0.5)]" + ? "border-success ring-2 ring-success/40 shadow-[0_0_20px_rgba(16,185,129,0.3)]" : currentStatus === "failed" || currentStatus === "error" - ? "ring-4 ring-rose-500/80 shadow-[0_0_15px_rgba(244,63,94,0.6)]" - : currentStatus === "skipped" ? "ring-2 ring-slate-400/40 opacity-50 grayscale-[40%]" - : ""; + ? "border-destructive ring-2 ring-destructive/40 shadow-[0_0_20px_rgba(239,68,68,0.5)]" + : currentStatus === "skipped" + ? "border-white/20 opacity-50 grayscale-[50%]" + : "border-white/10 hover:border-primary/50"; // ── Placeholder Node (Make.com Style) ── if (isPlaceholder) { return (
-
+
-

+

{label}

- Click to setup + Click to setup
{/* Handles */} @@ -150,13 +142,13 @@ export default function BaseNode({ id, type, data }: BaseNodeProps) { type="target" position={Position.Left} id="a-in" - className="!w-3 !h-3 !bg-white !border-2 !border-gray-400 hover:!border-black transition-colors" + className="!w-3 !h-3 !bg-primary !border-2 !border-chassis hover:!scale-125 transition-transform" /> ) : ( @@ -164,17 +156,17 @@ export default function BaseNode({ id, type, data }: BaseNodeProps) { type="source" position={Position.Right} id="t-out" - className="!w-3 !h-3 !bg-white !border-2 !border-gray-900" + className="!w-3 !h-3 !bg-primary !border-2 !border-chassis" /> )}
); } - // ── Configured Visual Node Card (Make.com Style) ── + // ── Configured Visual Node Card (Dark Elevated Theme) ── return (
{/* Node Icon Container */} @@ -184,17 +176,17 @@ export default function BaseNode({ id, type, data }: BaseNodeProps) { name={label} size="xl" nodeType={nodeType} - className={`w-14 h-14 rounded-2xl ${theme.iconBg} border border-black/5`} + className={`w-14 h-14 rounded-2xl ${theme.iconBg}`} />
{/* Node Label */} -

+

{label}

{/* Operation / Description */} -

+

{config?.operation?.replace(/_/g, " ") || (isTrigger ? "Webhook trigger" : "Action step")}

@@ -202,25 +194,25 @@ export default function BaseNode({ id, type, data }: BaseNodeProps) {
{isConfigured ? ( - + Ready ) : ( - - Setup needed + + Setup needed )}
{/* Quick Action Buttons on Hover */} -
+
{onConfigure && ( + ); + })} +
+ + {/* Search Input Box */} +
+ + setSearchQuery(e.target.value)} + placeholder="Filter integrations..." + aria-label="Filter integrations" + className="w-full pl-9 pr-4 py-2 rounded-lg bg-card border border-border text-foreground text-xs sm:text-sm placeholder:text-muted-foreground focus:outline-none focus:border-primary transition-colors shadow-xs" + /> +
+
+ + {/* Integrations Responsive Grid (1 col mobile, 2 col tablet, 4 col desktop) */} + + + {filteredIntegrations.map((item) => { + const LucideIcon = item.lucideIcon; + + return ( + +
+ {/* Card Header: Icon + Node Type Badge */} +
+
+ {item.iconType === "image" && item.iconSrc ? ( + + ) : LucideIcon ? ( + + ) : null} +
+ + + {item.nodeType} + +
+ + {/* Title */} +
+

+ {item.name} +

+
+ + {/* Description */} +

+ {item.description} +

+
+ + {/* Card Footer: Metadata Tag */} +
+ {item.authType} + + Configurable + + +
+
+ ); + })} +
+
+ + {/* Empty Search State */} + {filteredIntegrations.length === 0 && ( +
+

+ No integrations found matching "{searchQuery}". +

+ +
+ )} + + {/* Integration Strip Footer / Custom API Callout */} +
+
+
+ +
+
+

+ Don't see your internal system? +

+

+ Connect any custom REST API or webhook destination using our generic HTTP Request Node with bearer tokens and headers. +

+
+
+ + + Explore HTTP Node + + +
+ + ); +} diff --git a/apps/web/app/components/ui/Design/IsometricHeroSystem.tsx b/apps/web/app/components/ui/Design/IsometricHeroSystem.tsx new file mode 100644 index 0000000..04f10b6 --- /dev/null +++ b/apps/web/app/components/ui/Design/IsometricHeroSystem.tsx @@ -0,0 +1,1125 @@ +"use client"; + +import React, { useState, useEffect, useRef, useCallback } from "react"; +import { + Check, + RotateCcw, + Filter, + Mail, + X, +} from "lucide-react"; + +export type NodeId = "webhook" | "filter" | "sheets" | "gmail"; +export type NodeState = "idle" | "processing" | "completed"; +export type EdgeState = "idle" | "flowing" | "completed"; + +interface NodeMetadata { + id: NodeId; + category: string; + title: string; + subtitle: string; + summary: string; +} + +/** + * Plain-English metadata for each horizontal workflow node. + * Visual color is driven purely by execution state (neutral -> blue -> green) + * using theme tokens with zero decorative multi-color clutter. + */ +const WORKFLOW_NODES: Record = { + webhook: { + id: "webhook", + category: "TRIGGER", + title: "Webhook", + subtitle: "New form lead", + summary: "Listens for incoming form submissions and starts the workflow automatically.", + }, + filter: { + id: "filter", + category: "CONDITION", + title: "Filter", + subtitle: "Score >= 80", + summary: "Checks lead score and routes qualified leads to both actions in parallel.", + }, + sheets: { + id: "sheets", + category: "ACTION", + title: "Google Sheets", + subtitle: "Append row", + summary: "Appends the qualified lead details into your Leads Tracker sheet.", + }, + gmail: { + id: "gmail", + category: "ACTION", + title: "Gmail", + subtitle: "Send welcome", + summary: "Sends a personalized welcome email immediately after qualification.", + }, +}; + +/** + * Generates stepped 3D acrylic slab thickness shadows along the down-left vector + * (-0.35px, +1.0px) for rotateX(38deg) rotateY(12deg) rotateZ(-12deg). + * Keeps identical shadow layer count across states so CSS transitions smoothly: + * - 'idle': calm neutral frosted slate + * - 'processing': soft blueish (var(--primary)) edge & ambient glow + * - 'completed': soft green (var(--success)) edge & ambient glow + */ +function buildNodeSlabShadow(steps: number, state: NodeState, elevated = false): string { + const shadows = [ + "inset 0 1px 0 var(--card)", + "inset 1px 0 0 color-mix(in srgb, var(--card) 92%, transparent)", + ]; + + const isProcessing = state === "processing"; + const isCompleted = state === "completed"; + + const tintVar = isProcessing + ? "var(--primary)" + : isCompleted + ? "var(--success)" + : "var(--border)"; + + for (let i = 1; i <= steps; i++) { + const t = (i - 1) / Math.max(steps - 1, 1); + const tintPct = isProcessing + ? Math.round(16 + t * 36) + : isCompleted + ? Math.round(18 + t * 38) + : Math.round(42 + t * 44); + const cardPct = 100 - tintPct; + const x = (-0.35 * i).toFixed(2); + const y = (1.0 * i).toFixed(2); + shadows.push( + `${x}px ${y}px 0px color-mix(in srgb, ${tintVar} ${tintPct}%, var(--card) ${cardPct}%)` + ); + } + + const spread = elevated ? 1.32 : isCompleted ? 1.18 : 1; + const floorX = (-0.35 * (steps + 11) * spread).toFixed(1); + const floorY = (1.0 * (steps + 11) * spread).toFixed(1); + const floorBlur = elevated ? 24 : 18; + + // Soft neutral contact shadow + shadows.push( + `${floorX}px ${floorY}px ${floorBlur}px color-mix(in srgb, var(--foreground) ${elevated ? 8 : isCompleted ? 5 : 7 + }%, transparent)` + ); + + // Close-range colored cast shadow (blueish when processing, lush green when completed) + const glowX = (-0.35 * (steps + 8) * spread).toFixed(1); + const glowY = (1.0 * (steps + 8) * spread).toFixed(1); + if (isProcessing) { + shadows.push( + `${glowX}px ${glowY}px 24px color-mix(in srgb, var(--primary) 30%, transparent)` + ); + } else if (isCompleted) { + shadows.push( + `${glowX}px ${glowY}px 24px color-mix(in srgb, var(--success) 34%, transparent)` + ); + } else { + shadows.push( + `${glowX}px ${glowY}px 16px color-mix(in srgb, var(--foreground) 4%, transparent)` + ); + } + + // Wide diffused ambient floor glow spilling onto the canvas + const haloX = (-0.35 * (steps + 14) * spread).toFixed(1); + const haloY = (1.0 * (steps + 14) * spread).toFixed(1); + if (isProcessing) { + shadows.push( + `${haloX}px ${haloY}px 32px color-mix(in srgb, var(--primary) 18%, transparent)` + ); + } else if (isCompleted) { + shadows.push( + `${haloX}px ${haloY}px 34px color-mix(in srgb, var(--success) 24%, transparent)` + ); + } else { + shadows.push( + `${haloX}px ${haloY}px 22px color-mix(in srgb, var(--foreground) 2%, transparent)` + ); + } + + return shadows.join(", "); +} + +/** + * Generates stepped 3D edge extrusion for the floating 740x390 frosted canvas platform. + * Uses ONLY theme tokens via color-mix(). + */ +function buildPlatformShadow(): string { + const shadows = [ + "inset 0 1px 0 var(--card)", + "inset 1px 0 0 color-mix(in srgb, var(--card) 90%, transparent)", + ]; + + for (let i = 1; i <= 8; i++) { + const x = (-0.35 * i).toFixed(2); + const y = (1.0 * i).toFixed(2); + const borderPct = Math.round(45 + (i / 8) * 35); + const cardPct = 100 - borderPct; + shadows.push( + `${x}px ${y}px 0px color-mix(in srgb, var(--border) ${borderPct}%, var(--card) ${cardPct}%)` + ); + } + + shadows.push( + "-8px 26px 40px color-mix(in srgb, var(--foreground) 10%, transparent)" + ); + shadows.push( + "-3px 14px 20px color-mix(in srgb, var(--primary) 7%, transparent)" + ); + + return shadows.join(", "); +} + +/** + * Generates a compact 4-step mini 3D extrusion for the raised icon tile inside each node. + * Follows the calm state palette: neutral -> soft blue -> soft green. + */ +function buildMiniCubeShadow(state: NodeState): string { + const shadows = [ + "inset 0 1px 0 color-mix(in srgb, var(--card) 55%, transparent)", + ]; + + const isProcessing = state === "processing"; + const isCompleted = state === "completed"; + + for (let i = 1; i <= 4; i++) { + const x = (-0.35 * i).toFixed(2); + const y = (1.0 * i).toFixed(2); + if (isProcessing) { + shadows.push( + `${x}px ${y}px 0px color-mix(in srgb, var(--primary-hover) ${55 + i * 8}%, var(--card) 12%)` + ); + } else if (isCompleted) { + shadows.push( + `${x}px ${y}px 0px color-mix(in srgb, var(--success) ${24 + i * 9}%, var(--card) ${76 - i * 9}%)` + ); + } else { + shadows.push( + `${x}px ${y}px 0px color-mix(in srgb, var(--border) ${55 + i * 9}%, var(--card) ${45 - i * 9}%)` + ); + } + } + + if (isProcessing) { + shadows.push( + "-2px 7px 14px color-mix(in srgb, var(--primary) 28%, transparent)" + ); + } else if (isCompleted) { + shadows.push( + "-2px 7px 14px color-mix(in srgb, var(--success) 28%, transparent)" + ); + } else { + shadows.push( + "-2px 5px 8px color-mix(in srgb, var(--foreground) 7%, transparent)" + ); + } + + return shadows.join(", "); +} + +/** + * Tracks container width smoothly so the fixed 740x390 3D stage scales cleanly + * without clipping on any viewport width. + */ +function useContainerWidth(ref: React.RefObject, fallback = 640): number { + const [width, setWidth] = useState(fallback); + + useEffect(() => { + const el = ref.current; + if (!el) return; + + const update = () => { + if (el.clientWidth > 0) setWidth(el.clientWidth); + }; + + update(); + + if (typeof ResizeObserver !== "undefined") { + const ro = new ResizeObserver(update); + ro.observe(el); + return () => ro.disconnect(); + } + + window.addEventListener("resize", update); + return () => window.removeEventListener("resize", update); + }, [ref]); + + return width; +} + +/** + * Inline Webhook branching glyph. + */ +function WebhookGlyph({ className = "w-4 h-4" }: { className?: string }) { + return ( + + ); +} + +/** + * Raised Floating 3D Icon Tile inside each workflow node. + * Keeps all icons in one calm color family and shifts subtly by state: + * idle (neutral) -> processing (blue) -> completed (soft green). + */ +function Raised3DNodeIcon({ nodeId, state }: { nodeId: NodeId; state: NodeState }) { + const isProcessing = state === "processing"; + const isCompleted = state === "completed"; + + const tileStyle: React.CSSProperties = isProcessing + ? { + background: + "linear-gradient(145deg, color-mix(in srgb, var(--primary) 86%, var(--card)) 0%, var(--primary) 60%, var(--primary-hover) 100%)", + color: "var(--primary-foreground)", + border: "1px solid color-mix(in srgb, var(--card) 35%, var(--primary))", + boxShadow: buildMiniCubeShadow("processing"), + } + : isCompleted + ? { + background: "color-mix(in srgb, var(--success) 10%, var(--card))", + color: "var(--success)", + border: "1px solid color-mix(in srgb, var(--success) 26%, var(--card))", + boxShadow: buildMiniCubeShadow("completed"), + } + : { + background: "color-mix(in srgb, var(--muted) 75%, var(--card))", + color: nodeId === "filter" ? "var(--primary)" : "var(--muted-foreground)", + border: "1px solid color-mix(in srgb, var(--border) 90%, var(--card))", + boxShadow: buildMiniCubeShadow("idle"), + }; + + const renderGlyph = () => { + if (nodeId === "webhook") return ; + if (nodeId === "filter") return ; + if (nodeId === "sheets") { + return ( + + ); + } + return ; + }; + + return ( +
+ {nodeId === "webhook" && isProcessing && ( +
+ ); +} + +/** + * Refined circular input/output handle pin mounted on node left/right edges. + * Quiet neutral border when idle, soft blue while processing, soft green once completed. + */ +function NodeHandlePin({ + side, + topOffset, + state, +}: { + side: "left" | "right"; + topOffset?: number; + state: NodeState; +}) { + const isProcessing = state === "processing"; + const isCompleted = state === "completed"; + + const posStyle: React.CSSProperties = + topOffset !== undefined + ? { top: `${topOffset}px`, transform: "translateY(-50%) translateZ(2px)" } + : { top: "50%", transform: "translateY(-50%) translateZ(2px)" }; + + const ringColor = isProcessing + ? "color-mix(in srgb, var(--primary) 75%, var(--card))" + : isCompleted + ? "color-mix(in srgb, var(--success) 65%, var(--card))" + : "color-mix(in srgb, var(--border) 95%, var(--muted-foreground) 15%)"; + + const coreColor = isProcessing + ? "var(--primary)" + : isCompleted + ? "var(--success)" + : "color-mix(in srgb, var(--muted-foreground) 45%, var(--card))"; + + return ( +
NameTriggeredStatusDuration
NameCreatedStatusAge
{getStatusIcon(wf.status)} - + {wf.name}
{formatDate(wf.createdAt)}{formatDate(wf.createdAt)} {getStatusDot(wf.status)}{getTimeDuration(wf.createdAt)}{getTimeDuration(wf.createdAt)}