-
Notifications
You must be signed in to change notification settings - Fork 1
Enhance navigation and search experience #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { Breadcrumbs } from "@/components/breadcrumbs"; | ||
|
|
||
| export default function RGPVLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <> | ||
| <Breadcrumbs /> | ||
| {children} | ||
| </> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| "use client"; | ||
|
|
||
| import Link from "next/link"; | ||
| import { usePathname } from "next/navigation"; | ||
| import { ChevronRight, Home } from "lucide-react"; | ||
|
|
||
| export function Breadcrumbs() { | ||
| const pathname = usePathname(); | ||
| const pathNames = pathname.split("/").filter((path) => path); | ||
|
|
||
| if (pathNames.length <= 1) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <div className="mx-auto w-full max-w-7xl px-6 lg:px-8"> | ||
| <nav aria-label="breadcrumb" className="py-4"> | ||
| <ol className="flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground"> | ||
| <li> | ||
| <Link | ||
| href="/" | ||
| className="flex items-center transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded" | ||
| aria-label="Home" | ||
| > | ||
| <Home className="h-4 w-4" /> | ||
| </Link> | ||
| </li> | ||
| {pathNames.length > 0 && <ChevronRight className="h-4 w-4" />} | ||
| {pathNames.map((link, index) => { | ||
| const href = `/${pathNames.slice(0, index + 1).join("/")}`; | ||
| const isLast = index === pathNames.length - 1; | ||
| const label = decodeURIComponent(link) | ||
| .replace(/-/g, " ") | ||
| .replace(/\b\w/g, (char) => char.toUpperCase()); | ||
|
|
||
| return ( | ||
| <li key={href} className="flex items-center gap-1.5"> | ||
| {isLast ? ( | ||
| <span | ||
| className="font-medium text-foreground" | ||
| aria-current="page" | ||
| > | ||
| {label} | ||
| </span> | ||
| ) : ( | ||
| <> | ||
| <Link | ||
| href={href} | ||
| className="transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded" | ||
| > | ||
| {label} | ||
| </Link> | ||
| <ChevronRight className="h-4 w-4" /> | ||
| </> | ||
| )} | ||
| </li> | ||
| ); | ||
| })} | ||
| </ol> | ||
| </nav> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -56,7 +56,7 @@ export default function Footer() { | |||||||||||||||||||||||||||||||
| <ul className="space-y-2.5"> | ||||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||
| href="/subjects" | ||||||||||||||||||||||||||||||||
| href="/rgpv" | ||||||||||||||||||||||||||||||||
| className="text-sm text-[#AFC8FF]/70 transition-colors hover:text-white" | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| Subjects | ||||||||||||||||||||||||||||||||
|
|
@@ -65,7 +65,7 @@ export default function Footer() { | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||
| href="/universities" | ||||||||||||||||||||||||||||||||
| href="/#Universities" | ||||||||||||||||||||||||||||||||
| className="text-sm text-[#AFC8FF]/70 transition-colors hover:text-white" | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| Universities | ||||||||||||||||||||||||||||||||
|
|
@@ -101,7 +101,7 @@ export default function Footer() { | |||||||||||||||||||||||||||||||
| <ul className="space-y-2.5"> | ||||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||
| href="/subjects" | ||||||||||||||||||||||||||||||||
| href="/rgpv" | ||||||||||||||||||||||||||||||||
| className="flex items-center gap-2 text-sm text-[#AFC8FF]/70 transition-colors hover:text-white" | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| <BookOpen className="h-4 w-4" /> | ||||||||||||||||||||||||||||||||
|
|
@@ -111,7 +111,7 @@ export default function Footer() { | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||
| href="/subjects" | ||||||||||||||||||||||||||||||||
| href="/rgpv" | ||||||||||||||||||||||||||||||||
| className="flex items-center gap-2 text-sm text-[#AFC8FF]/70 transition-colors hover:text-white" | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| <GraduationCap className="h-4 w-4" /> | ||||||||||||||||||||||||||||||||
|
|
@@ -121,7 +121,7 @@ export default function Footer() { | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||
| href="/subjects" | ||||||||||||||||||||||||||||||||
| href="/rgpv" | ||||||||||||||||||||||||||||||||
| className="text-sm text-[#AFC8FF]/70 transition-colors hover:text-white" | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| AI Tutor | ||||||||||||||||||||||||||||||||
|
|
@@ -130,7 +130,7 @@ export default function Footer() { | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||
| href="/subjects" | ||||||||||||||||||||||||||||||||
| href="/rgpv" | ||||||||||||||||||||||||||||||||
| className="text-sm text-[#AFC8FF]/70 transition-colors hover:text-white" | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| Syllabus | ||||||||||||||||||||||||||||||||
|
|
@@ -177,7 +177,7 @@ export default function Footer() { | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <li> | ||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||
| href="/privacy" | ||||||||||||||||||||||||||||||||
| href="/" | ||||||||||||||||||||||||||||||||
| className="text-sm text-[#AFC8FF]/70 transition-colors hover:text-white" | ||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||
| Privacy | ||||||||||||||||||||||||||||||||
|
Comment on lines
178
to
183
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Restore the privacy-policy destination. Line 180 now sends Privacy to Suggested fix <li>
<Link
- href="/"
+ href="/privacy"
className="text-sm text-[`#AFC8FF`]/70 transition-colors hover:text-white"
>
Privacy
</Link>
</li>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep
<ol>children limited to<li>elements.Line 28 inserts the separator directly under the ordered list, which produces invalid list markup and weakens breadcrumb semantics for assistive tech. Wrap that separator in an
<li aria-hidden="true">(or move separators inside adjacent list items) so every direct child of<ol>is an<li>.Proposed fix
<ol className="flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground"> <li> <Link href="/" className="flex items-center transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded" aria-label="Home" > <Home className="h-4 w-4" /> </Link> </li> - {pathNames.length > 0 && <ChevronRight className="h-4 w-4" />} + {pathNames.length > 0 && ( + <li aria-hidden="true"> + <ChevronRight className="h-4 w-4" /> + </li> + )}📝 Committable suggestion
🤖 Prompt for AI Agents