diff --git a/src/components/monitor/SessionNode.tsx b/src/components/monitor/SessionNode.tsx index 6aead34..804cb10 100644 --- a/src/components/monitor/SessionNode.tsx +++ b/src/components/monitor/SessionNode.tsx @@ -1,7 +1,7 @@ -import { memo, useMemo } from 'react' +import { memo, useCallback, useMemo, useState } from 'react' import { Handle, Position } from '@xyflow/react' -import { motion } from 'framer-motion' -import { Users, User, Clock } from 'lucide-react' +import { motion, AnimatePresence } from 'framer-motion' +import { Users, User, Clock, Copy, Check } from 'lucide-react' import { StatusIndicator } from './StatusIndicator' import type { MonitorSession } from '~/integrations/clawdbot' @@ -36,6 +36,8 @@ export const SessionNode = memo(function SessionNode({ data, selected, }: SessionNodeProps) { + const [copied, setCopied] = useState(false) + // Detect if this is a subagent session by checking if platform is "subagent" or if key contains "subagent" const isSubagent = data.platform === 'subagent' || data.key.includes('subagent') || Boolean(data.spawnedBy) const platformIcon = isSubagent ? platformIcons.subagent : (platformIcons[data.platform] ?? '📱') @@ -46,6 +48,13 @@ export const SessionNode = memo(function SessionNode({ return formatRelativeTime(data.lastActivityAt) }, [data.lastActivityAt]) + const handleCopyKey = useCallback((e: React.MouseEvent) => { + e.stopPropagation() + navigator.clipboard.writeText(data.key) + setCopied(true) + setTimeout(() => setCopied(false), 1500) + }, [data.key]) + return ( {displayPlatform} - +
+ + +