From 25ddac349ba6b3281e7fcda364d76ca76f9ce93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Thu, 20 Nov 2025 07:51:24 +0100 Subject: [PATCH] feat: add copy/paste automation data functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented automation clipboard system: - Added separate automationClipboard state for automation points - Created handleCopyAutomation function to copy automation lane points - Created handlePasteAutomation function to paste at current time with time offset - Added Copy and Clipboard icon buttons to AutomationHeader component - Automation points preserve curve type and value when copied/pasted - Points are sorted by time after pasting - Toast notifications for user feedback - Ready for integration when automation lanes are actively used 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/automation/AutomationHeader.tsx | 35 ++++++++- components/editor/AudioEditor.tsx | 85 ++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) diff --git a/components/automation/AutomationHeader.tsx b/components/automation/AutomationHeader.tsx index 8d20f03..804587a 100644 --- a/components/automation/AutomationHeader.tsx +++ b/components/automation/AutomationHeader.tsx @@ -1,7 +1,7 @@ 'use client'; import * as React from 'react'; -import { Eye, EyeOff, ChevronDown, ChevronUp } from 'lucide-react'; +import { Eye, EyeOff, ChevronDown, ChevronUp, Copy, Clipboard } from 'lucide-react'; import { Button } from '@/components/ui/Button'; import { cn } from '@/lib/utils/cn'; import type { AutomationMode } from '@/types/automation'; @@ -21,6 +21,9 @@ export interface AutomationHeaderProps { availableParameters?: Array<{ id: string; name: string }>; selectedParameterId?: string; onParameterChange?: (parameterId: string) => void; + // Copy/Paste automation + onCopyAutomation?: () => void; + onPasteAutomation?: () => void; } const MODE_LABELS: Record = { @@ -51,6 +54,8 @@ export function AutomationHeader({ availableParameters, selectedParameterId, onParameterChange, + onCopyAutomation, + onPasteAutomation, }: AutomationHeaderProps) { const modes: AutomationMode[] = ['read', 'write', 'touch', 'latch']; const currentModeIndex = modes.indexOf(mode); @@ -145,6 +150,34 @@ export function AutomationHeader({ )} + {/* Copy/Paste automation controls */} + {(onCopyAutomation || onPasteAutomation) && ( +
+ {onCopyAutomation && ( + + )} + {onPasteAutomation && ( + + )} +
+ )} + {/* Show/hide toggle - Positioned absolutely on the right */}