diff --git a/components/wizard/settings-editor.tsx b/components/wizard/settings-editor.tsx index daba7df..8921251 100644 --- a/components/wizard/settings-editor.tsx +++ b/components/wizard/settings-editor.tsx @@ -1,6 +1,6 @@ "use client" -import { useState } from "react" +import { useState, useEffect, useRef } from "react" import { Plus, X, ChevronDown, ChevronUp, ToggleLeft, ToggleRight } from "lucide-react" import { motion, AnimatePresence } from "motion/react" @@ -186,10 +186,18 @@ export function SettingsEditor({ } const isEmpty = value.length === 0 + const [showCustomInput, setShowCustomInput] = useState(false) + const customInputRef = useRef(null) + + useEffect(() => { + if (showCustomInput && customInputRef.current) { + customInputRef.current.focus() + } + }, [showCustomInput]) return (
- {isEmpty && ( + {isEmpty && !showCustomInput && (

No settings configured

@@ -200,10 +208,7 @@ export function SettingsEditor({ Load defaults
)} + {isEmpty && showCustomInput && ( +
+ +
+ setNewCategoryName(e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + e.preventDefault() + if (newCategoryName.trim()) { + addCategory() + setShowCustomInput(false) + } + } + }} + placeholder="e.g. Graphics, Audio, Display..." + className="flex-1 px-4 py-2.5 rounded-lg border border-border bg-text/5 text-text text-sm placeholder:text-text/40 outline-none focus:border-primary focus:ring-2 focus:ring-primary/50 transition-colors" + /> + + +
+
+ )} + {value.map((cat, index) => { const isCollapsed = collapsedCategories.has(cat.category)