From 0d89597fc0be9b916f8e918052b34b56f69241a0 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sun, 29 Mar 2026 05:58:39 +0000 Subject: [PATCH] chore: delete SaveToLibraryDialog, replaced by ParameterizeAndSavePanel Co-Authored-By: Claude Opus 4.6 (1M context) --- .../script-builder/SaveToLibraryDialog.tsx | 186 ------------------ 1 file changed, 186 deletions(-) delete mode 100644 frontend/src/components/script-builder/SaveToLibraryDialog.tsx diff --git a/frontend/src/components/script-builder/SaveToLibraryDialog.tsx b/frontend/src/components/script-builder/SaveToLibraryDialog.tsx deleted file mode 100644 index b3be2145..00000000 --- a/frontend/src/components/script-builder/SaveToLibraryDialog.tsx +++ /dev/null @@ -1,186 +0,0 @@ -import { useState, useEffect } from 'react' -import { X, Loader2 } from 'lucide-react' -import { cn } from '@/lib/utils' -import { scriptBuilderApi, scriptsApi } from '@/api' -import type { ScriptCategoryResponse } from '@/types' - -interface SaveToLibraryDialogProps { - sessionId: string - defaultName: string - defaultDescription?: string - onClose: () => void - onSaved: () => void -} - -export function SaveToLibraryDialog({ - sessionId, - defaultName, - defaultDescription, - onClose, - onSaved, -}: SaveToLibraryDialogProps) { - const [name, setName] = useState(defaultName) - const [description, setDescription] = useState(defaultDescription || '') - const [categoryId, setCategoryId] = useState('') - const [shareWithTeam, setShareWithTeam] = useState(false) - const [categories, setCategories] = useState([]) - const [isSaving, setIsSaving] = useState(false) - const [error, setError] = useState(null) - - useEffect(() => { - scriptsApi.getCategories().then(setCategories).catch(() => {}) - }, []) - - useEffect(() => { - const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === 'Escape') onClose() - } - document.addEventListener('keydown', handleKeyDown) - return () => document.removeEventListener('keydown', handleKeyDown) - }, [onClose]) - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault() - if (!name.trim()) return - - setIsSaving(true) - setError(null) - - try { - await scriptBuilderApi.saveToLibrary(sessionId, { - name: name.trim(), - description: description.trim() || undefined, - category_id: categoryId || undefined, - share_with_team: shareWithTeam, - }) - onSaved() - } catch (err) { - setError(err instanceof Error ? err.message : 'Failed to save script. Please try again.') - } finally { - setIsSaving(false) - } - } - - return ( -
{ if (e.target === e.currentTarget) onClose() }} - > -
- {/* Header */} -
-

Save to Library

- -
- - {/* Form */} -
- {/* Name */} -
- - setName(e.target.value)} - required - className={cn( - "w-full rounded-lg px-3 py-2 text-sm", - "border border-border bg-card text-foreground placeholder:text-muted-foreground", - "focus:outline-none focus:border-[rgba(249,115,22,0.3)] transition-colors" - )} - placeholder="Script name" - /> -
- - {/* Description */} -
- -