From 749ac8602e163b53fc0c6f7a0a217534e46e398d Mon Sep 17 00:00:00 2001 From: AaryanSingh31 Date: Sat, 30 May 2026 12:59:27 +0530 Subject: [PATCH 1/3] feat: add sticky sidebar navigation for dashboard sections --- src/app/dashboard/page.tsx | 26 +++--- src/components/DashboardSidebar.tsx | 130 ++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 10 deletions(-) create mode 100644 src/components/DashboardSidebar.tsx diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index e0de40eeb..c6ee6aaf5 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -29,6 +29,7 @@ import RecentActivity from "@/components/RecentActivity"; import { authOptions } from "@/lib/auth"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; +import DashboardSidebar from "@/components/DashboardSidebar"; export default async function DashboardPage() { const session = await getServerSession(authOptions); @@ -36,6 +37,9 @@ export default async function DashboardPage() { return (
+
+ +
-
+
-
+
-
+
{/* Row 1: Contribution graph + Streak + Local Coding Time */} -
+
-
+
-
+
{/* Row 2: PR metrics, community metrics, PR breakdown & Time Chart */} -
+
@@ -99,7 +103,7 @@ export default async function DashboardPage() {
{/* Row 3: Issue metrics + CI analytics */} -
+
@@ -121,16 +125,18 @@ export default async function DashboardPage() {
{/* Row 6: Top repos + Language breakdown + Goal tracker */} -
+
{/* Row 7: Recent GitHub activity */} -
+
+
+
); } diff --git a/src/components/DashboardSidebar.tsx b/src/components/DashboardSidebar.tsx new file mode 100644 index 000000000..3fb4a5ccb --- /dev/null +++ b/src/components/DashboardSidebar.tsx @@ -0,0 +1,130 @@ +"use client"; +import { useEffect, useState } from "react"; +import { + Menu, + X, + Flame, + GitPullRequest, + Target, + AlertCircle, + BarChart2, + GitCommit, + CalendarDays, + Bot, + Trophy, +} from "lucide-react"; + +const sections = [ + { id: "weekly-summary", label: "Weekly Summary", icon: CalendarDays }, + { id: "ai-mentor", label: "AI Mentor", icon: Bot }, + { id: "personal-records", label: "Personal Records", icon: Trophy }, + { id: "contribution", label: "Contributions", icon: GitCommit }, + { id: "friend-comparison", label: "Friend Comparison", icon: Flame }, + { id: "streak", label: "Streak", icon: Flame }, + { id: "pr-analytics", label: "PR Analytics", icon: GitPullRequest }, + { id: "issues", label: "Issues", icon: AlertCircle }, + { id: "top-repos", label: "Top Repos & Goals", icon: Target }, + { id: "recent-activity", label: "Recent Activity", icon: BarChart2 }, +]; + +export default function DashboardSidebar() { + const [activeId, setActiveId] = useState(""); + const [mobileOpen, setMobileOpen] = useState(false); + + useEffect(() => { + const observers: IntersectionObserver[] = []; + + sections.forEach(({ id }) => { + const el = document.getElementById(id); + if (!el) return; + + const observer = new IntersectionObserver( + ([entry]) => { + if (entry.isIntersecting) setActiveId(id); + }, + { threshold: 0.3 } + ); + + observer.observe(el); + observers.push(observer); + }); + + return () => observers.forEach((o) => o.disconnect()); + }, []); + + const handleNavClick = () => { + setMobileOpen(false); + }; + + return ( + <> + + + + {/* Mobile Overlay */} + {mobileOpen && ( +
setMobileOpen(false)} + /> + )} + + {/* Mobile Drawer */} +
+
+ + Navigate + + +
+ + {sections.map(({ id, label, icon: Icon }) => ( + + + {label} + + ))} +
+ + ); +} \ No newline at end of file From fdbf771d4f8e4275735376a9f0ec5cc688c12b5f Mon Sep 17 00:00:00 2001 From: AaryanSingh31 Date: Mon, 1 Jun 2026 09:40:21 +0530 Subject: [PATCH 2/3] Save work before rebase --- package-lock.json | 11 ++++++++++- package.json | 1 + src/app/dashboard/page.tsx | 26 ++++++++++---------------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 64c4a28cf..2fe33c91f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "html-to-image": "^1.11.13", "jspdf": "^4.2.1", "jspdf-autotable": "^5.0.7", + "lucide-react": "^1.17.0", "next": "^14.2.35", "next-auth": "^4.24.7", "react": "^18", @@ -5638,6 +5639,15 @@ "node": ">=10" } }, + "node_modules/lucide-react": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.17.0.tgz", + "integrity": "sha512-9FA9evdox/JQL5PT57fdA1x/yg8T7knJ98+zjTL3UfKza6pflQUUh3XtaQIHKvnsJw1lmsEyHVlt5jchYxOQ5w==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -6461,7 +6471,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, diff --git a/package.json b/package.json index e11614365..e1a17f7bb 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "html-to-image": "^1.11.13", "jspdf": "^4.2.1", "jspdf-autotable": "^5.0.7", + "lucide-react": "^1.17.0", "next": "^14.2.35", "next-auth": "^4.24.7", "react": "^18", diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index c6ee6aaf5..e0de40eeb 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -29,7 +29,6 @@ import RecentActivity from "@/components/RecentActivity"; import { authOptions } from "@/lib/auth"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; -import DashboardSidebar from "@/components/DashboardSidebar"; export default async function DashboardPage() { const session = await getServerSession(authOptions); @@ -37,9 +36,6 @@ export default async function DashboardPage() { return (
-
- -
-
+
-
+
-
+
{/* Row 1: Contribution graph + Streak + Local Coding Time */} -
+
-
+
-
+
{/* Row 2: PR metrics, community metrics, PR breakdown & Time Chart */} -
+
@@ -103,7 +99,7 @@ export default async function DashboardPage() {
{/* Row 3: Issue metrics + CI analytics */} -
+
@@ -125,18 +121,16 @@ export default async function DashboardPage() {
{/* Row 6: Top repos + Language breakdown + Goal tracker */} -
+
{/* Row 7: Recent GitHub activity */} -
+
-
-
); } From 19ac78e46b8f2c2a91881789505bd50c589f4ceb Mon Sep 17 00:00:00 2001 From: AaryanSingh31 Date: Mon, 1 Jun 2026 10:34:32 +0530 Subject: [PATCH 3/3] Minor changes --- src/app/dashboard/page.tsx | 171 +++++++++++++++------------- src/app/globals.css | 3 + src/components/DashboardSidebar.tsx | 10 +- 3 files changed, 93 insertions(+), 91 deletions(-) diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index e0de40eeb..7d83335a1 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -29,107 +29,114 @@ import RecentActivity from "@/components/RecentActivity"; import { authOptions } from "@/lib/auth"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; +import DashboardSidebar from "@/components/DashboardSidebar"; export default async function DashboardPage() { const session = await getServerSession(authOptions); if (!session) redirect("/"); return ( -
- -
- - Settings - - -
- +
+
+ +
+ +
+ + Settings + + +
+ -
- -
+
+ +
-
- -
+
+ +
-
- -
+
+ +
+
+
+ +
+ +
+
+ +
+
- {/* Row 1: Contribution graph + Streak + Local Coding Time */} -
-
- -
- +
+ + +
+
+
+ + + +
+
- +
-
-
- - -
-
+
+ +
- {/* Row 2: PR metrics, community metrics, PR breakdown & Time Chart */} -
- - - - -
- {/* Row 2b: Activity Ring Chart */} -
- -
+
+ +
-
- -
+
+
+ +
+ +
-
- -
+ {/* Row 3b: Discussion activity */} +
+ +
+
+ +
- {/* Row 3: Issue metrics + CI analytics */} -
-
- +
+ +
+
+ + + +
+
+ +
- -
- {/* Row 3b: Discussion activity */} -
- -
- - {/* Row 4: Pinned repositories */} -
- -
- - {/* Row 5: Inactive repository reminder */} -
- -
- - {/* Row 6: Top repos + Language breakdown + Goal tracker */} -
- - - -
- - {/* Row 7: Recent GitHub activity */} -
-
); diff --git a/src/app/globals.css b/src/app/globals.css index 31a717656..535e1af78 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -84,3 +84,6 @@ body { .fade-up { animation: fadeUp 0.7s ease-out; } +html { + scroll-behavior: smooth; +} \ No newline at end of file diff --git a/src/components/DashboardSidebar.tsx b/src/components/DashboardSidebar.tsx index 3fb4a5ccb..7edab85c7 100644 --- a/src/components/DashboardSidebar.tsx +++ b/src/components/DashboardSidebar.tsx @@ -16,13 +16,9 @@ import { const sections = [ { id: "weekly-summary", label: "Weekly Summary", icon: CalendarDays }, - { id: "ai-mentor", label: "AI Mentor", icon: Bot }, { id: "personal-records", label: "Personal Records", icon: Trophy }, { id: "contribution", label: "Contributions", icon: GitCommit }, - { id: "friend-comparison", label: "Friend Comparison", icon: Flame }, - { id: "streak", label: "Streak", icon: Flame }, { id: "pr-analytics", label: "PR Analytics", icon: GitPullRequest }, - { id: "issues", label: "Issues", icon: AlertCircle }, { id: "top-repos", label: "Top Repos & Goals", icon: Target }, { id: "recent-activity", label: "Recent Activity", icon: BarChart2 }, ]; @@ -58,7 +54,7 @@ export default function DashboardSidebar() { return ( <> -