import { useRef } from 'react'; import { Rocket, CheckCircle2, Zap, FileText, Sparkles, ArrowRight } from 'lucide-react'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; interface OnboardingDialogProps { open: boolean; onOpenChange: (open: boolean) => void; newProjectName: string; onSkip: () => void; onGenerateSpec: () => void; } export function OnboardingDialog({ open, onOpenChange, newProjectName, onSkip, onGenerateSpec, }: OnboardingDialogProps) { // Track if we're closing because user clicked "Generate App Spec" // to avoid incorrectly calling onSkip const isGeneratingRef = useRef(false); const handleGenerateSpec = () => { isGeneratingRef.current = true; onGenerateSpec(); }; return ( { if (!isOpen && !isGeneratingRef.current) { // Only call onSkip when user dismisses dialog (escape, click outside, or skip button) // NOT when they click "Generate App Spec" onSkip(); } isGeneratingRef.current = false; onOpenChange(isOpen); }} >
Welcome to {newProjectName}! Your new project is ready. Let's get you started.
{/* Main explanation */}

Would you like to auto-generate your app_spec.txt? This file helps describe your project and is used to pre-populate your backlog with features to work on.

{/* Benefits list */}

Pre-populate your backlog

Automatically generate features based on your project specification

Better AI assistance

Help AI agents understand your project structure and tech stack

Project documentation

Keep a clear record of your project's capabilities and features

{/* Info box */}

Tip: You can always generate or edit your app_spec.txt later from the Spec Editor in the sidebar.

); }