Fix scrolling in Act1Dialog

This commit is contained in:
Alex Gleason committed 2025-09-25 17:45:33 -05:00
1 parent 94bcc7eccb
commit 9f20fd6196
1 file changed
+197 -194
+197 -194
View File
@@ -4,6 +4,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/u
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge'; import { Badge } from '@/components/ui/badge';
import { useAISettings } from '@/hooks/useAISettings'; import { useAISettings } from '@/hooks/useAISettings';
import { useLocalStorage } from '@/hooks/useLocalStorage'; import { useLocalStorage } from '@/hooks/useLocalStorage';
@@ -80,7 +81,7 @@ export function Act1Dialog({ open, onOpenChange }: Act1DialogProps) {
return ( return (
<Dialog open={open} onOpenChange={onOpenChange}> <Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-2xl max-h-[80vh] overflow-hidden"> <DialogContent className="max-w-2xl max-h-[90vh] overflow-hidden">
<DialogHeader> <DialogHeader>
<DialogTitle className="flex items-center gap-2"> <DialogTitle className="flex items-center gap-2">
{step === 'migration' && ( {step === 'migration' && (
@@ -111,219 +112,221 @@ export function Act1Dialog({ open, onOpenChange }: Act1DialogProps) {
</DialogTitle> </DialogTitle>
</DialogHeader> </DialogHeader>
<div className="flex-1 overflow-hidden"> <div className="overflow-y-auto max-h-[calc(90vh-120px)] pr-2">
{step === 'welcome' && ( <div className="space-y-6 py-4">
<div className="text-center space-y-6 py-4"> {step === 'welcome' && (
<div className="text-6xl mb-4">🎭✨</div> <div className="text-center space-y-6">
<div className="space-y-3"> <div className="text-6xl mb-4">🎭✨</div>
<h2 className="text-2xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent"> <div className="space-y-3">
Welcome to Act 2! <h2 className="text-2xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
</h2> Welcome to Act 2!
<p className="text-lg text-muted-foreground max-w-lg mx-auto"> </h2>
We're excited to see you again! Shakespeare has been completely rebuilt <p className="text-lg text-muted-foreground max-w-lg mx-auto">
with new features, improved performance, and a better development experience. We're excited to see you again! Shakespeare has been completely rebuilt
</p> with new features, improved performance, and a better development experience.
</div> </p>
</div>
<Card className="max-w-lg mx-auto text-left"> <Card className="max-w-lg mx-auto text-left">
<CardHeader> <CardHeader>
<CardTitle className="text-lg flex items-center gap-2"> <CardTitle className="text-lg flex items-center gap-2">
<span className="text-2xl">🔄</span> <span className="text-2xl">🔄</span>
What's Changed What's Changed
</CardTitle> </CardTitle>
</CardHeader> </CardHeader>
<CardContent className="space-y-3"> <CardContent className="space-y-3">
<div className="flex items-start gap-3"> <div className="flex items-start gap-3">
<Badge variant="secondary" className="mt-0.5">New</Badge> <Badge variant="secondary" className="mt-0.5">New</Badge>
<div> <div>
<p className="font-medium">Enhanced AI Capabilities</p> <p className="font-medium">Enhanced AI Capabilities</p>
<p className="text-sm text-muted-foreground">More powerful models and better code generation</p> <p className="text-sm text-muted-foreground">More powerful models and better code generation</p>
</div>
</div> </div>
</div> <div className="flex items-start gap-3">
<div className="flex items-start gap-3"> <Badge variant="secondary" className="mt-0.5">New</Badge>
<Badge variant="secondary" className="mt-0.5">New</Badge> <div>
<div> <p className="font-medium">Improved Git Integration</p>
<p className="font-medium">Improved Git Integration</p> <p className="text-sm text-muted-foreground">Better version control with credential management</p>
<p className="text-sm text-muted-foreground">Better version control with credential management</p> </div>
</div> </div>
</div> <div className="flex items-start gap-3">
<div className="flex items-start gap-3"> <Badge variant="secondary" className="mt-0.5">New</Badge>
<Badge variant="secondary" className="mt-0.5">New</Badge> <div>
<div> <p className="font-medium">Project Import/Export</p>
<p className="font-medium">Project Import/Export</p> <p className="text-sm text-muted-foreground">Easily migrate your projects between versions</p>
<p className="text-sm text-muted-foreground">Easily migrate your projects between versions</p> </div>
</div> </div>
</div> </CardContent>
</CardContent> </Card>
</Card>
<div className="bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 max-w-lg mx-auto"> <div className="bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 max-w-lg mx-auto">
<div className="flex items-start gap-3"> <div className="flex items-start gap-3">
<span className="text-amber-600 dark:text-amber-400 text-lg">⚠️</span> <span className="text-amber-600 dark:text-amber-400 text-lg">⚠️</span>
<div className="text-left"> <div className="text-left">
<p className="font-medium text-amber-800 dark:text-amber-200">Act 2 is in Development</p> <p className="font-medium text-amber-800 dark:text-amber-200">Act 2 is in Development</p>
<p className="text-sm text-amber-700 dark:text-amber-300"> <p className="text-sm text-amber-700 dark:text-amber-300">
While we're working hard to make Act 2 stable, you may encounter bugs. While we're working hard to make Act 2 stable, you may encounter bugs.
Your Act 1 projects remain safe and accessible. Your Act 1 projects remain safe and accessible.
</p> </p>
</div>
</div> </div>
</div> </div>
</div>
<Button
onClick={handleGetStarted}
disabled={isSettingUp}
size="lg"
className="gap-2"
>
{isSettingUp ? (
<>
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-white" />
Setting up...
</>
) : (
<>
<Sparkles className="h-4 w-4" />
Configure Act 2
</>
)}
</Button>
</div>
)}
{step === 'migration' && (
<div className="space-y-6 py-4">
<div className="text-center space-y-3">
<h2 className="text-xl font-bold">Your Act 1 Projects & Credits</h2>
<p className="text-muted-foreground max-w-lg mx-auto">
All your Act 1 projects and credits are safe and still accessible.
Here's how to work with them in Act 2.
</p>
</div>
<div className="grid gap-4">
<Card>
<CardHeader>
<CardTitle className="text-lg flex items-center gap-2">
<ExternalLink className="h-5 w-5 text-blue-500" />
Access Act 1
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
Your original Shakespeare (Act 1) is still available with all your projects and data intact.
</p>
<Button
variant="outline"
onClick={handleVisitAct1}
className="gap-2"
>
<ExternalLink className="h-4 w-4" />
Visit Act 1
</Button>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle className="text-lg flex items-center gap-2">
<Download className="h-5 w-5 text-green-500" />
Export from Act 1
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
In Act 1, you can export your projects as ZIP files using the project menu or settings.
</p>
<div className="text-xs text-muted-foreground bg-muted rounded p-2">
💡 Tip: Export projects you want to continue working on in Act 2
</div>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle className="text-lg flex items-center gap-2">
<Upload className="h-5 w-5 text-purple-500" />
Import to Act 2
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
In Act 2, use the "Import Project" option in the sidebar to upload your exported ZIP files.
</p>
<div className="text-xs text-muted-foreground bg-muted rounded p-2">
💡 Tip: Look for the import button in the project sidebar
</div>
</CardContent>
</Card>
<Card className="border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-950/20">
<CardHeader>
<CardTitle className="text-lg flex items-center gap-2">
<span className="text-2xl">💳</span>
Your Credits
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
Your Act 1 credits are still available through the Shakespeare AI provider.
We've automatically configured this for you!
</p>
<Badge variant="secondary" className="bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200">
Credits Available
</Badge>
</CardContent>
</Card>
</div>
<div className="flex justify-end pt-4 border-t">
<Button <Button
onClick={handleContinue} onClick={handleGetStarted}
disabled={isSettingUp}
size="lg"
className="gap-2" className="gap-2"
> >
Continue {isSettingUp ? (
<ArrowRight className="h-4 w-4" /> <>
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-white" />
Setting up...
</>
) : (
<>
<Sparkles className="h-4 w-4" />
Configure Act 2
</>
)}
</Button> </Button>
</div> </div>
</div> )}
)}
{step === 'conclusion' && ( {step === 'migration' && (
<div className="text-center space-y-6 py-8"> <div className="space-y-6">
<div className="text-5xl mb-4">🎉</div> <div className="text-center space-y-3">
<div className="space-y-3"> <h2 className="text-xl font-bold">Your Act 1 Projects & Credits</h2>
<h2 className="text-2xl font-bold">Welcome to the Future!</h2> <p className="text-muted-foreground max-w-lg mx-auto">
<p className="text-lg text-muted-foreground max-w-md mx-auto"> All your Act 1 projects and credits are safe and still accessible.
You're all set up with Act 2! Your AI assistant is configured Here's how to work with them in Act 2.
and ready to help you build amazing Nostr applications. </p>
</p> </div>
</div>
<div className="bg-muted/50 rounded-lg p-4 max-w-md mx-auto"> <div className="grid gap-4">
<p className="text-sm text-muted-foreground italic"> <Card>
"Create a decentralized social media app with custom feeds and real-time messaging..." <CardHeader>
</p> <CardTitle className="text-lg flex items-center gap-2">
</div> <ExternalLink className="h-5 w-5 text-blue-500" />
Access Act 1
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
Your original Shakespeare (Act 1) is still available with all your projects and data intact.
</p>
<Button
variant="outline"
onClick={handleVisitAct1}
className="gap-2"
>
<ExternalLink className="h-4 w-4" />
Visit Act 1
</Button>
</CardContent>
</Card>
<div className="space-y-3"> <Card>
<Button onClick={handleFinish} size="lg" className="gap-2"> <CardHeader>
<Sparkles className="h-4 w-4" /> <CardTitle className="text-lg flex items-center gap-2">
Start Building in Act 2 <Download className="h-5 w-5 text-green-500" />
</Button> Export from Act 1
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
In Act 1, you can export your projects as ZIP files using the project menu or settings.
</p>
<div className="text-xs text-muted-foreground bg-muted rounded p-2">
💡 Tip: Export projects you want to continue working on in Act 2
</div>
</CardContent>
</Card>
<div className="text-xs text-muted-foreground"> <Card>
Remember: You can always access Act 1 at{' '} <CardHeader>
<button <CardTitle className="text-lg flex items-center gap-2">
onClick={handleVisitAct1} <Upload className="h-5 w-5 text-purple-500" />
className="text-primary hover:underline" Import to Act 2
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
In Act 2, use the "Import Project" option in the sidebar to upload your exported ZIP files.
</p>
<div className="text-xs text-muted-foreground bg-muted rounded p-2">
💡 Tip: Look for the import button in the project sidebar
</div>
</CardContent>
</Card>
<Card className="border-blue-200 dark:border-blue-800 bg-blue-50 dark:bg-blue-950/20">
<CardHeader>
<CardTitle className="text-lg flex items-center gap-2">
<span className="text-2xl">💳</span>
Your Credits
</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<p className="text-sm text-muted-foreground">
Your Act 1 credits are still available through the Shakespeare AI provider.
We've automatically configured this for you!
</p>
<Badge variant="secondary" className="bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200">
Credits Available
</Badge>
</CardContent>
</Card>
</div>
<div className="flex justify-end pt-4 border-t">
<Button
onClick={handleContinue}
className="gap-2"
> >
act1.shakespeare.diy Continue
</button> <ArrowRight className="h-4 w-4" />
</Button>
</div> </div>
</div> </div>
</div> )}
)}
{step === 'conclusion' && (
<div className="text-center space-y-6">
<div className="text-5xl mb-4">🎉</div>
<div className="space-y-3">
<h2 className="text-2xl font-bold">Welcome to the Future!</h2>
<p className="text-lg text-muted-foreground max-w-md mx-auto">
You're all set up with Act 2! Your AI assistant is configured
and ready to help you build amazing Nostr applications.
</p>
</div>
<div className="bg-muted/50 rounded-lg p-4 max-w-md mx-auto">
<p className="text-sm text-muted-foreground italic">
"Create a decentralized social media app with custom feeds and real-time messaging..."
</p>
</div>
<div className="space-y-3">
<Button onClick={handleFinish} size="lg" className="gap-2">
<Sparkles className="h-4 w-4" />
Start Building in Act 2
</Button>
<div className="text-xs text-muted-foreground">
Remember: You can always access Act 1 at{' '}
<button
onClick={handleVisitAct1}
className="text-primary hover:underline"
>
act1.shakespeare.diy
</button>
</div>
</div>
</div>
)}
</div>
</div> </div>
</DialogContent> </DialogContent>
</Dialog> </Dialog>