Merge branch 'minorDesignUpdates' into 'main'

Minor Design Updates (Optional)

See merge request soapbox-pub/shakespeare!37
This commit is contained in:
Alex Gleason committed 2025-09-28 04:41:03 +00:00
commit ba509584b7
11 files changed
+68 -45

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ const queryClient = new QueryClient({
});
const defaultConfig: AppConfig = {
theme: "light",
theme: "system",
relayUrl: "wss://relay.primal.net",
deployServer: "shakespeare.wtf",
};
-4
View File
@@ -18,7 +18,6 @@ interface AppLayoutProps {
export function AppLayout({
children,
selectedProject = null,
title = "Shakespeare",
showSidebar = true,
headerContent
}: AppLayoutProps) {
@@ -85,9 +84,6 @@ export function AppLayout({
<Menu className="h-4 w-4" />
</Button>
)}
<h1 className="text-lg font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
{title}
</h1>
</div>
{headerContent}
</header>
+1 -1
View File
@@ -399,7 +399,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-lg w-full max-h-[75vh] overflow-hidden flex flex-col sm:max-w-lg sm:max-h-[75vh] max-sm:w-full max-sm:h-full max-sm:max-w-none max-sm:max-h-none max-sm:m-0 max-sm:rounded-none">
<DialogContent onOpenAutoFocus={(e) => e.preventDefault()} className="max-w-lg w-full max-h-[75vh] overflow-hidden flex flex-col sm:max-w-lg sm:max-h-[75vh] max-sm:w-full max-sm:h-full max-sm:max-w-none max-sm:max-h-none max-sm:m-0 max-sm:rounded-none">
<DialogHeader className="flex-shrink-0">
<DialogTitle className="flex items-center gap-2 text-lg">
{lightningInvoice ? (
+1 -1
View File
@@ -42,7 +42,7 @@ describe('OnboardingDialog', () => {
</TestApp>
);
expect(screen.getAllByText('Welcome to Shakespeare!')).toHaveLength(2); // Title and heading
expect(screen.getByText('Welcome to Shakespeare!')).toBeInTheDocument(); // Only in dialog title now
expect(screen.getByText(/Your AI-powered development assistant/)).toBeInTheDocument();
expect(screen.getByRole('button', { name: /Get Started/i })).toBeInTheDocument();
});
+38 -31
View File
@@ -8,7 +8,6 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Skeleton } from '@/components/ui/skeleton';
import { ScrollArea } from '@/components/ui/scroll-area';
import { useAISettings } from '@/hooks/useAISettings';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useLoginActions } from '@/hooks/useLoginActions';
@@ -119,8 +118,8 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
return (
<>
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-2xl max-h-[80vh] overflow-hidden">
<DialogHeader>
<DialogContent className="max-w-2xl max-h-[90vh] sm:max-h-[80vh] flex flex-col">
<DialogHeader className="flex-shrink-0">
<DialogTitle className="flex items-center gap-2">
{step === 'model-selection' && (
<Button
@@ -132,18 +131,32 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
<ArrowLeft className="h-4 w-4" />
</Button>
)}
{step === 'conclusion' && (
<Button
variant="ghost"
size="sm"
onClick={() => setStep('model-selection')}
className="mr-2 p-1 h-auto"
>
<ArrowLeft className="h-4 w-4" />
</Button>
)}
<span className="text-xl">
{step === 'welcome' && 'Welcome to Shakespeare!'}
{step === 'model-selection' && 'Choose Your AI Model'}
{step === 'conclusion' && "You're All Set!"}
</span>
</DialogTitle>
</DialogHeader>
<div className="flex-1 overflow-hidden">
<div className="flex-1 overflow-y-auto min-h-0">
{step === 'welcome' && (
<div className="text-center space-y-6 py-4">
<div className="text-6xl mb-4">🎭</div>
<div className="mb-4">
<img
src="/favicon.png"
alt="Shakespeare"
className="w-16 h-16 mx-auto"
/>
</div>
<div className="space-y-3">
<h2 className="text-2xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
Welcome to Shakespeare!
@@ -191,15 +204,8 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
)}
{step === 'model-selection' && (
<div className="space-y-4">
<div className="text-center space-y-2">
<p className="text-muted-foreground">
Choose an AI model to power your development experience.
Different models offer various capabilities and pricing.
</p>
</div>
<ScrollArea className="h-96">
<div className="flex flex-col h-full">
<div className="flex-1 overflow-y-auto min-h-0 my-4">
<div className="space-y-3 p-1">
{isLoadingModels ? (
<>
@@ -232,6 +238,7 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
shakespeareModels.map((model) => {
const isSelected = selectedModel === model.fullId;
const isFree = model.pricing?.prompt.equals(0) && model.pricing?.completion.equals(0);
const isPremium = !isFree;
return (
<Card
@@ -244,12 +251,12 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
<CardHeader className="pb-3">
<div className="flex items-center justify-between">
<div className="flex-1">
<CardTitle className="text-base font-semibold">
{model.description || model.name || model.id}
<CardTitle className={`text-xl font-semibold ${isPremium ? 'bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent' : ''}`}>
{ model.name || model.description || model.id}
</CardTitle>
{model.description && (
<p className="text-sm text-muted-foreground mt-1">
{model.name || model.id}
{model.description || model.id}
</p>
)}
</div>
@@ -259,6 +266,11 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
Free
</Badge>
)}
{isPremium && (
<Badge className="text-xs bg-primary text-white border-0">
Premium
</Badge>
)}
{isSelected && (
<div className="h-5 w-5 rounded-full bg-primary flex items-center justify-center">
<Check className="h-3 w-3 text-primary-foreground" />
@@ -268,12 +280,12 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
</div>
</CardHeader>
<CardContent className="pt-0">
<div className="flex items-center gap-4 text-xs text-muted-foreground">
<div className="flex items-end justify-end gap-4 text-xs text-muted-foreground">
{model.pricing && (
<>
<span>Input: {formatPrice(model.pricing.prompt)}</span>
<span>Output: {formatPrice(model.pricing.completion)}</span>
</>
<div className="text-right">
<div>Input: {formatPrice(model.pricing.prompt)}</div>
<div>Output: {formatPrice(model.pricing.completion)}</div>
</div>
)}
{model.contextLength && (
<span>Context: {model.contextLength.toLocaleString()} tokens</span>
@@ -285,9 +297,9 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
})
)}
</div>
</ScrollArea>
</div>
<div className="flex justify-end gap-2 pt-4 border-t">
<div className="flex justify-end gap-2 pt-4 border-t flex-shrink-0">
<Button
onClick={handleContinue}
disabled={!selectedModel}
@@ -310,11 +322,6 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
Just enter your prompt to start building 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 farming equipment marketplace for local farmers to buy and sell tractors, tools, and supplies..."
</p>
</div>
<Button onClick={handleFinish} size="lg" className="gap-2">
<Sparkles className="h-4 w-4" />
Start Building
+1 -1
View File
@@ -60,7 +60,7 @@ describe('ProjectSidebar', () => {
</TestApp>
);
expect(screen.getByText('🎭')).toBeInTheDocument();
expect(screen.getByAltText('Shakespeare')).toBeInTheDocument();
expect(screen.getByText('Shakespeare')).toBeInTheDocument();
});
+5 -1
View File
@@ -137,7 +137,11 @@ export function ProjectSidebar({
onClick={() => navigateAndClose('/')}
className="flex items-center gap-3 hover:opacity-80 transition-opacity text-left"
>
<span className="text-2xl">🎭</span>
<img
src="/favicon.png"
alt="Shakespeare"
className="w-6 h-6"
/>
<h1 className="text-xl font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
Shakespeare
</h1>
+7 -1
View File
@@ -525,7 +525,13 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
{messages.length === 0 && !streamingMessage && !isLoading && (
<div className="flex-1 flex items-center justify-center min-h-[400px]">
<div className="text-center space-y-4 max-w-md mx-auto">
<div className="text-6xl mb-6">🎭</div>
<div className="mb-6">
<img
src="/favicon.png"
alt="Shakespeare"
className="w-16 h-16 mx-auto"
/>
</div>
<div>
<h3 className="text-xl font-semibold mb-2 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
{t('welcomeToShakespeare')}
+3 -3
View File
@@ -732,9 +732,9 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
<TabsContent value="code" className="h-full mt-0">
{isMobile ? (
<div className="h-full flex flex-col">
<div className="h-full flex flex-col min-h-0">
{mobileCodeView === 'explorer' ? (
<div className="flex-1 relative">
<div className="flex-1 relative min-h-0">
<ScrollArea className="h-full">
<ScrollBar orientation="horizontal" />
<div className="min-w-max">
@@ -750,7 +750,7 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
variant="outline"
size="sm"
onClick={() => setMobileCodeView('terminal')}
className="fixed bottom-12 right-4 h-12 w-12 p-0 rounded-full shadow-lg bg-background border-2"
className="fixed right-4 bottom-safe-nav z-20 h-12 w-12 p-0 rounded-full shadow-lg bg-background border-2"
>
<Terminal className="h-6 w-6" />
</Button>
+4
View File
@@ -260,6 +260,10 @@
padding-top: env(safe-area-inset-top);
}
.bottom-safe-nav {
bottom: calc(env(safe-area-inset-bottom) + 3.75rem);
}
/* Mobile navigation button styles - text/icon highlighting only */
.mobile-nav-button,
.mobile-nav-button:hover,
+7 -1
View File
@@ -267,7 +267,13 @@ export default function Index() {
<AppLayout headerContent={headerContent}>
<div className="max-w-4xl mx-auto">
<div className="text-center mb-8 md:mb-12">
<div className="text-4xl md:text-6xl mb-4 md:mb-6">🎭</div>
<div className="mb-4 md:mb-6">
<img
src="/favicon.png"
alt="Shakespeare"
className="w-20 h-20 md:w-24 md:h-24 mx-auto"
/>
</div>
<h1 className="text-3xl md:text-4xl font-bold mb-3 md:mb-4 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
{t('buildNostrApps')}
</h1>