From 9ef561d6bde951a62f54bd2da6b81c6677645a83 Mon Sep 17 00:00:00 2001 From: Naheel Muhammed Date: Sat, 21 Feb 2026 20:49:36 +0530 Subject: [PATCH 01/10] add error page Co-Authored-By: jaseel0 <225665919+jaseel0@users.noreply.github.com> --- src/app/error.tsx | 146 ++++++++++++++++ src/app/generate/GeneratePageClient.tsx | 2 +- src/components/Generator/LoadingOverlay.tsx | 182 +++++++++++--------- 3 files changed, 244 insertions(+), 86 deletions(-) create mode 100644 src/app/error.tsx diff --git a/src/app/error.tsx b/src/app/error.tsx new file mode 100644 index 0000000..3444000 --- /dev/null +++ b/src/app/error.tsx @@ -0,0 +1,146 @@ +'use client'; + +import React, { useEffect } from 'react'; +import { AlertCircle, RefreshCw, Home, Terminal, ShieldAlert } from 'lucide-react'; +import Link from 'next/link'; + +interface ErrorProps { + error?: Error & { digest?: string }; + reset?: () => void; +} + +// In this environment, the main component must be named App and be the default export +export default function App({ error, reset }: ErrorProps) { + useEffect(() => { + if (error) { + console.error('Captured Error:', error); + } + }, [error]); + + // Fallback values in case props are undefined during a manual preview or direct render + const errorMessage = error?.message || "An unexpected system interruption occurred."; + const errorDigest = error?.digest || "N/A"; + const handleReset = reset || (() => window.location.reload()); + + return ( +
+ + {/* Background Glows - Red/Amber for Error Context */} +
+
+ +
+ + {/* Error Badge - Replicating the style from mainpage.png */} +
+ + Runtime Exception Detected +
+ + {/* Hero Title with Gradient Text */} +

+ Something went
+ + wrong. + +

+ +

+ An unexpected error occurred during the generation process. + The codebase remains secure, but the current operation was halted. +

+ + {/* Action Buttons */} +
+ + + + Return Home + +
+ + {/* Debugging Terminal - Visual match for terminal in mainpage.png */} +
+
+
+
+
+
+
+
+ + STACK_TRACE_SNAPSHOT +
+
+
+
+ [CRITICAL] + {errorMessage} +
+
+
+ digest: + {errorDigest} +
+
+ timestamp: + {new Date().toISOString().split('T')[1].split('.')[0]} UTC +
+
+ module: + core/generator-v2.bin +
+
+
+ + Self-healing protocol initiated... +
+
+ + Workspace state preserved. Ready for manual reset. +
+
+
+ + {/* Replicating feature-page.png style for secondary info */} +
+
+
+ +
+
+

IP Protected

+

Your code was not compromised during this crash.

+
+
+
+
+ +
+
+

State Recovery

+

Cache has been purged to prevent recursive errors.

+
+
+
+
+ + {/* Brand Footer */} +
+
+ R +
+ ReadmeGenAI +
+
+ ); +} \ No newline at end of file diff --git a/src/app/generate/GeneratePageClient.tsx b/src/app/generate/GeneratePageClient.tsx index a857644..8980251 100644 --- a/src/app/generate/GeneratePageClient.tsx +++ b/src/app/generate/GeneratePageClient.tsx @@ -4,7 +4,7 @@ import { Navbar } from "@/components/layout/Navbar"; import { Footer } from "@/components/layout/Footer"; import { SearchInput } from "@/components/Generator/SearchInput"; import { MarkdownPreview } from "@/components/Generator/MarkdownPreview"; -import { LoadingOverlay } from "@/components/Generator/LoadingOverlay"; +import LoadingOverlay from "@/components/Generator/LoadingOverlay"; import { navLinks } from "@/constants/navLinks"; import { TerminalMockup } from "@/components/sections/TerminalMockup"; diff --git a/src/components/Generator/LoadingOverlay.tsx b/src/components/Generator/LoadingOverlay.tsx index 4335425..68644c2 100644 --- a/src/components/Generator/LoadingOverlay.tsx +++ b/src/components/Generator/LoadingOverlay.tsx @@ -1,106 +1,118 @@ -"use client"; +'use client'; -import React, { useState, useEffect } from "react"; +import { useState, useEffect } from 'react'; +import { Terminal, Code2, Cpu } from 'lucide-react'; +export default function LoadingOverlay() { + const [loadingStep, setLoadingStep] = useState(0); -export const LoadingOverlay = () => { - const [terminalText, setTerminalText] = useState(""); - const fullText = "INITIALIZING_NEURAL_ENGINE... [OK]"; + const steps = [ + "Initializing neural engine...", + "Scanning repository structure...", + "Analyzing codebase patterns...", + "Generating professional documentation...", + "Finalizing markdown output..." + ]; useEffect(() => { - let i = 0; const interval = setInterval(() => { - setTerminalText(fullText.slice(0, i)); - i++; - if (i > fullText.length) i = 0; - }, 100); + setLoadingStep((prev) => (prev < steps.length - 1 ? prev + 1 : prev)); + }, 800); + return () => clearInterval(interval); - }, []); + }, [steps.length]); return ( -
- {/* BACKGROUND GRID EFFECT */} -
- - {/* RING CONTAINER */} -
- {/* Chromatic Orbiting Rings */} -
-
-
- - {/* Technical Inner Ring */} -
+
+ {/* Background Glows */} +
+
- {/* Core White Ring */} -
+
+ {/* Hero Loading Text */} +

+ Crafting your
+ + documentation. + +

- {/* Binary Data Bits (Decorative) */} -
-
01011001
+
+ + + {steps[loadingStep]} +
-
- {/* CODING VIBE TEXT ELEMENTS */} -
-
-

- System Status -

-
- -

- {terminalText} - _ -

+ {/* Simulation Terminal */} +
+
+
+
+
+
+
+
+ + AI_RUNTIME_STATUS +
+
+
+
+ [INFO] + Loading generative weights... OK +
+
+ [INFO] + Context window initialized (128k tokens) +
+ {loadingStep >= 1 && ( +
+ [SUCCESS] + Repository tree parsed: 42 files found +
+ )} + {loadingStep >= 2 && ( +
+ [SUCCESS] + Exporting vector embeddings... +
+ )} + {loadingStep >= 3 && ( +
+ [PROCESS] + Generating README.md via LLM-v4... +
+ )} +
+ + +
- {/* DATA METRICS FOOTER */} -
-
- CPU - 88.4% -
-
- MEM - 12GB + {/* Feature Hints */} +
+
+
+ +
+
+

Pro Tip

+

Add a .readmegenai config for custom styles.

+
-
- PING - 14MS +
+
+ +
+
+

Integration

+

Supports JS, Python, Go, and Rust natively.

+
-
-