From 37ae9169e80237b31759cef10bdc615bbd571766 Mon Sep 17 00:00:00 2001 From: nitin mohan Date: Sat, 27 Jun 2026 00:03:07 +0530 Subject: [PATCH 1/5] clean up ui code and add missing features Removed a bunch of duplicate data files and empty UI ghost files that were causing errors. Also added a working university search bar and updated the AI chat so it shows a nice demo message instead of crashing when the backend is offline. --- app/(public)/page.tsx | 13 +- app/error.tsx | 34 + app/globals.css | 22 + app/layout.tsx | 12 +- .../[branch]/[semester]/[subject]/page.tsx | 3 +- .../[subject]/pyqs/[paper]/page.tsx | 2 +- .../[semester]/[subject]/syllabus/page.tsx | 3 +- app/rgpv/[branch]/page.tsx | 7 + components/ai/answer-viewer.tsx | 276 +++---- components/ai/chat-mockup.tsx | 101 +++ components/ai/generate-answer-button.tsx | 197 ++--- components/ai/workspace-chat.tsx | 43 +- components/ai/workspace-prompt-button.tsx | 65 -- components/mode-toggle.tsx | 2 +- components/navbar.tsx | 31 +- components/syllabus/module-card.tsx | 25 +- components/ui/button.tsx | 0 components/ui/card.tsx | 0 components/ui/dialog.tsx | 0 components/ui/table.tsx | 0 components/university/university-stats.tsx | 210 ------ constants/index.ts | 0 features/landing/ai-demo.tsx | 92 +-- features/landing/faq.tsx | 51 +- features/landing/features.tsx | 52 +- features/landing/hero.tsx | 2 +- features/landing/stats.tsx | 28 +- features/landing/testimonials.tsx | 145 +--- features/landing/universities.tsx | 83 +- hooks/use-debounce.ts | 0 lib/academic.ts | 15 - lib/api-endpoints.ts | 4 + lib/constants.ts | 6 + lib/content/{syllabus.ts => index.ts} | 29 + lib/content/pyqs.ts | 31 - lib/content/rgpv.ts | 42 -- lib/data/index.ts | 4 + lib/data/landing.ts | 210 ++++++ lib/data/pyqs.ts | 20 - lib/data/semesters.ts | 47 -- lib/data/syllabus.ts | 20 - lib/export-utils.ts | 116 +++ lib/utils.ts | 6 + package-lock.json | 710 ++++++++++++++++++ package.json | 3 + types/ai.ts | 1 + 46 files changed, 1675 insertions(+), 1088 deletions(-) create mode 100644 app/error.tsx create mode 100644 components/ai/chat-mockup.tsx delete mode 100644 components/ai/workspace-prompt-button.tsx delete mode 100644 components/ui/button.tsx delete mode 100644 components/ui/card.tsx delete mode 100644 components/ui/dialog.tsx delete mode 100644 components/ui/table.tsx delete mode 100644 components/university/university-stats.tsx delete mode 100644 constants/index.ts delete mode 100644 hooks/use-debounce.ts delete mode 100644 lib/academic.ts create mode 100644 lib/api-endpoints.ts create mode 100644 lib/constants.ts rename lib/content/{syllabus.ts => index.ts} (52%) delete mode 100644 lib/content/pyqs.ts delete mode 100644 lib/content/rgpv.ts create mode 100644 lib/data/landing.ts delete mode 100644 lib/data/pyqs.ts delete mode 100644 lib/data/semesters.ts delete mode 100644 lib/data/syllabus.ts create mode 100644 lib/export-utils.ts create mode 100644 lib/utils.ts diff --git a/app/(public)/page.tsx b/app/(public)/page.tsx index 35f02eb..2fd796f 100644 --- a/app/(public)/page.tsx +++ b/app/(public)/page.tsx @@ -5,17 +5,18 @@ import AIDemo from "@/features/landing/ai-demo"; import Universities from "@/features/landing/universities"; import Testimonials from "@/features/landing/testimonials"; import FAQ from "@/features/landing/faq"; +import { Suspense } from "react"; export default function HomePage() { return ( <> - - - - - - + }> + }> + }> + }> + }> + }> ); } diff --git a/app/error.tsx b/app/error.tsx new file mode 100644 index 0000000..79a0f97 --- /dev/null +++ b/app/error.tsx @@ -0,0 +1,34 @@ +"use client"; + +import { useEffect } from "react"; +import { AlertCircle } from "lucide-react"; + +export default function ErrorPage({ + error, + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + console.error(error); + }, [error]); + + return ( +
+
+ +
+

Something went wrong!

+

+ We've encountered an unexpected error. Please try again. +

+ +
+ ); +} diff --git a/app/globals.css b/app/globals.css index 574b664..206463f 100644 --- a/app/globals.css +++ b/app/globals.css @@ -55,4 +55,26 @@ background-color: hsl(var(--background)); color: hsl(var(--foreground)); } + + /* Global Focus Visible */ + *:focus-visible { + outline: 2px solid hsl(var(--ring)); + outline-offset: 2px; + } +} + +/* Custom Scrollbar */ +::-webkit-scrollbar { + width: 8px; + height: 8px; +} +::-webkit-scrollbar-track { + background: hsl(var(--background)); +} +::-webkit-scrollbar-thumb { + background: hsl(var(--border)); + border-radius: 4px; +} +::-webkit-scrollbar-thumb:hover { + background: hsl(var(--muted-foreground)); } diff --git a/app/layout.tsx b/app/layout.tsx index e4025e6..de7c198 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -16,15 +16,23 @@ export default function RootLayout({ }) { return ( - + + + Skip to content + - {children} +
+ {children} +