From f0ed6329c6337d60b1e5013c2893e151fa84e969 Mon Sep 17 00:00:00 2001 From: Developers Digest <124798203+developersdigest@users.noreply.github.com> Date: Wed, 10 Sep 2025 10:15:11 -0400 Subject: [PATCH] clean up unused pages --- app/components/ui/switch.tsx | 30 - app/components/ui/toggle.tsx | 52 - app/generation/GenerationClient.tsx | 20 - app/generation/page-content.tsx | 3525 -------------------------- app/page.backup.tsx | 236 -- app/page.new.tsx.bak | 3656 --------------------------- lib/app/utils.ts | 10 - 7 files changed, 7529 deletions(-) delete mode 100644 app/components/ui/switch.tsx delete mode 100644 app/components/ui/toggle.tsx delete mode 100644 app/generation/GenerationClient.tsx delete mode 100644 app/generation/page-content.tsx delete mode 100644 app/page.backup.tsx delete mode 100644 app/page.new.tsx.bak delete mode 100644 lib/app/utils.ts diff --git a/app/components/ui/switch.tsx b/app/components/ui/switch.tsx deleted file mode 100644 index 189da9f..0000000 --- a/app/components/ui/switch.tsx +++ /dev/null @@ -1,30 +0,0 @@ -'use client'; - -import * as React from "react" -import * as SwitchPrimitives from "@radix-ui/react-switch" -import { cn } from "@/lib/utils" - -const Switch = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - -)) -Switch.displayName = SwitchPrimitives.Root.displayName - -export { Switch } \ No newline at end of file diff --git a/app/components/ui/toggle.tsx b/app/components/ui/toggle.tsx deleted file mode 100644 index 081ff9c..0000000 --- a/app/components/ui/toggle.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" -import { cn } from "@/lib/utils" - -const toggleVariants = cva( - "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", - { - variants: { - variant: { - default: "bg-transparent", - outline: - "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground", - }, - size: { - default: "h-10 px-3", - sm: "h-9 px-2.5", - lg: "h-11 px-5", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - } -) - -export interface ToggleProps - extends React.ButtonHTMLAttributes, - VariantProps { - pressed?: boolean - onPressedChange?: (pressed: boolean) => void -} - -const Toggle = React.forwardRef( - ({ className, variant, size, pressed, onPressedChange, ...props }, ref) => { - return ( - - -
- { - const ext = selectedFile.split('.').pop()?.toLowerCase(); - if (ext === 'css') return 'css'; - if (ext === 'json') return 'json'; - if (ext === 'html') return 'html'; - return 'jsx'; - })()} - style={vscDarkPlus} - customStyle={{ - margin: 0, - padding: '1rem', - fontSize: '0.875rem', - background: 'transparent', - }} - showLineNumbers={true} - > - {(() => { - // Find the file content from generated files - const file = generationProgress.files.find(f => f.path === selectedFile); - return file?.content || '// File content will appear here'; - })()} - -
- - - ) : /* If no files parsed yet, show loading or raw stream */ - generationProgress.files.length === 0 && !generationProgress.currentFile ? ( - generationProgress.isThinking ? ( - // Beautiful loading state while thinking -
-
-
-
-
-
-
-
-

AI is analyzing your request

-

{generationProgress.status || 'Preparing to generate code...'}

-
-
- ) : ( -
-
-
-
- Streaming code... -
-
-
- - {generationProgress.streamedCode || 'Starting code generation...'} - - -
-
- ) - ) : ( -
- {/* Show current file being generated */} - {generationProgress.currentFile && ( -
-
-
-
- {generationProgress.currentFile.path} - - {generationProgress.currentFile.type === 'javascript' ? 'JSX' : generationProgress.currentFile.type.toUpperCase()} - -
-
-
- - {generationProgress.currentFile.content} - - -
-
- )} - - {/* Show completed files */} - {generationProgress.files.map((file, idx) => ( -
-
-
- - {file.path} -
- - {file.type === 'javascript' ? 'JSX' : file.type.toUpperCase()} - -
-
- - {file.content} - -
-
- ))} - - {/* Show remaining raw stream if there's content after the last file */} - {!generationProgress.currentFile && generationProgress.streamedCode.length > 0 && ( -
-
-
-
- Processing... -
-
-
- - {(() => { - // Show only the tail of the stream after the last file - const lastFileEnd = generationProgress.files.length > 0 - ? generationProgress.streamedCode.lastIndexOf('') + 7 - : 0; - let remainingContent = generationProgress.streamedCode.slice(lastFileEnd).trim(); - - // Remove explanation tags and content - remainingContent = remainingContent.replace(/[\s\S]*?<\/explanation>/g, '').trim(); - - // If only whitespace or nothing left, show waiting message - return remainingContent || 'Waiting for next file...'; - })()} - -
-
- )} -
- )} -
-
- - {/* Progress indicator */} - {generationProgress.components.length > 0 && ( -
-
-
-
-
- )} -
-
- ); - } else if (activeTab === 'preview') { - // Show loading state for initial generation or when starting a new generation with existing sandbox - const isInitialGeneration = !sandboxData?.url && (urlScreenshot || isCapturingScreenshot || isPreparingDesign || loadingStage); - const isNewGenerationWithSandbox = isStartingNewGeneration && sandboxData?.url; - const shouldShowLoadingOverlay = (isInitialGeneration || isNewGenerationWithSandbox) && - (loading || generationProgress.isGenerating || isPreparingDesign || loadingStage || isCapturingScreenshot || isStartingNewGeneration); - - if (isInitialGeneration || isNewGenerationWithSandbox) { - return ( -
- {/* Screenshot as background when available */} - {urlScreenshot && ( - /* eslint-disable-next-line @next/next/no-img-element */ - Website preview setIsScreenshotLoaded(true)} - loading="eager" - /> - )} - - {/* Loading overlay - only show when actively processing initial generation */} - {shouldShowLoadingOverlay && ( -
- {/* Large animated browser URL bar */} -
-
-
- {/* Browser dots - bigger */} -
-
-
-
-
- {/* URL bar - bigger */} -
-

- {targetUrl || homeUrlInput.replace(/^https?:\/\//i, '') || 'example.com'} -

-
-
-
-
- - {/* Loading animation with skeleton */} -
- {/* Animated skeleton lines */} -
-
-
-
-
- - {/* Spinner */} -
- - {/* Status text */} -

- {isCapturingScreenshot ? 'Analyzing website...' : - isPreparingDesign ? 'Preparing design...' : - generationProgress.isGenerating ? 'Generating code...' : - 'Loading...'} -

- - {/* Subtle progress hint */} -

- {isCapturingScreenshot ? 'Taking a screenshot of the site' : - isPreparingDesign ? 'Understanding the layout and structure' : - generationProgress.isGenerating ? 'Writing React components' : - 'Please wait...'} -

-
-
- )} -
- ); - } - - // Show sandbox iframe - keep showing during edits, only hide during initial loading - if (sandboxData?.url) { - return ( -
-