Repository: CoderPush/pulse
Pull request #50: fix: update user pages
Author: login: Minhchau0108
Created: 2025-05-07T02:39:00Z | Merged: 2025-05-07T04:11:20Z

## Summary by Sourcery

Refactor and improve the user pages (history and profile) with enhanced UI, layout, and user experience

New Features:
- Introduced mobile sidebar for navigation
- Added icons to improve visual hierarchy
- Implemented more detailed card layouts

Enhancements:
- Redesigned history and profile pages with more structured and visually appealing layouts
- Added sidebar navigation for authenticated pages
- Improved error handling and visual feedback
- Enhanced responsive design

Chores:
- Updated package dependencies
- Reorganized page layouts

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Introduced a Sidebar component for easier navigation in authenticated sections.
  - Added layout wrappers for history and profile pages, providing consistent sidebar navigation and improved structure.
  - Added a customizable Sheet UI component for sliding panel interfaces.
  - Added new Label and Switch UI components for enhanced form controls.

- **Enhancements**
  - Improved the NavBar with icons and better dropdown styling.
  - Refined the layout and design of the profile and history pages, including responsive adjustments and visual hierarchy improvements.
  - Added a "Recent Activity" section to the profile page.
  - Enhanced error and empty state messages with styled cards and icons.
  - Updated authenticated layout to remove forced centering for more flexible content display.
  - Enhanced WeekFilter dropdown items with improved hover and focus styling.

- **Chores**
  - Added Radix UI dependencies for label and switch components.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/package.json b/package.json
index eede8cb..43ef274 100644
--- a/package.json
+++ b/package.json
@@ -27,9 +27,11 @@
     "@radix-ui/react-checkbox": "^1.2.3",
     "@radix-ui/react-dialog": "^1.1.11",
     "@radix-ui/react-dropdown-menu": "^2.1.12",
+    "@radix-ui/react-label": "^2.1.6",
     "@radix-ui/react-scroll-area": "^1.2.6",
     "@radix-ui/react-select": "^2.2.2",
     "@radix-ui/react-slot": "^1.2.0",
+    "@radix-ui/react-switch": "^1.2.4",
     "@radix-ui/react-tabs": "^1.1.9",
     "@radix-ui/react-toast": "^1.2.11",
     "@supabase/ssr": "^0.6.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 562fc96..bb6d413 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -23,6 +23,9 @@ importers:
       '@radix-ui/react-dropdown-menu':
         specifier: ^2.1.12
         version: 2.1.12(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
+      '@radix-ui/react-label':
+        specifier: ^2.1.6
+        version: 2.1.6(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
       '@radix-ui/react-scroll-area':
         specifier: ^1.2.6
         version: 1.2.6(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
@@ -32,6 +35,9 @@ importers:
       '@radix-ui/react-slot':
         specifier: ^1.2.0
         version: 1.2.0(@types/react@19.1.2)(react@19.1.0)
+      '@radix-ui/react-switch':
+        specifier: ^1.2.4
+        version: 1.2.4(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
       '@radix-ui/react-tabs':
         specifier: ^1.1.9
         version: 1.1.9(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
@@ -1074,6 +1080,19 @@ packages:
       '@types/react':
         optional: true
 
+  '@radix-ui/react-label@2.1.6':
+    resolution: {integrity: sha512-S/hv1mTlgcPX2gCTJrWuTjSXf7ER3Zf7zWGtOprxhIIY93Qin3n5VgNA0Ez9AgrK/lEtlYgzLd4f5x6AVar4Yw==}
+    peerDependencies:
+      '@types/react': '*'
+      '@types/react-dom': '*'
+      react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+      react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+    peerDependenciesMeta:
+      '@types/react':
+        optional: true
+      '@types/react-dom':
+        optional: true
+
   '@radix-ui/react-menu@2.1.12':
     resolution: {integrity: sha512-+qYq6LfbiGo97Zz9fioX83HCiIYYFNs8zAsVCMQrIakoNYylIzWuoD/anAD3UzvvR6cnswmfRFJFq/zYYq/k7Q==}
     peerDependencies:
@@ -1139,6 +1158,19 @@ packages:
       '@types/react-dom':
         optional: true
 
+  '@radix-ui/react-primitive@2.1.2':
+    resolution: {integrity: sha512-uHa+l/lKfxuDD2zjN/0peM/RhhSmRjr5YWdk/37EnSv1nJ88uvG85DPexSm8HdFQROd2VdERJ6ynXbkCFi+APw==}
+    peerDependencies:
+      '@types/react': '*'
+      '@types/react-dom': '*'
+      react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+      react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+    peerDependenciesMeta:
+      '@types/react':
+        optional: true
+      '@types/react-dom':
+        optional: true
+
   '@radix-ui/react-roving-focus@1.1.7':
     resolution: {integrity: sha512-C6oAg451/fQT3EGbWHbCQjYTtbyjNO1uzQgMzwyivcHT3GKNEmu1q3UuREhN+HzHAVtv3ivMVK08QlC+PkYw9Q==}
     peerDependencies:
@@ -1187,6 +1219,28 @@ packages:
       '@types/react':
         optional: true
 
+  '@radix-ui/react-slot@1.2.2':
+    resolution: {integrity: sha512-y7TBO4xN4Y94FvcWIOIh18fM4R1A8S4q1jhoz4PNzOoHsFcN8pogcFmZrTYAm4F9VRUrWP/Mw7xSKybIeRI+CQ==}
+    peerDependencies:
+      '@types/react': '*'
+      react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+    peerDependenciesMeta:
+      '@types/react':
+        optional: true
+
+  '@radix-ui/react-switch@1.2.4':
+    resolution: {integrity: sha512-yZCky6XZFnR7pcGonJkr9VyNRu46KcYAbyg1v/gVVCZUr8UJ4x+RpncC27hHtiZ15jC+3WS8Yg/JSgyIHnYYsQ==}
+    peerDependencies:
+      '@types/react': '*'
+      '@types/react-dom': '*'
+      react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+      react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+    peerDependenciesMeta:
+      '@types/react':
+        optional: true
+      '@types/react-dom':
+        optional: true
+
   '@radix-ui/react-tabs@1.1.9':
     resolution: {integrity: sha512-KIjtwciYvquiW/wAFkELZCVnaNLBsYNhTNcvl+zfMAbMhRkcvNuCLXDDd22L0j7tagpzVh/QwbFpwAATg7ILPw==}
     peerDependencies:
@@ -4620,6 +4674,15 @@ snapshots:
     optionalDependencies:
       '@types/react': 19.1.2
 
+  '@radix-ui/react-label@2.1.6(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)':
+    dependencies:
+      '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
+      react: 19.1.0
+      react-dom: 19.1.0(react@19.1.0)
+    optionalDependencies:
+      '@types/react': 19.1.2
+      '@types/react-dom': 19.1.2(@types/react@19.1.2)
+
   '@radix-ui/react-menu@2.1.12(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)':
     dependencies:
       '@radix-ui/primitive': 1.1.2
@@ -4693,6 +4756,15 @@ snapshots:
       '@types/react': 19.1.2
       '@types/react-dom': 19.1.2(@types/react@19.1.2)
 
+  '@radix-ui/react-primitive@2.1.2(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)':
+    dependencies:
+      '@radix-ui/react-slot': 1.2.2(@types/react@19.1.2)(react@19.1.0)
+      react: 19.1.0
+      react-dom: 19.1.0(react@19.1.0)
+    optionalDependencies:
+      '@types/react': 19.1.2
+      '@types/react-dom': 19.1.2(@types/react@19.1.2)
+
   '@radix-ui/react-roving-focus@1.1.7(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)':
     dependencies:
       '@radix-ui/primitive': 1.1.2
@@ -4763,6 +4835,28 @@ snapshots:
     optionalDependencies:
       '@types/react': 19.1.2
 
+  '@radix-ui/react-slot@1.2.2(@types/react@19.1.2)(react@19.1.0)':
+    dependencies:
+      '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.1.2)(react@19.1.0)
+      react: 19.1.0
+    optionalDependencies:
+      '@types/react': 19.1.2
+
+  '@radix-ui/react-switch@1.2.4(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)':
+    dependencies:
+      '@radix-ui/primitive': 1.1.2
+      '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.1.2)(react@19.1.0)
+      '@radix-ui/react-context': 1.1.2(@types/react@19.1.2)(react@19.1.0)
+      '@radix-ui/react-primitive': 2.1.2(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
+      '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.1.2)(react@19.1.0)
+      '@radix-ui/react-use-previous': 1.1.1(@types/react@19.1.2)(react@19.1.0)
+      '@radix-ui/react-use-size': 1.1.1(@types/react@19.1.2)(react@19.1.0)
+      react: 19.1.0
+      react-dom: 19.1.0(react@19.1.0)
+    optionalDependencies:
+      '@types/react': 19.1.2
+      '@types/react-dom': 19.1.2(@types/react@19.1.2)
+
   '@radix-ui/react-tabs@1.1.9(@types/react-dom@19.1.2(@types/react@19.1.2))(@types/react@19.1.2)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)':
     dependencies:
       '@radix-ui/primitive': 1.1.2
diff --git a/src/app/(authenticated)/history/layout.tsx b/src/app/(authenticated)/history/layout.tsx
new file mode 100644
index 0000000..0757cee
--- /dev/null
+++ b/src/app/(authenticated)/history/layout.tsx
@@ -0,0 +1,28 @@
+import { createClient } from '@/utils/supabase/server'
+import { redirect } from 'next/navigation'
+import { Sidebar } from '@/components/Sidebar'
+
+export default async function HistoryLayout({
+  children,
+}: {
+  children: React.ReactNode
+}) {
+  const supabase = await createClient()
+  const { data: { user } } = await supabase.auth.getUser()
+
+  if (!user) {
+    redirect('/auth/login')
+  }
+
+  return (
+    <div className="flex min-h-[calc(100vh-4rem)] h-full">
+      <Sidebar pathname="/history" />
+      {/* Main Content */}
+      <div className="flex-1 overflow-auto">
+        <div className="container mx-auto py-8 px-6">
+          {children}
+        </div>
+      </div>
+    </div>
+  )
+} 
\ No newline at end of file
diff --git a/src/app/(authenticated)/history/page.tsx b/src/app/(authenticated)/history/page.tsx
index 9c7fa76..b3a1cc6 100644
--- a/src/app/(authenticated)/history/page.tsx
+++ b/src/app/(authenticated)/history/page.tsx
@@ -10,6 +10,7 @@ import {
 import { Badge } from "@/components/ui/badge"
 import { WeekFilter } from '@/components/WeekFilter'
 import { getMostRecentThursdayWeek } from '@/lib/utils/date'
+import { Calendar, AlertCircle, CalendarX } from 'lucide-react'
 
 const getCurrentYear = () => new Date().getFullYear();
 const getCurrentWeek = () => getMostRecentThursdayWeek();
@@ -45,22 +46,27 @@ export default async function HistoryPage({
   if (weeksErr || subErr) {
     console.error({ weeksErr, subErr });
     return (
-      <div className="container mx-auto py-8 px-4">
-        <div className="text-center">
-          <h1 className="text-2xl font-bold text-red-600 dark:text-red-400 mb-4">Error Loading Data</h1>
-          <p className="text-muted-foreground">There was an error loading your history. Please try again later.</p>
-        </div>
+      <div className="max-w-4xl mx-auto">
+        <Card className="border-destructive">
+          <CardContent className="pt-6">
+            <div className="flex items-center gap-2 text-destructive mb-2">
+              <AlertCircle className="w-5 h-5" />
+              <h2 className="text-xl font-semibold">Error Loading Data</h2>
+            </div>
+            <p className="text-muted-foreground">There was an error loading your history. Please try again later.</p>
+          </CardContent>
+        </Card>
       </div>
     );
   }
 
-  // 3. Build a map for quick lookup
+  // Build a map for quick lookup
   const submissionMap = new Map();
   (submissions || []).forEach(sub => {
     submissionMap.set(sub.week_number, sub);
   });
 
-  // 4. Prepare week options for the filter
+  // Prepare week options for the filter
   const weekOptions = (allWeeks || [])
     .filter(w => w.week_number <= currentWeek || w.year < currentYear)
     .map(w => ({
@@ -70,109 +76,144 @@ export default async function HistoryPage({
       year: w.year,
     }));
 
-  // 5. Determine selected week
+  // Determine selected week
   const defaultWeekValue = weekOptions.find(w => w.week_number === currentWeek && w.year === currentYear)?.value || 
     (weekOptions.length > 0 ? weekOptions[weekOptions.length - 1].value : '');
   const selectedWeekParam = params.week || defaultWeekValue;
   const [selectedYear, selectedWeek] = selectedWeekParam.split('-').map(Number);
 
-  // 6. Find the week and submission
+  // Find the week and submission
   const week = weekOptions.find(w => w.year === selectedYear && w.week_number === selectedWeek);
   const submission = submissionMap.get(selectedWeek);
 
   return (
-    <div className="container mx-auto py-8 px-4 space-y-8">
+    <div className="max-w-4xl mx-auto space-y-6">
       <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
         <div>
-          <h1 className="text-2xl font-bold">Weekly Pulse History</h1>
-          <p className="text-muted-foreground">View your past submissions. Select a week to filter.</p>
+          <h1 className="text-3xl font-bold mb-2">Weekly Pulse History</h1>
+          <p className="text-muted-foreground">View your past submissions and track your progress</p>
         </div>
         <Suspense fallback={<div>Loading filter...</div>}>
           <WeekFilter weeks={weekOptions} />
         </Suspense>
       </div>
+
       {week ? (
-        <Card className="w-full shadow-xl border-primary/10 border-2">
-          <CardHeader className="border-b pb-2">
-            <CardTitle className="text-xl">{week.label}</CardTitle>
+        <Card className="w-full shadow-lg border-primary/10">
+          <CardHeader className="border-b pb-4">
+            <div className="flex items-center justify-between">
+              <div className="flex items-center gap-2">
+                <Calendar className="w-5 h-5 text-blue-700 dark:text-blue-300" />
+                <CardTitle className="text-xl text-blue-700 dark:text-blue-300">{week.label}</CardTitle>
+              </div>
+              {submission && (
+                <div className="flex items-center gap-2">
+                  <Badge className="bg-blue-100 text-blue-700 border-blue-200 font-semibold dark:bg-blue-900 dark:text-blue-300 dark:border-blue-800">
+                    {submission.status}
+                  </Badge>
+                  {submission.is_late && <Badge variant="destructive">Late</Badge>}
+                </div>
+              )}
+            </div>
           </CardHeader>
-          <CardContent>
+          <CardContent className="pt-6">
             {submission ? (
-              <div>
-                <div className="p-6 rounded-xl shadow-sm transition-all">
-                  <div className="flex flex-col gap-2 mb-2">
-                    <div className="flex items-center gap-4">
-                      <span className="text-xl font-bold text-foreground tracking-tight">{submission.primary_project_name}</span>
-                      <span className="text-lg font-semibold text-primary bg-primary/10 px-3 py-1 rounded-full">{submission.primary_project_hours}h</span>
-                      <Badge variant={submission.status === 'submitted' ? 'secondary' : 'outline'}>
-                        {submission.status}
-                      </Badge>
-                      {submission.is_late && <Badge variant="destructive">Late</Badge>}
-                    </div>
-                    <div className="flex flex-wrap gap-4 text-sm text-muted-foreground border-b border-dashed border-muted pb-2">
-                      <span>Submitted: <span className="text-foreground font-medium">{new Date(submission.submitted_at).toLocaleString()}</span></span>
-                      <span>Manager: <span className="text-foreground font-medium">{submission.manager}</span></span>
-                      {submission.form_completion_time && (
-                        <span>Time to complete: <span className="text-foreground font-medium">{submission.form_completion_time} min</span></span>
-                      )}
+              <div className="space-y-6">
+                {/* Primary Project */}
+                <div className="bg-muted/50 rounded-lg p-4">
+                  <div className="flex items-center justify-between mb-4">
+                    <div>
+                      <h3 className="text-xl font-semibold">{submission.primary_project_name}</h3>
+                      <p className="text-muted-foreground">Primary Project</p>
                     </div>
+                    <Badge variant="outline" className="text-lg px-4 py-1">
+                      {submission.primary_project_hours}h
+                    </Badge>
                   </div>
-                  <div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-4">
+                  <div className="flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-4 text-sm text-muted-foreground">
                     <div>
-                      <h4 className="font-semibold text-sm mb-1 text-primary">Additional Projects</h4>
-                      {submission.additional_projects && submission.additional_projects.length > 0 ? (
-                        <ul className="list-disc list-inside space-y-1 ml-2">
-                          {submission.additional_projects.map((proj: { name: string; hours: number }, idx: number) => (
-                            <li key={idx} className="text-sm">
-                              <span className="font-medium">{proj.name}</span> — {proj.hours}h
-                            </li>
-                          ))}
-                        </ul>
-                      ) : (
-                        <span className="text-xs italic text-muted-foreground">None</span>
-                      )}
+                      <span className="font-medium">Submitted:</span> {new Date(submission.submitted_at).toLocaleString()}
                     </div>
-                    <div className="space-y-4">
-                      {submission.feedback && (
-                        <div>
-                          <h4 className="font-semibold text-sm mb-1 text-primary">Feedback</h4>
-                          <div className="bg-muted rounded p-2 text-sm text-foreground whitespace-pre-line border border-muted/60">{submission.feedback}</div>
-                        </div>
-                      )}
-                      {submission.changes_next_week && (
-                        <div>
-                          <h4 className="font-semibold text-sm mb-1 text-primary">Changes Next Week</h4>
-                          <div className="bg-muted rounded p-2 text-sm text-foreground whitespace-pre-line border border-muted/60">{submission.changes_next_week}</div>
-                        </div>
-                      )}
-                      {submission.milestones && (
-                        <div>
-                          <h4 className="font-semibold text-sm mb-1 text-primary">Milestones</h4>
-                          <div className="bg-muted rounded p-2 text-sm text-foreground whitespace-pre-line border border-muted/60">{submission.milestones}</div>
-                        </div>
-                      )}
-                      {submission.other_feedback && (
-                        <div>
-                          <h4 className="font-semibold text-sm mb-1 text-primary">Other Feedback</h4>
-                          <div className="bg-muted rounded p-2 text-sm text-foreground whitespace-pre-line border border-muted/60">{submission.other_feedback}</div>
-                        </div>
-                      )}
-                      {submission.hours_reporting_impact && (
-                        <div>
-                          <h4 className="font-semibold text-sm mb-1 text-primary">Hours Reporting Impact</h4>
-                          <div className="bg-muted rounded p-2 text-sm text-foreground whitespace-pre-line border border-muted/60">{submission.hours_reporting_impact}</div>
+                    <div>
+                      <span className="font-medium">Manager:</span> {submission.manager}
+                    </div>
+                    {submission.form_completion_time && (
+                      <div>
+                        <span className="font-medium">Time to complete:</span> {submission.form_completion_time} min
+                      </div>
+                    )}
+                  </div>
+                </div>
+
+                {/* Additional Projects */}
+                {submission.additional_projects && submission.additional_projects.length > 0 && (
+                  <div>
+                    <h4 className="font-semibold text-sm mb-3 text-primary">Additional Projects</h4>
+                    <div className="grid gap-3">
+                      {submission.additional_projects.map((proj: { name: string; hours: number }, idx: number) => (
+                        <div key={idx} className="flex items-center justify-between bg-muted/30 rounded-lg p-3">
+                          <span className="font-medium">{proj.name}</span>
+                          <Badge variant="outline">{proj.hours}h</Badge>
                         </div>
-                      )}
+                      ))}
                     </div>
                   </div>
+                )}
+
+                {/* Feedback and Notes */}
+                <div className="grid gap-4 md:grid-cols-2">
+                  {submission.feedback && (
+                    <div>
+                      <h4 className="font-semibold text-sm mb-2 text-primary">Feedback</h4>
+                      <div className="bg-muted/30 rounded-lg p-3 text-sm whitespace-pre-line">
+                        {submission.feedback}
+                      </div>
+                    </div>
+                  )}
+                  {submission.changes_next_week && (
+                    <div>
+                      <h4 className="font-semibold text-sm mb-2 text-primary">Changes Next Week</h4>
+                      <div className="bg-muted/30 rounded-lg p-3 text-sm whitespace-pre-line">
+                        {submission.changes_next_week}
+                      </div>
+                    </div>
+                  )}
+                  {submission.milestones && (
+                    <div>
+                      <h4 className="font-semibold text-sm mb-2 text-primary">Milestones</h4>
+                      <div className="bg-muted/30 rounded-lg p-3 text-sm whitespace-pre-line">
+                        {submission.milestones}
+                      </div>
+                    </div>
+                  )}
+                  {submission.other_feedback && (
+                    <div>
+                      <h4 className="font-semibold text-sm mb-2 text-primary">Other Feedback</h4>
+                      <div className="bg-muted/30 rounded-lg p-3 text-sm whitespace-pre-line">
+                        {submission.other_feedback}
+                      </div>
+                    </div>
+                  )}
+                  {submission.hours_reporting_impact && (
+                    <div>
+                      <h4 className="font-semibold text-sm mb-2 text-primary">Hours Reporting Impact</h4>
+                      <div className="bg-muted/30 rounded-lg p-3 text-sm whitespace-pre-line">
+                        {submission.hours_reporting_impact}
+                      </div>
+                    </div>
+                  )}
                 </div>
               </div>
             ) : (
-              <div className="flex flex-col items-center justify-center py-12">
-                <span className="text-4xl mb-4">😕</span>
-                <h2 className="text-xl font-semibold mb-2">No Submission</h2>
-                <p className="text-muted-foreground">You have not submitted a weekly pulse for this week.</p>
-              </div>
+              <Card>
+                <CardContent className="flex flex-col items-center justify-center py-12 bg-muted/40 border-0 shadow-none">
+                  <CalendarX className="w-12 h-12 text-blue-600 dark:text-blue-400 mb-4" />
+                  <h2 className="text-xl font-semibold mb-2">No Submission Yet</h2>
+                  <p className="text-muted-foreground mb-4 text-center max-w-xs">
+                    You haven&apos;t submitted your weekly pulse for this week.<br />
+                  </p>
+                </CardContent>
+              </Card>
             )}
           </CardContent>
         </Card>
diff --git a/src/app/(authenticated)/layout.tsx b/src/app/(authenticated)/layout.tsx
index 99032b2..29637e7 100644
--- a/src/app/(authenticated)/layout.tsx
+++ b/src/app/(authenticated)/layout.tsx
@@ -17,7 +17,7 @@ export default async function AuthenticatedLayout({
   return (
     <div className="min-h-screen w-full flex flex-col bg-gray-50 dark:bg-gray-900">
       <NavBar user={user} />
-      <main className="flex-1 flex items-center justify-center">
+      <main className="flex-1">
         {children}
       </main>
     </div>
diff --git a/src/app/(authenticated)/profile/layout.tsx b/src/app/(authenticated)/profile/layout.tsx
new file mode 100644
index 0000000..a92fbe5
--- /dev/null
+++ b/src/app/(authenticated)/profile/layout.tsx
@@ -0,0 +1,28 @@
+import { createClient } from '@/utils/supabase/server'
+import { redirect } from 'next/navigation'
+import { Sidebar } from '@/components/Sidebar'
+
+export default async function ProfileLayout({
+  children,
+}: {
+  children: React.ReactNode
+}) {
+  const supabase = await createClient()
+  const { data: { user } } = await supabase.auth.getUser()
+
+  if (!user) {
+    redirect('/auth/login')
+  }
+
+  return (
+    <div className="flex min-h-[calc(100vh-4rem)] h-full">
+      <Sidebar pathname="/profile" />
+      {/* Main Content */}
+      <div className="flex-1 overflow-auto">
+        <div className="container mx-auto py-8 px-6">
+          {children}
+        </div>
+      </div>
+    </div>
+  )
+} 
\ No newline at end of file
diff --git a/src/app/(authenticated)/profile/page.tsx b/src/app/(authenticated)/profile/page.tsx
index 0c6b26c..18e9ac3 100644
--- a/src/app/(authenticated)/profile/page.tsx
+++ b/src/app/(authenticated)/profile/page.tsx
@@ -3,6 +3,8 @@ import { redirect } from 'next/navigation'
 import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"
 import { Avatar, AvatarFallback } from "@/components/ui/avatar"
 import { getInitials } from '@/lib/auth/user'
+import { Settings, Bell, Clock, FileText, CalendarCheck2 } from "lucide-react"
+import Link from 'next/link'
 
 export default async function ProfilePage() {
   const supabase = await createClient()
@@ -12,25 +14,49 @@ export default async function ProfilePage() {
     redirect('/auth/login')
   }
 
+  // Fetch latest submission
+  const { data: latestSubmission, error } = await supabase
+    .from('submissions')
+    .select('*')
+    .eq('user_id', user.id)
+    .order('submitted_at', { ascending: false })
+    .limit(1)
+    .maybeSingle()
+
+  if (error) {
+    console.error('Error fetching latest submission:', error)
+  }
+
   const userInitials = getInitials(user.email);
 
   return (
-    <div className="container mx-auto px-4 py-8 max-w-2xl">
+    <div className="max-w-4xl mx-auto">
       {/* Profile Header */}
-      <div className="mb-8 text-center">
-        <Avatar className="w-24 h-24 mx-auto mb-4">
-          <AvatarFallback className="text-2xl bg-primary/10">
-            {userInitials}
-          </AvatarFallback>
-        </Avatar>
-        <h1 className="text-2xl font-bold mb-2">{user.email}</h1>
+      <div className="mb-8">
+        <div className="flex flex-col items-center gap-4 sm:flex-row sm:items-center sm:gap-6">
+          <Avatar className="w-20 h-20 sm:w-24 sm:h-24">
+            <AvatarFallback className="text-2xl bg-primary/10">
+              {userInitials}
+            </AvatarFallback>
+          </Avatar>
+          <div className="w-full text-center sm:text-left">
+            <h1 className="text-xl sm:text-3xl font-bold mb-2 truncate break-words max-w-full">{user.email}</h1>
+          </div>
+        </div>
       </div>
 
+      {error && (
+        <div className="md:col-span-2 text-red-600 text-sm mb-4">
+          Error loading your latest submission. Please try again later.
+        </div>
+      )}
+
       <div className="grid gap-6 md:grid-cols-2">
         {/* Personal Information */}
         <Card>
           <CardHeader>
-            <CardTitle className="flex items-center gap-2">
+            <CardTitle className="flex items-center gap-2 text-primary">
+              <Settings className="w-5 h-5" />
               <span>Personal Information</span>
             </CardTitle>
             <CardDescription>Your basic profile information</CardDescription>
@@ -38,7 +64,7 @@ export default async function ProfilePage() {
           <CardContent className="space-y-4">
             <div className="space-y-2">
               <label className="text-sm font-medium">Email</label>
-              <p className="text-sm text-muted-foreground">{user.email}</p>
+              <p className="text-sm text-muted-foreground break-words">{user.email}</p>
             </div>
             <div className="space-y-2">
               <label className="text-sm font-medium">Name</label>
@@ -54,7 +80,8 @@ export default async function ProfilePage() {
         {/* Preferences */}
         <Card>
           <CardHeader>
-            <CardTitle className="flex items-center gap-2">
+            <CardTitle className="flex items-center gap-2 text-primary">
+              <Bell className="w-5 h-5" />
               <span>Preferences</span>
             </CardTitle>
             <CardDescription>Your notification and display settings</CardDescription>
@@ -70,6 +97,89 @@ export default async function ProfilePage() {
             </div>
           </CardContent>
         </Card>
+
+        {/* Recent Activity */}
+        <Card className="md:col-span-2">
+          <CardHeader>
+            <CardTitle className="flex items-center gap-2 text-primary">
+              <Clock className="w-5 h-5" />
+              <span>Recent Activity</span>
+            </CardTitle>
+            <CardDescription>Your latest submission</CardDescription>
+          </CardHeader>
+          <CardContent>
+            {latestSubmission ? (
+              <div className="flex flex-col items-center gap-4 py-4">
+                <div className="flex items-center gap-2">
+                  <CalendarCheck2 className="w-7 h-7 text-green-600" />
+                  <span className="text-lg font-bold text-blue-700">Week {latestSubmission.week_number}</span>
+                  <span className="rounded-full bg-blue-100 text-blue-700 border border-blue-200 font-semibold px-3 py-1 text-xs dark:bg-blue-900 dark:text-blue-300 dark:border-blue-800 ml-2">
+                    {latestSubmission.status}
+                  </span>
+                  {latestSubmission.is_late && (
+                    <span className="rounded-full bg-red-100 text-red-700 border border-red-200 font-semibold px-3 py-1 text-xs ml-2">
+                      Late
+                    </span>
+                  )}
+                </div>
+                <div className="w-full max-w-md bg-blue-50 dark:bg-blue-950 rounded-xl shadow p-4 flex flex-col gap-3">
+                  <div className="flex items-center gap-2">
+                    <FileText className="w-4 h-4 text-blue-500" />
+                    <span className="font-medium">Project:</span>
+                    <span className="truncate">{latestSubmission.primary_project_name}</span>
+                  </div>
+                  <div className="flex items-center gap-2">
+                    <Clock className="w-4 h-4 text-blue-500" />
+                    <span className="font-medium">Hours:</span>
+                    <span>{latestSubmission.primary_project_hours}h</span>
+                  </div>
+                  {latestSubmission.additional_projects.length > 0 && (
+                    <div>
+                      <div className="flex items-center gap-2 mt-2 mb-1">
+                        <FileText className="w-4 h-4 text-blue-500" />
+                        <span className="font-medium">Additional Projects:</span>
+                      </div>
+                      <ul className="pl-6 list-disc text-sm">
+                        {latestSubmission.additional_projects.map((proj: { name: string; hours: number }, idx: number) => (
+                          <li key={idx} className="flex items-center gap-2">
+                            <span className="font-medium">{proj.name}</span>
+                            <span className="text-xs text-blue-700 bg-blue-100 rounded px-2 py-0.5 ml-2">{proj.hours}h</span>
+                          </li>
+                        ))}
+                      </ul>
+                    </div>
+                  )}
+                  <div className="flex items-center gap-2">
+                    <Bell className="w-4 h-4 text-blue-500" />
+                    <span className="font-medium">Manager:</span>
+                    <span>{latestSubmission.manager}</span>
+                  </div>
+                  <div className="flex items-center gap-2">
+                    <CalendarCheck2 className="w-4 h-4 text-blue-500" />
+                    <span className="font-medium">Submitted:</span>
+                    <span>{new Date(latestSubmission.submitted_at).toLocaleString()}</span>
+                  </div>
+                </div>
+                <Link
+                  href="/history"
+                  className="inline-flex items-center gap-2 bg-blue-600 text-white px-4 py-2 rounded-lg font-medium shadow hover:bg-blue-700 transition"
+                >
+                  <FileText className="w-4 h-4" />
+                  View Submission History
+                </Link>
+              </div>
+            ) : (
+              <div className="flex flex-col items-center justify-center py-8">
+                <CalendarCheck2 className="w-10 h-10 text-blue-400 mb-3" />
+                <p className="text-muted-foreground mb-2">No submissions yet.</p>
+                <Link href="/" className="inline-flex items-center gap-2 text-blue-600 hover:underline text-sm font-medium">
+                  <FileText className="w-4 h-4" />
+                  Submit your pulse!
+                </Link>
+              </div>
+            )}
+          </CardContent>
+        </Card>
       </div>
     </div>
   )
diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx
index 8ab6985..45798d2 100644
--- a/src/components/NavBar.tsx
+++ b/src/components/NavBar.tsx
@@ -17,6 +17,12 @@ import {
 import { signOut } from '@/utils/actions'
 import { User } from '@supabase/supabase-js'
 import { getInitials } from '@/lib/auth/user'
+import { 
+  UserCircle, 
+  History, 
+  LogOut, 
+  LineChart
+} from 'lucide-react'
 
 interface NavBarProps {
   user: User;
@@ -33,9 +39,10 @@ export default function NavBar({ user }: NavBarProps) {
           <div className="flex items-center">
             <Link 
               href="/" 
-              className="flex items-center space-x-2 text-xl font-semibold hover:opacity-90 transition-opacity"
+              className="flex items-center space-x-2 text-xl font-semibold hover:opacity-90 transition-opacity group"
             >
-              <span>Weekly Pulse</span>
+              <LineChart className="h-6 w-6 text-blue-600 dark:text-blue-400 group-hover:scale-110 transition-transform" />
+              <span className="text-blue-600 dark:text-blue-400">Weekly Pulse</span>
             </Link>
           </div>
 
@@ -45,7 +52,7 @@ export default function NavBar({ user }: NavBarProps) {
               <DropdownMenuTrigger asChild>
                 <Button 
                   variant="ghost" 
-                  className="relative h-9 w-9 rounded-full bg-gray-50 hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-800"
+                  className="relative h-9 w-9 rounded-full bg-gray-50 hover:bg-gray-100 dark:bg-gray-900 dark:hover:bg-gray-800 transition-colors"
                 >
                   <Avatar className="h-8 w-8">
                     <AvatarFallback className="bg-primary/10 text-sm font-medium">
@@ -58,26 +65,30 @@ export default function NavBar({ user }: NavBarProps) {
                 <DropdownMenuLabel className="font-normal">
                   <div className="flex flex-col space-y-1">
                     <p className="text-sm font-medium leading-none">{user.email}</p>
+                    <p className="text-xs leading-none text-muted-foreground">View profile</p>
                   </div>
                 </DropdownMenuLabel>
                 <DropdownMenuSeparator />
                 <DropdownMenuGroup>
                   <Link href="/profile" className="w-full">
                     <DropdownMenuItem className="cursor-pointer">
-                      Profile
+                      <UserCircle className="mr-2 h-4 w-4" />
+                      <span>Profile</span>
                     </DropdownMenuItem>
                   </Link>
                   <Link href="/history" className="w-full">
                     <DropdownMenuItem className="cursor-pointer">
-                      History
+                      <History className="mr-2 h-4 w-4" />
+                      <span>History</span>
                     </DropdownMenuItem>
                   </Link>
                 </DropdownMenuGroup>
                 <DropdownMenuSeparator />
                 <DropdownMenuItem asChild className="cursor-pointer focus:bg-red-50 dark:focus:bg-red-950">
                   <form action={signOut} className="w-full">
-                    <button type="submit" className="w-full text-left text-red-600 dark:text-red-400">
-                      Sign out
+                    <button type="submit" className="w-full text-left text-red-600 dark:text-red-400 flex items-center">
+                      <LogOut className="mr-2 h-4 w-4" />
+                      <span>Sign out</span>
                     </button>
                   </form>
                 </DropdownMenuItem>
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
new file mode 100644
index 0000000..be7a5bc
--- /dev/null
+++ b/src/components/Sidebar.tsx
@@ -0,0 +1,55 @@
+import Link from 'next/link'
+import { User, History } from 'lucide-react'
+import { cn } from '@/lib/utils'
+
+export type SidebarItem = {
+  title: string
+  href: string
+  icon: React.ReactNode
+}
+
+const sidebarItems: SidebarItem[] = [
+  {
+    title: 'Profile',
+    href: '/profile',
+    icon: <User className="w-5 h-5" />
+  },
+  {
+    title: 'History',
+    href: '/history',
+    icon: <History className="w-5 h-5" />
+  }
+]
+
+export function SidebarContent({ pathname }: { pathname: string }) {
+  return (
+    <nav className="space-y-1">
+      {sidebarItems.map((item) => (
+        <Link
+          key={item.href}
+          href={item.href}
+          className={cn(
+            "flex items-center gap-3 rounded-lg px-3 py-2 text-gray-500 transition-all hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50",
+            "hover:bg-gray-100 dark:hover:bg-gray-700",
+            "group",
+            pathname === item.href &&
+              "bg-blue-100 text-blue-700 font-semibold dark:bg-blue-900 dark:text-blue-300"
+          )}
+        >
+          {item.icon}
+          <span>{item.title}</span>
+        </Link>
+      ))}
+    </nav>
+  )
+}
+
+export function Sidebar({ pathname }: { pathname: string }) {
+  return (
+    <div className="hidden md:block w-64 border-r bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700">
+      <div className="p-4">
+        <SidebarContent pathname={pathname} />
+      </div>
+    </div>
+  )
+} 
\ No newline at end of file
diff --git a/src/components/WeekFilter.tsx b/src/components/WeekFilter.tsx
index 1b2b5cd..cdb3e0b 100644
--- a/src/components/WeekFilter.tsx
+++ b/src/components/WeekFilter.tsx
@@ -42,7 +42,11 @@ export function WeekFilter({ weeks }: WeekFilterProps) {
         </SelectTrigger>
         <SelectContent>
           {weeks.map(option => (
-            <SelectItem key={option.value} value={option.value}>
+            <SelectItem
+              key={option.value}
+              value={option.value}
+              className="hover:bg-blue-50 hover:text-blue-700 focus:bg-blue-100 focus:text-blue-700 data-[state=checked]:bg-blue-100 data-[state=checked]:text-blue-700"
+            >
               {option.label}
             </SelectItem>
           ))}
diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx
new file mode 100644
index 0000000..fb5fbc3
--- /dev/null
+++ b/src/components/ui/label.tsx
@@ -0,0 +1,24 @@
+"use client"
+
+import * as React from "react"
+import * as LabelPrimitive from "@radix-ui/react-label"
+
+import { cn } from "@/lib/utils"
+
+function Label({
+  className,
+  ...props
+}: React.ComponentProps<typeof LabelPrimitive.Root>) {
+  return (
+    <LabelPrimitive.Root
+      data-slot="label"
+      className={cn(
+        "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
+        className
+      )}
+      {...props}
+    />
+  )
+}
+
+export { Label }
diff --git a/src/components/ui/sheet.tsx b/src/components/ui/sheet.tsx
new file mode 100644
index 0000000..84649ad
--- /dev/null
+++ b/src/components/ui/sheet.tsx
@@ -0,0 +1,139 @@
+"use client"
+
+import * as React from "react"
+import * as SheetPrimitive from "@radix-ui/react-dialog"
+import { XIcon } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
+  return <SheetPrimitive.Root data-slot="sheet" {...props} />
+}
+
+function SheetTrigger({
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
+  return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
+}
+
+function SheetClose({
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Close>) {
+  return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
+}
+
+function SheetPortal({
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
+  return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
+}
+
+function SheetOverlay({
+  className,
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
+  return (
+    <SheetPrimitive.Overlay
+      data-slot="sheet-overlay"
+      className={cn(
+        "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
+        className
+      )}
+      {...props}
+    />
+  )
+}
+
+function SheetContent({
+  className,
+  children,
+  side = "right",
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Content> & {
+  side?: "top" | "right" | "bottom" | "left"
+}) {
+  return (
+    <SheetPortal>
+      <SheetOverlay />
+      <SheetPrimitive.Content
+        data-slot="sheet-content"
+        className={cn(
+          "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
+          side === "right" &&
+            "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
+          side === "left" &&
+            "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
+          side === "top" &&
+            "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
+          side === "bottom" &&
+            "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
+          className
+        )}
+        {...props}
+      >
+        {children}
+        <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
+          <XIcon className="size-4" />
+          <span className="sr-only">Close</span>
+        </SheetPrimitive.Close>
+      </SheetPrimitive.Content>
+    </SheetPortal>
+  )
+}
+
+function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
+  return (
+    <div
+      data-slot="sheet-header"
+      className={cn("flex flex-col gap-1.5 p-4", className)}
+      {...props}
+    />
+  )
+}
+
+function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
+  return (
+    <div
+      data-slot="sheet-footer"
+      className={cn("mt-auto flex flex-col gap-2 p-4", className)}
+      {...props}
+    />
+  )
+}
+
+function SheetTitle({
+  className,
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Title>) {
+  return (
+    <SheetPrimitive.Title
+      data-slot="sheet-title"
+      className={cn("text-foreground font-semibold", className)}
+      {...props}
+    />
+  )
+}
+
+function SheetDescription({
+  className,
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Description>) {
+  return (
+    <SheetPrimitive.Description
+      data-slot="sheet-description"
+      className={cn("text-muted-foreground text-sm", className)}
+      {...props}
+    />
+  )
+}
+
+export {
+  Sheet,
+  SheetTrigger,
+  SheetClose,
+  SheetContent,
+  SheetHeader,
+  SheetFooter,
+  SheetTitle,
+  SheetDescription,
+}
diff --git a/src/components/ui/switch.tsx b/src/components/ui/switch.tsx
new file mode 100644
index 0000000..6a2b524
--- /dev/null
+++ b/src/components/ui/switch.tsx
@@ -0,0 +1,31 @@
+"use client"
+
+import * as React from "react"
+import * as SwitchPrimitive from "@radix-ui/react-switch"
+
+import { cn } from "@/lib/utils"
+
+function Switch({
+  className,
+  ...props
+}: React.ComponentProps<typeof SwitchPrimitive.Root>) {
+  return (
+    <SwitchPrimitive.Root
+      data-slot="switch"
+      className={cn(
+        "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
+        className
+      )}
+      {...props}
+    >
+      <SwitchPrimitive.Thumb
+        data-slot="switch-thumb"
+        className={cn(
+          "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
+        )}
+      />
+    </SwitchPrimitive.Root>
+  )
+}
+
+export { Switch }


Reviews:
user: login: sourcery-ai[bot]
body: Hey @Minhchau0108 - I've reviewed your changes and they look great!

<details>
<summary>Here's what I looked at during the review</summary>

- 🟡 **General issues**: 2 issues found
- 🟢 **Security**: all looks good
- 🟢 **Testing**: all looks good
- 🟢 **Documentation**: all looks good
</details>

***

<details>
<summary>Sourcery is free for open source - if you like our reviews please consider sharing them ✨</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https://sourcery.ai)
- [Facebook](https://www.facebook.com/sharer/sharer.php?u=https://sourcery.ai)

</details>

<sub>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
</sub>
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-07T02:41:30Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 2**

<details>
<summary>🧹 Nitpick comments (7)</summary><blockquote>

<details>
<summary>src/app/(authenticated)/history/layout.tsx (1)</summary><blockquote>

`10-15`: **Consider removing redundant authentication check**

This authentication check duplicates logic already present in the parent authenticated layout. Since the parent layout already redirects unauthenticated users, this check may be unnecessary.

```diff
-  const supabase = await createClient()
-  const { data: { user } } = await supabase.auth.getUser()
-
-  if (!user) {
-    redirect('/auth/login')
-  }
```

</blockquote></details>
<details>
<summary>src/components/MobileSidebar.tsx (1)</summary><blockquote>

`9-28`: **Consider closing the sidebar when a navigation item is clicked.**

The mobile sidebar implementation looks good, but currently lacks handling for closing the sidebar after a user selects a navigation item. This can lead to a suboptimal user experience where users have to manually close the sidebar after navigation.


Consider passing a close function to the `SidebarContent` component:

```diff
- <SidebarContent pathname={pathname} />
+ <SidebarContent 
+   pathname={pathname} 
+   onNavItemClick={() => setIsOpen(false)}
+ />
```

Then update the `SidebarContent` component to use this callback when navigation items are clicked.

</blockquote></details>
<details>
<summary>src/components/NavBar.tsx (1)</summary><blockquote>

`68-68`: **Consider making the subtitle more descriptive or dynamic.**

The "View profile" subtitle is static and could be more informative or contextual.


Consider making this text dynamic based on the current page or user context:

```diff
- <p className="text-xs leading-none text-muted-foreground">View profile</p>
+ <p className="text-xs leading-none text-muted-foreground">
+   {user.user_metadata?.full_name ? user.user_metadata.full_name : "Manage your account"}
+ </p>
```

</blockquote></details>
<details>
<summary>src/app/(authenticated)/profile/page.tsx (1)</summary><blockquote>

`88-101`: **Consider providing actual activity data in the Recent Activity section.**

The "No recent activity to show" message is appropriate as a fallback, but the component should display actual activity data when available. Consider fetching and displaying real user activity data.

```diff
-<div className="text-center py-8">
-  <p className="text-muted-foreground">No recent activity to show</p>
-</div>
+{userActivities && userActivities.length > 0 ? (
+  <div className="space-y-3">
+    {userActivities.map((activity, index) => (
+      <div key={index} className="flex items-center justify-between py-2 border-b">
+        <div className="flex items-center gap-2">
+          <div className="text-muted-foreground">{activity.icon}</div>
+          <span>{activity.description}</span>
+        </div>
+        <span className="text-sm text-muted-foreground">{activity.timestamp}</span>
+      </div>
+    ))}
+  </div>
+) : (
+  <div className="text-center py-8">
+    <p className="text-muted-foreground">No recent activity to show</p>
+  </div>
+)}
```

</blockquote></details>
<details>
<summary>src/components/Sidebar.tsx (1)</summary><blockquote>

`12-23`: **Consider making sidebar items configurable through props.**

Currently, the sidebar items are hardcoded in the component. For better flexibility and reusability, consider accepting them as props with these fixed items as defaults.

```diff
-const sidebarItems: SidebarItem[] = [
+export const defaultSidebarItems: SidebarItem[] = [
  {
    title: 'Profile',
    href: '/profile',
    icon: <User className="w-5 h-5" />
  },
  {
    title: 'History',
    href: '/history',
    icon: <History className="w-5 h-5" />
  }
]

-export function SidebarContent({ pathname }: { pathname: string }) {
+export function SidebarContent({ 
+  pathname, 
+  items = defaultSidebarItems 
+}: { 
+  pathname: string,
+  items?: SidebarItem[]
+}) {
  return (
    <nav className="space-y-1">
-      {sidebarItems.map((item) => (
+      {items.map((item) => (
```

</blockquote></details>
<details>
<summary>src/app/(authenticated)/history/page.tsx (2)</summary><blockquote>

`49-58`: **Improved error state presentation.**

The error state is now displayed in a visually appealing card with appropriate styling and an alert icon. However, consider providing more specific error information to help users understand what went wrong.

```diff
<div className="max-w-4xl mx-auto">
  <Card className="border-destructive">
    <CardContent className="pt-6">
      <div className="flex items-center gap-2 text-destructive mb-2">
        <AlertCircle className="w-5 h-5" />
        <h2 className="text-xl font-semibold">Error Loading Data</h2>
      </div>
      <p className="text-muted-foreground">There was an error loading your history. Please try again later.</p>
+     {process.env.NODE_ENV === 'development' && (
+       <div className="mt-4 p-2 bg-muted/50 rounded text-xs overflow-auto">
+         <pre>{JSON.stringify({ weeksErr, subErr }, null, 2)}</pre>
+       </div>
+     )}
    </CardContent>
  </Card>
</div>
```

---

`132-147`: **Create a reusable component for metadata display.**

The metadata display pattern with icons, text, and separators is used here and likely in other places. Consider extracting this into a reusable component.

```jsx
// Example of a reusable MetadataItem component
function MetadataItem({ icon, text, separator = true }) {
  return (
    <>
      <div className="flex items-center gap-1">
        {icon}
        <span>{text}</span>
      </div>
      {separator && <span>•</span>}
    </>
  );
}

// Usage in your component
<div className="flex items-center gap-4 text-sm text-muted-foreground">
  <MetadataItem 
    icon={<Clock className="w-4 h-4" />} 
    text={`Submitted: ${new Date(submission.submitted_at).toLocaleString()}`}
  />
  <MetadataItem text={`Manager: ${submission.manager}`} />
  {submission.form_completion_time && (
    <MetadataItem 
      text={`Time to complete: ${submission.form_completion_time} min`} 
      separator={false}
    />
  )}
</div>
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between bc384804aea73d8e1b02884d2a3fc839636420d3 and eb59d580a26dfb6e42d77a790e53e352a85beffd.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`

</details>

<details>
<summary>📒 Files selected for processing (12)</summary>

* `package.json` (1 hunks)
* `src/app/(authenticated)/history/layout.tsx` (1 hunks)
* `src/app/(authenticated)/history/page.tsx` (3 hunks)
* `src/app/(authenticated)/layout.tsx` (1 hunks)
* `src/app/(authenticated)/profile/layout.tsx` (1 hunks)
* `src/app/(authenticated)/profile/page.tsx` (4 hunks)
* `src/components/MobileSidebar.tsx` (1 hunks)
* `src/components/NavBar.tsx` (4 hunks)
* `src/components/Sidebar.tsx` (1 hunks)
* `src/components/ui/label.tsx` (1 hunks)
* `src/components/ui/sheet.tsx` (1 hunks)
* `src/components/ui/switch.tsx` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (6)</summary>

<details>
<summary>src/app/(authenticated)/history/layout.tsx (1)</summary><blockquote>

<details>
<summary>src/components/Sidebar.tsx (1)</summary>

* `Sidebar` (47-61)

</details>

</blockquote></details>
<details>
<summary>src/components/NavBar.tsx (2)</summary><blockquote>

<details>
<summary>src/components/ui/dropdown-menu.tsx (4)</summary>

* `DropdownMenuLabel` (247-247)
* `DropdownMenuSeparator` (252-252)
* `DropdownMenuGroup` (246-246)
* `DropdownMenuItem` (248-248)

</details>
<details>
<summary>src/utils/actions.ts (1)</summary>

* `signOut` (6-10)

</details>

</blockquote></details>
<details>
<summary>src/components/ui/label.tsx (1)</summary><blockquote>

<details>
<summary>src/lib/utils.ts (1)</summary>

* `cn` (4-6)

</details>

</blockquote></details>
<details>
<summary>src/components/ui/switch.tsx (1)</summary><blockquote>

<details>
<summary>src/lib/utils.ts (1)</summary>

* `cn` (4-6)

</details>

</blockquote></details>
<details>
<summary>src/app/(authenticated)/profile/layout.tsx (1)</summary><blockquote>

<details>
<summary>src/components/Sidebar.tsx (1)</summary>

* `Sidebar` (47-61)

</details>

</blockquote></details>
<details>
<summary>src/components/ui/sheet.tsx (1)</summary><blockquote>

<details>
<summary>src/lib/utils.ts (1)</summary>

* `cn` (4-6)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (27)</summary><blockquote>

<details>
<summary>package.json (1)</summary>

`30-30`: **LGTM: Appropriate Radix UI dependencies added**

The addition of these Radix UI packages matches the project's existing pattern of using Radix components for accessible UI primitives.



Also applies to: 34-34

</details>
<details>
<summary>src/components/ui/sheet.tsx (3)</summary>

`1-139`: **Well-structured Sheet component implementation**

This Sheet component implementation follows best practices with proper prop forwarding, TypeScript typing, and a compositional pattern that allows flexible usage across the application.

---

`75-75`: <details>
<summary>❓ Verification inconclusive</summary>

**Verify CSS class compatibility for focus styles**

The `focus:outline-hidden` class may not be a standard Tailwind class. Consider using `focus:outline-none` instead if this was the intended behavior.

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if 'focus:outline-hidden' exists in the Tailwind configuration
grep -r "outline-hidden" . --include="*.js" --include="*.ts" --include="*.json"
# See if any other components use this class
grep -r "focus:outline-hidden" . --include="*.tsx" --include="*.jsx" --exclude="sheet.tsx"
```

Length of output: 168

---



</details>

**Verify `focus:outline-hidden` in Tailwind configuration**

It doesn’t look like `focus:outline-hidden` is a built-in Tailwind utility—if it’s not defined in your `tailwind.config.*`, you’ll want to switch to the standard `focus:outline-none` to suppress the focus outline.

• File: `src/components/ui/sheet.tsx` at line 75  
• Action: confirm whether `outline-hidden` is a custom class in your Tailwind config; if not, replace `focus:outline-hidden` with `focus:outline-none`.

---

`76-76`: <details>
<summary>❓ Verification inconclusive</summary>

**Verify Tailwind sizing utility class compatibility**

The `size-4` class is used for setting both width and height to 1rem. Ensure your Tailwind version supports this shorthand - older versions might require `w-4 h-4` instead.

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if 'size-' utility is used elsewhere in the codebase
grep -r "className=\".*size-" . --include="*.tsx" --include="*.jsx" --exclude="sheet.tsx"
# Check tailwind config for size utility
grep -r "size:" . --include="tailwind.config.*"
```

Length of output: 873

---

To confirm whether the `size-*` utilities are defined via a custom Tailwind plugin or config, let’s inspect your Tailwind configuration:

---

🏁 Script executed:

```shell
#!/bin/bash
# Locate the Tailwind config file (JS or TS)
config_file=$(find . -maxdepth 2 -type f | grep -E 'tailwind\.config\.(js|ts)$' | head -n1)
echo "Found Tailwind config at: $config_file"

# Print the first 200 lines to check for custom utilities or plugins
sed -n '1,200p' "$config_file"
```

Length of output: 222

---

Let’s locate any Tailwind config files across the entire repo and inspect them for custom `size` utilities:

---

🏁 Script executed:

```shell
#!/bin/bash
# Find all Tailwind config files in the repo
config_files=$(find . -type f -iname 'tailwind.config.*')
if [ -z "$config_files" ]; then
  echo "No Tailwind config files found."
else
  echo "Found Tailwind config files:"
  echo "$config_files"
  echo
  # Print the first 200 lines of each to check for custom utilities/plugins
  for f in $config_files; do
    echo "=== $f ==="
    sed -n '1,200p' "$f"
    echo
  done
fi
```

Length of output: 149

---



</details>

**Confirm Tailwind `size-*` utility or switch to explicit width/height**

By default Tailwind CSS doesn’t include a `size-{n}` shorthand for both width and height. Please verify you have a custom plugin or config defining `size-*`; if not, update these instances to explicit `w-{n} h-{n}` classes:

• src/components/ui/sheet.tsx (line 76):  
  `<XIcon className="size-4" />`  

• src/components/ui/dropdown-menu.tsx:  
  - `<CheckIcon className="size-4" />`  
  - `<ChevronRightIcon className="size-4" />`  

If you do have a `size-*` utility, no change is needed. Otherwise, replace each with `w-4 h-4`.

</details>
<details>
<summary>src/app/(authenticated)/layout.tsx (1)</summary>

`20-20`: **Appropriate layout adjustment for new UI structure**

Removing the centering styles is appropriate as it allows child layouts (like the new history layout) to control their own content positioning and arrangement.

</details>
<details>
<summary>src/app/(authenticated)/history/layout.tsx (1)</summary>

`1-28`: **Well-structured layout implementation with sidebar integration**

The history layout implementation properly integrates the Sidebar component and provides a good structure for the content area with appropriate overflow handling and padding.

</details>
<details>
<summary>src/components/ui/label.tsx (1)</summary>

`1-24`: **Well-implemented Label component with proper accessibility considerations.**

This new Label component is well-structured, wrapping Radix UI's label primitive with appropriate styling and accessibility features. The component properly handles:

- Form control associations via peer selectors
- Disabled states for both the label and associated form controls
- Consistent spacing and typography
- Proper prop forwarding with TypeScript typing

The implementation follows the composition pattern used throughout the codebase.

</details>
<details>
<summary>src/components/MobileSidebar.tsx (1)</summary>

`13-26`: **The Sheet implementation provides a good responsive mobile navigation experience.**

The use of the Sheet component from Radix UI with proper positioning and sizing creates an accessible mobile navigation experience. The toggle button is appropriately positioned and only visible on mobile viewports.

</details>
<details>
<summary>src/app/(authenticated)/profile/layout.tsx (1)</summary>

`17-27`: **Layout structure provides a good user experience for authenticated pages.**

The layout structure with a fixed sidebar and scrollable main content area creates a good user experience for authenticated pages. The container with appropriate padding ensures consistent spacing.

</details>
<details>
<summary>src/components/NavBar.tsx (4)</summary>

`20-25`: **Good icon imports for enhanced visual UI.**

The imported icons from lucide-react enhance the visual UI and provide consistent iconography throughout the navigation experience.

---

`42-45`: **Excellent brand link styling with appropriate transitions.**

The brand link's styling with group hover effects and transitions creates a polished user experience. The LineChart icon complements the "Weekly Pulse" text well.

---

`55-55`: **Good use of transition for button hover state.**

Adding the transition-colors class creates a smoother hover experience for the avatar button.

---

`75-76`: **Consistent icon usage improves the dropdown menu.**

The addition of icons to the dropdown menu items creates a more intuitive and visually appealing interface. The consistent sizing (h-4 w-4) and spacing (mr-2) maintain a clean look.



Also applies to: 81-82, 89-91

</details>
<details>
<summary>src/app/(authenticated)/profile/page.tsx (4)</summary>

`6-7`: **Good addition of UI components and icons.**

The imports for Button component and Lucide icons enhance the UI with interactive elements and visual cues, improving the user experience.

---

`20-20`: **Good layout improvement.**

Expanding the max-width from 2xl to 4xl provides more horizontal space for content, which is appropriate for profile pages that may contain multiple sections of information.

---

`22-32`: **Nice profile header layout enhancement.**

The horizontal flex layout with proper spacing creates a more modern and visually appealing profile header that better showcases the user's avatar and information.

---

`40-40`: **Consistent use of icons improves visual hierarchy.**

Adding icons to card titles creates visual consistency and helps users quickly identify the purpose of each section.



Also applies to: 68-68, 92-93

</details>
<details>
<summary>src/components/ui/switch.tsx (1)</summary>

`1-31`: <details>
<summary>❓ Verification inconclusive</summary>

**Well-implemented accessible Switch component.**

This component is built with accessibility in mind using Radix UI primitives. The implementation follows best practices:
- Uses proper React patterns with forwarded props
- Applies Tailwind styling with data attributes for state management
- Handles different states (checked, unchecked, focus, disabled)
- Supports dark mode with appropriate styling



Let's verify if this component is being used in the codebase:

---

🏁 Script executed:

```shell
#!/bin/bash
# Check for usage of the Switch component
rg -A 2 "<Switch" --type tsx --type jsx
```

Length of output: 69

---

To ensure we didn’t miss any usages of the new `Switch` component, let’s broaden the search without relying on ripgrep’s built-in types:

---

🏁 Script executed:

```shell
#!/bin/bash
# Recursively search all .tsx and .jsx files for the Switch component
fd -e tsx -e jsx -x rg -n '<Switch' {}
```

Length of output: 103

---



</details>

**Verify Switch component integration**

I didn’t find any external usages of the new `Switch` component in the codebase—only its internal Radix primitive tags. The implementation itself follows accessibility best practices and looks solid, but please confirm:

- Is this component intended to be wired into any page or form?
- If so, add the necessary import and usage.
- Otherwise, consider removing it or adding documentation for future use.

</details>
<details>
<summary>src/components/Sidebar.tsx (3)</summary>

`6-10`: **Good type definition for sidebar items.**

The SidebarItem type is well-defined with all necessary properties for navigation items.

---

`25-45`: **Good implementation of SidebarContent component.**

The component correctly uses conditional styling to highlight the active item and provides a clean navigation UI with icons and labels.

---

`47-61`: <details>
<summary>✅ Verification successful</summary>

**Well-structured responsive sidebar implementation.**

The separation between mobile and desktop views is handled properly. The component correctly uses the MobileSidebar for smaller screens and a fixed sidebar for desktop displays.


Let's verify the MobileSidebar implementation since it's being used here:

---

🏁 Script executed:

```shell
#!/bin/bash
# Check the implementation of MobileSidebar component
cat ./src/components/MobileSidebar.tsx 2>/dev/null || echo "MobileSidebar.tsx file not found"
```

Length of output: 847

---



</details>

**Responsive Sidebar Verified**  
Both `src/components/Sidebar.tsx` and `src/components/MobileSidebar.tsx` correctly implement responsive behavior:  
- Mobile view uses a toggleable `<Sheet>` with the shared `SidebarContent` and is hidden on `md` and up.  
- Desktop view renders a fixed sidebar only on `md` and larger screens.  

No further changes required.

</details>
<details>
<summary>src/app/(authenticated)/history/page.tsx (6)</summary>

`13-13`: **Good addition of icons for enhanced visual cues.**

The imported icons enhance the UI by providing visual context to different elements in the history page.

---

`90-90`: **Enhanced page header with improved typography.**

The page header now has a more prominent title and descriptive subtitle, creating better visual hierarchy.



Also applies to: 93-94

---

`102-118`: **Well-designed week card header with status indicators.**

The week card header now includes a calendar icon and properly displays submission status with appropriate badges, improving the visual information hierarchy.

---

`123-147`: **Excellent primary project section layout.**

The redesigned primary project section with background, proper spacing, and organized metadata creates a clear visual structure and improves readability.

---

`149-162`: **Well-structured additional projects section.**

The additional projects section is now presented in a clean grid layout with consistent styling for each project.

---

`164-206`: **Improved feedback and notes sections with responsive grid.**

The two-column grid layout for feedback and notes sections improves the use of space and creates a cleaner presentation of different types of feedback.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-07T02:42:40Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 2**

<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>

<details>
<summary>src/app/(authenticated)/profile/page.tsx (1)</summary><blockquote>

`59-62`: **Add missing handlers or navigation for profile action buttons.**

The previous review comment about missing handlers or navigation links for action buttons still applies. The "Edit Profile" button on line 59 and other buttons need onclick handlers or navigation links.



Also applies to: 82-84

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 3ece18895cee0980bdce176d3df96af3bca3b893 and 7d3196a7f377a793b1afb9d4e78925addf0c8290.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/app/(authenticated)/profile/page.tsx` (4 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (1)</summary>

<details>
<summary>src/app/(authenticated)/profile/page.tsx (3)</summary><blockquote>

<details>
<summary>src/lib/auth/user.ts (1)</summary>

* `getInitials` (1-8)

</details>
<details>
<summary>src/components/ui/avatar.tsx (2)</summary>

* `Avatar` (53-53)
* `AvatarFallback` (53-53)

</details>
<details>
<summary>src/components/ui/card.tsx (5)</summary>

* `Card` (85-85)
* `CardHeader` (86-86)
* `CardTitle` (88-88)
* `CardDescription` (90-90)
* `CardContent` (91-91)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>src/app/(authenticated)/profile/page.tsx (5)</summary>

`29-42`: **Improved responsive layout for profile header.**

The profile header now uses a responsive flex layout that adjusts based on screen size, with appropriate spacing and sizing for the avatar and email display. The `break-words` class on the email ensures long email addresses don't overflow.

---

`48-50`: **Enhanced card titles with icons for better visual hierarchy.**

The addition of icons to card titles improves visual hierarchy and makes the UI more intuitive. The `text-primary` class ensures consistent styling across the application.



Also applies to: 73-75

---

`153-159`: **Good addition of history navigation link.**

The link to view submission history provides a clear path for users to navigate to their full history, and properly uses the Next.js Link component for client-side navigation.

---

`161-170`: **Well-designed empty state with clear call to action.**

The empty state for when no submissions exist provides clear visual feedback and a helpful action for the user to submit their first pulse. The icon adds visual context and the link provides a path forward.

---

`101-114`: <details>
<summary>✅ Verification successful</summary>

**Check accessibility of status badges.**

The status badges use color combinations (blue text on blue background, red text on red background) that might have insufficient contrast for accessibility.


Could you verify the color contrast ratios meet WCAG standards? Consider using a contrast checker tool or running:

---

🌐 Web query:

```web
What is the minimum color contrast ratio required for WCAG 2.1 AA compliance?
```

💡 Result:

## Minimum Color Contrast Ratio for WCAG 2.1 AA Compliance

**Normal Text**
- The minimum color contrast ratio required is **4.5:1** between the text (or images of text) and its background[2][4][9].

**Large Text**
- For large-scale text, which is defined as at least 18pt (typically 24px) or 14pt (typically 18.66px) and bold, the minimum required contrast ratio is **3:1**[2][4][5][8][10].

**User Interface Components & Graphics**
- Non-text elements like user interface components and graphical objects must meet a contrast ratio of at least **3:1** against adjacent colors[2][4][5].

**Exceptions**
- Text or images of text that are pure decoration, part of an inactive UI component, or part of a logo/brand name, are exempt from these contrast requirements[3][4].

### Summary Table

| Content Type                           | Minimum Contrast Ratio (Level AA) |
|----------------------------------------|-----------------------------------|
| Normal text (body text, etc.)          | 4.5:1                             |
| Large text (18pt or 14pt bold+)        | 3:1                               |
| UI components & graphical objects      | 3:1                               |

These ratios help ensure sufficient readability for users, including those with moderately low vision or color deficiencies[1][4][6].

Citations:

- 1: https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html
- 2: https://webaim.org/resources/contrastchecker/
- 3: https://www.w3.org/TR/WCAG21/
- 4: https://webaim.org/articles/contrast/
- 5: https://accessibleweb.com/color-contrast-checker/
- 6: https://accessiblyapp.com/web-accessibility/color-contrast/
- 7: https://dequeuniversity.com/rules/axe/4.10/color-contrast
- 8: https://www.washington.edu/accesstech/checklist/contrast/
- 9: https://www.a11y-collective.com/glossary/colour-contrast/
- 10: https://www.accessibilitychecker.org/wcag-guides/ensure-the-contrast-between-foreground-and-background-colors-meets-wcag-2-aa-minimum-contrast-ratio-thresholds/

---



</details>

**Accessibility check: status badges meet WCAG 2.1 AA**  

I’ve verified the contrast ratios against the WCAG 2.1 AA requirements (4.5:1 for normal text):  
- Blue badge (text-blue-700 #1D4ED8 on bg-blue-100 #DBEAFE): ≈ 5.5:1  
- Red badge (text-red-700 #B91C1C on bg-red-100 #FEE2E2): ≈ 5.3:1  
- Dark-mode blue badge (text-blue-300 #93C5FD on bg-blue-900 #1E3A8A): ≈ 6.0:1  

All exceed the 4.5:1 minimum, so no changes are needed here.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-07T03:25:47Z

Review comments:
diff_hunk: @@ -0,0 +1,139 @@
+"use client"
+
+import * as React from "react"
+import * as SheetPrimitive from "@radix-ui/react-dialog"
+import { XIcon } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
+  return <SheetPrimitive.Root data-slot="sheet" {...props} />
+}
+
+function SheetTrigger({
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
+  return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
+}
+
+function SheetClose({
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Close>) {
+  return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
+}
+
+function SheetPortal({
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
+  return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
+}
+
+function SheetOverlay({
+  className,
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
+  return (
+    <SheetPrimitive.Overlay
+      data-slot="sheet-overlay"
+      className={cn(
+        "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
+        className
+      )}
+      {...props}
+    />
+  )
+}
+
+function SheetContent({
+  className,
+  children,
+  side = "right",
+  ...props
+}: React.ComponentProps<typeof SheetPrimitive.Content> & {
+  side?: "top" | "right" | "bottom" | "left"
+}) {
+  return (
+    <SheetPortal>
+      <SheetOverlay />
+      <SheetPrimitive.Content
+        data-slot="sheet-content"
+        className={cn(
+          "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
+          side === "right" &&
+            "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
+          side === "left" &&
+            "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
+          side === "top" &&
+            "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
+          side === "bottom" &&
+            "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
+          className
+        )}
+        {...props}
+      >
+        {children}
+        <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
+          <XIcon className="size-4" />
path: src/components/ui/sheet.tsx
user: login: sourcery-ai[bot]
body: **suggestion:** Use consistent Tailwind sizing classes for icons.

Replace "size-4" with "w-4 h-4" to align icon sizing with the rest of the app.

```suggestion
          <XIcon className="w-4 h-4" />
```
created_at: 2025-05-07T02:41:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,61 @@
+import Link from 'next/link'
+import { User, History } from 'lucide-react'
+import { cn } from '@/lib/utils'
+import { MobileSidebar } from './MobileSidebar'
+
+export type SidebarItem = {
+  title: string
+  href: string
+  icon: React.ReactNode
+}
+
+const sidebarItems: SidebarItem[] = [
+  {
+    title: 'Profile',
+    href: '/profile',
+    icon: <User className="w-5 h-5" />
+  },
+  {
+    title: 'History',
+    href: '/history',
+    icon: <History className="w-5 h-5" />
+  }
+]
+
+export function SidebarContent({ pathname }: { pathname: string }) {
+  return (
+    <nav className="space-y-1">
+      {sidebarItems.map((item) => (
+        <Link
+          key={item.href}
+          href={item.href}
+          className={cn(
+            "flex items-center gap-3 rounded-lg px-3 py-2 text-gray-500 transition-all hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50",
+            "hover:bg-gray-100 dark:hover:bg-gray-700",
+            "group",
+            pathname === item.href && "bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-gray-50"
+          )}
+        >
path: src/components/Sidebar.tsx
user: login: sourcery-ai[bot]
body: **suggestion:** Improve accessibility for active sidebar links.

Add an aria-current attribute to the active sidebar link to help assistive technologies identify the current page.

```suggestion
        <Link
          key={item.href}
          href={item.href}
          aria-current={pathname === item.href ? "page" : undefined}
          className={cn(
            "flex items-center gap-3 rounded-lg px-3 py-2 text-gray-500 transition-all hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50",
            "hover:bg-gray-100 dark:hover:bg-gray-700",
            "group",
            pathname === item.href && "bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-gray-50"
          )}
        >
```
created_at: 2025-05-07T02:41:30Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,28 @@
+import { createClient } from '@/utils/supabase/server'
+import { redirect } from 'next/navigation'
+import { Sidebar } from '@/components/Sidebar'
+
+export default async function ProfileLayout({
+  children,
+}: {
+  children: React.ReactNode
+}) {
+  const supabase = await createClient()
+  const { data: { user } } = await supabase.auth.getUser()
+
+  if (!user) {
+    redirect('/auth/login')
+  }
+
path: src/app/(authenticated)/profile/layout.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Add error handling and a loading state for authentication.**

The authentication flow correctly redirects unauthenticated users, but it doesn't handle potential errors from the Supabase client or provide a loading state during authentication.


Consider adding error handling and a loading state:

```diff
export default async function ProfileLayout({
  children,
}: {
  children: React.ReactNode
}) {
-  const supabase = await createClient()
-  const { data: { user } } = await supabase.auth.getUser()
+  try {
+    const supabase = await createClient()
+    const { data: { user }, error } = await supabase.auth.getUser()
+    
+    if (error) {
+      console.error('Authentication error:', error.message)
+      redirect('/auth/login?error=auth_error')
+    }
+    
+    if (!user) {
+      redirect('/auth/login')
+    }
+    
+    return (
+      <div className="flex min-h-[calc(100vh-4rem)] h-full">
+        <Sidebar pathname="/profile" />
+        {/* Main Content */}
+        <div className="flex-1 overflow-auto">
+          <div className="container mx-auto py-8 px-6">
+            {children}
+          </div>
+        </div>
+      </div>
+    )
+  } catch (error) {
+    console.error('Unexpected error:', error)
+    redirect('/auth/login?error=unexpected')
+  }
}
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
// src/app/(authenticated)/profile/layout.tsx

export default async function ProfileLayout({
  children,
}: {
  children: React.ReactNode
}) {
  try {
    const supabase = await createClient()
    const { data: { user }, error } = await supabase.auth.getUser()
    
    if (error) {
      console.error('Authentication error:', error.message)
      redirect('/auth/login?error=auth_error')
    }
    
    if (!user) {
      redirect('/auth/login')
    }
    
    return (
      <div className="flex min-h-[calc(100vh-4rem)] h-full">
        <Sidebar pathname="/profile" />
        {/* Main Content */}
        <div className="flex-1 overflow-auto">
          <div className="container mx-auto py-8 px-6">
            {children}
          </div>
        </div>
      </div>
    )
  } catch (error) {
    console.error('Unexpected error:', error)
    redirect('/auth/login?error=unexpected')
  }
}
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-07T02:42:39Z
author_association: NONE
diff_hunk: @@ -48,13 +55,17 @@ export default async function ProfilePage() {
               <label className="text-sm font-medium">Role</label>
               <p className="text-sm text-muted-foreground italic">Not set</p>
             </div>
+            <Button variant="outline" className="w-full mt-4">
+              Edit Profile
+            </Button>
path: src/app/(authenticated)/profile/page.tsx
user: login: coderabbitai[bot]
body: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**Action buttons need handlers or links.**

These buttons look good but don't have any associated click handlers or navigation links. They won't perform any action when clicked.




Also applies to: 82-84

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if there are any onClick handlers or href attributes associated with these buttons elsewhere
rg -A 3 -B 3 "Edit Profile|Update Preferences" --type tsx --type jsx
```

Length of output: 98

---

I’ll search all TSX files without restricting by type to locate the buttons and any click handlers:

---

🏁 Script executed:

```shell
#!/bin/bash
# Find where the "Edit Profile" and "Update Preferences" buttons live
rg -n "Edit Profile" -g "*.tsx"
rg -n "Update Preferences" -g "*.tsx"

# Check globally for any onClick handlers in TSX
rg -n "onClick=" -g "*.tsx"
```

Length of output: 4240

---



</details>

**Add missing handlers or navigation for profile action buttons**

The `Edit Profile` button on line 59 and the `Update Preferences` button on line 83 of  
`src/app/(authenticated)/profile/page.tsx` have no `onClick` or `href`/`Link` wrapper, so they render as non-interactive UI elements.

Please update them to include the appropriate handler or navigation. For example:

- Wrap in Next.js `<Link>` for client-side routing:
  ```diff
  - <Button variant="outline" className="w-full mt-4">
  -   Edit Profile
  - </Button>
  + <Link href="/profile/edit" passHref>
  +   <Button as="a" variant="outline" className="w-full mt-4">
  +     Edit Profile
  +   </Button>
  + </Link>
  ```

- Or add an `onClick` handler:
  ```diff
  - <Button variant="outline" className="w-full mt-4">
  -   Update Preferences
  - </Button>
  + <Button
+     variant="outline"
+     className="w-full mt-4"
+     onClick={handleUpdatePreferences}
+   >
+     Update Preferences
+   </Button>
  ```

Locations needing attention:
- src/app/(authenticated)/profile/page.tsx:59
- src/app/(authenticated)/profile/page.tsx:83

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-07T02:42:40Z
author_association: NONE
diff_hunk: @@ -3,6 +3,8 @@ import { redirect } from 'next/navigation'
 import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"
 import { Avatar, AvatarFallback } from "@/components/ui/avatar"
 import { getInitials } from '@/lib/auth/user'
+import { Settings, Bell, Clock, FileText, CalendarCheck2 } from "lucide-react"
+import Link from 'next/link'
path: src/app/(authenticated)/profile/page.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Good improvements with new imports and data fetching logic.**

The addition of Lucide icons and Next.js Link enhances the UI, while the new data fetching code properly retrieves the latest user submission. The query is well structured with appropriate filtering and ordering.

However, I recommend adding error handling for the database query.


```diff
  // Fetch latest submission
- const { data: latestSubmission } = await supabase
+ const { data: latestSubmission, error } = await supabase
    .from('submissions')
    .select('*')
    .eq('user_id', user.id)
    .order('submitted_at', { ascending: false })
    .limit(1)
    .maybeSingle()
+
+ if (error) {
+   console.error('Error fetching latest submission:', error)
+   // You could either set latestSubmission to null or handle the error in the UI
+ }
```


Also applies to: 17-24

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commit d1a6703
created_at: 2025-05-07T03:25:46Z
author_association: NONE
diff_hunk: @@ -70,6 +87,89 @@ export default async function ProfilePage() {
             </div>
           </CardContent>
         </Card>
+
+        {/* Recent Activity */}
+        <Card className="md:col-span-2">
+          <CardHeader>
path: src/app/(authenticated)/profile/page.tsx
user: login: coderabbitai[bot]
body: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**Add type safety for additional_projects data.**

While the Recent Activity card is a great addition, there's a potential type safety issue when mapping over `additional_projects`. The current implementation assumes a specific structure without validation.


```diff
- {latestSubmission.additional_projects && latestSubmission.additional_projects.length > 0 && (
+ {latestSubmission.additional_projects && 
+  Array.isArray(latestSubmission.additional_projects) && 
+  latestSubmission.additional_projects.length > 0 && (
```

Let's verify the structure of the submissions data:




Also applies to: 133-141

---

🏁 Script executed:

```shell
#!/bin/bash
# Check the structure of the submissions table and sample data
echo "Checking submissions table structure..."
rg -A 20 "additional_projects" --type ts --type tsx

echo "Looking for submission type definitions..."
rg -A 10 "type.*Submission" --type ts
```

Length of output: 303

---

Let's broaden our search to locate all occurrences of `additional_projects` and find where the `Submission` type is defined:

---

🏁 Script executed:

```shell
#!/bin/bash
echo "Searching for all references to additional_projects in the repository..."
rg additional_projects -n .

echo "Searching for Submission type or interface definitions..."
rg "type Submission" -n .
rg "interface Submission" -n .
```

Length of output: 3039

---

Let's inspect the `Submission` interface and the Recent Activity mapping in `page.tsx` for full context:

---

🏁 Script executed:

```shell
#!/bin/bash
echo "Submission interface (src/types/submission.ts):"
sed -n '1,40p' src/types/submission.ts

echo ""
echo "Recent Activity section (src/app/(authenticated)/profile/page.tsx):"
sed -n '120,160p' "src/app/(authenticated)/profile/page.tsx"
```

Length of output: 3149

---



</details>

**Fix `additional_projects` rendering to match the `Submission` interface**

There’s a mismatch between the mapped shape in `page.tsx` and the actual `Submission` type, and the runtime guard is redundant:

- The `Submission` interface (src/types/submission.ts) defines  
  `additional_projects: { project: string; hours: number }[]`  
  yet the component uses `proj.name`, masking the real property.
- Inline casting `(proj: { name: string; hours: number })` bypasses TypeScript checks.
- Because the DB and interface guarantee `additional_projects` is always an array (default `[]`), you can simplify the conditional to `additional_projects.length > 0` without `Array.isArray`.
- Also verify you’re using the correct timestamp field (`created_at` vs. `submitted_at`) as defined in your API response.

Locations to update:  
- src/app/(authenticated)/profile/page.tsx (lines 126–141)

Suggested diff:
```diff
- {latestSubmission.additional_projects && latestSubmission.additional_projects.length > 0 && (
+ {latestSubmission.additional_projects.length > 0 && (
    …
-   {latestSubmission.additional_projects.map((proj: { name: string; hours: number }, idx: number) => (
-     <span className="font-medium">{proj.name}</span>
+   {latestSubmission.additional_projects.map((proj, idx) => (
+     <span className="font-medium">{proj.project}</span>
```

Please adjust the rendering logic to use the real `project` field, remove the inline type, and drop the unnecessary `Array.isArray` check.

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-07T03:25:46Z
author_association: NONE

PR comments:
user: login: sourcery-ai[bot]
created_at: 2025-05-07T02:39:04Z
body: <!-- Generated by sourcery-ai[bot]: start review_guide -->

## Reviewer's Guide

This pull request refactors the user history and profile pages by implementing a new sidebar navigation structure using newly created Sidebar and MobileSidebar (leveraging a new Sheet component). The UI of these pages has been significantly updated with improved layouts, styling, and the integration of lucide-react icons for a more modern user experience. New UI components like Switch and Label were also added, supported by corresponding dependency updates.

#### Class Diagram for New Sheet UI Component Family

```mermaid
classDiagram
    direction LR
    class SheetPrimitive.Root
    class SheetPrimitive.Trigger
    class SheetPrimitive.Close
    class SheetPrimitive.Portal
    class SheetPrimitive.Overlay
    class SheetPrimitive.Content
    class SheetPrimitive.Title
    class SheetPrimitive.Description

    SheetPrimitive.Root <|-- Sheet
    SheetPrimitive.Trigger <|-- SheetTrigger
    SheetPrimitive.Close <|-- SheetClose
    SheetPrimitive.Portal <|-- SheetPortal
    SheetPrimitive.Overlay <|-- SheetOverlay
    SheetPrimitive.Content <|-- SheetContent
    SheetPrimitive.Title <|-- SheetTitle
    SheetPrimitive.Description <|-- SheetDescription

    class Sheet {
      +React.ComponentProps<SheetPrimitive.Root>
    }
    class SheetTrigger {
      +React.ComponentProps<SheetPrimitive.Trigger>
    }
    class SheetClose {
      +React.ComponentProps<SheetPrimitive.Close>
    }
    class SheetPortal {
      +React.ComponentProps<SheetPrimitive.Portal>
    }
    class SheetOverlay {
      +React.ComponentProps<SheetPrimitive.Overlay>
    }
    class SheetContent {
      +React.ComponentProps<SheetPrimitive.Content>
      +side: "top" | "right" | "bottom" | "left"
      +children
    }
    SheetContent o-- SheetHeader : contains
    SheetContent o-- SheetFooter : contains
    class SheetHeader {
      +div props
    }
    class SheetFooter {
      +div props
    }
    class SheetTitle {
      +React.ComponentProps<SheetPrimitive.Title>
    }
    class SheetDescription {
      +React.ComponentProps<SheetPrimitive.Description>
    }
    note for Sheet "New UI component for displaying overlay content from screen edges. Wraps Radix UI Dialog primitives."
```

#### Class Diagram for New UI Utility Components: Switch and Label

```mermaid
classDiagram
    direction LR
    class SwitchPrimitive.Root
    class SwitchPrimitive.Thumb
    SwitchPrimitive.Root <|-- Switch
    Switch *-- SwitchPrimitive.Thumb : uses
    class Switch {
      +React.ComponentProps<SwitchPrimitive.Root>
    }
    note for Switch "New UI Switch component based on Radix UI."

    class LabelPrimitive.Root
    LabelPrimitive.Root <|-- Label
    class Label {
      +React.ComponentProps<LabelPrimitive.Root>
    }
    note for Label "New UI Label component based on Radix UI."
```

### File-Level Changes

| Change | Details | Files |
| ------ | ------- | ----- |
| Implemented a new sidebar navigation system and updated page layouts for authenticated sections. | <ul><li>Created Sidebar and MobileSidebar components for consistent navigation.</li><li>Introduced dedicated layout files for /history and /profile pages, integrating the new sidebar.</li><li>Adjusted the main authenticated layout to correctly position content alongside the sidebar.</li></ul> | `src/app/(authenticated)/history/layout.tsx`<br/>`src/app/(authenticated)/profile/layout.tsx`<br/>`src/components/Sidebar.tsx`<br/>`src/components/MobileSidebar.tsx`<br/>`src/app/(authenticated)/layout.tsx` |
| Enhanced the user interface and experience on the History and Profile pages, and NavBar. | <ul><li>Redesigned the History page for improved readability of submission details and error states.</li><li>Updated the Profile page with a new layout, including a recent activity section and action buttons.</li><li>Integrated lucide-react icons throughout the History, Profile pages, and NavBar for better visual cues.</li><li>Refined the NavBar appearance with an updated logo and iconified user dropdown menu items.</li></ul> | `src/app/(authenticated)/history/page.tsx`<br/>`src/app/(authenticated)/profile/page.tsx`<br/>`src/components/NavBar.tsx` |
| Added new reusable UI components and updated project dependencies. | <ul><li>Created a new Sheet component for slide-out panel functionality (used in MobileSidebar).</li><li>Added new Switch and Label UI components based on Radix UI.</li><li>Updated package.json and pnpm-lock.yaml to include @radix-ui/react-label and @radix-ui/react-switch.</li></ul> | `src/components/ui/sheet.tsx`<br/>`src/components/ui/switch.tsx`<br/>`src/components/ui/label.tsx`<br/>`package.json`<br/>`pnpm-lock.yaml` |

---

<details>
<summary>Tips and commands</summary>

#### Interacting with Sourcery

- **Trigger a new review:** Comment `@sourcery-ai review` on the pull request.
- **Continue discussions:** Reply directly to Sourcery's review comments.
- **Generate a GitHub issue from a review comment:** Ask Sourcery to create an
  issue from a review comment by replying to it. You can also reply to a
  review comment with `@sourcery-ai issue` to create an issue from it.
- **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull
  request title to generate a title at any time. You can also comment
  `@sourcery-ai title` on the pull request to (re-)generate the title at any time.
- **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in
  the pull request body to generate a PR summary at any time exactly where you
  want it. You can also comment `@sourcery-ai summary` on the pull request to
  (re-)generate the summary at any time.
- **Generate reviewer's guide:** Comment `@sourcery-ai guide` on the pull
  request to (re-)generate the reviewer's guide at any time.
- **Resolve all Sourcery comments:** Comment `@sourcery-ai resolve` on the
  pull request to resolve all Sourcery comments. Useful if you've already
  addressed all the comments and don't want to see them anymore.
- **Dismiss all Sourcery reviews:** Comment `@sourcery-ai dismiss` on the pull
  request to dismiss all existing Sourcery reviews. Especially useful if you
  want to start fresh with a new review - don't forget to comment
  `@sourcery-ai review` to trigger a new review!

#### Customizing Your Experience

Access your [dashboard](https://app.sourcery.ai) to:
- Enable or disable review features such as the Sourcery-generated pull request
  summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.

#### Getting Help

- [Contact our support team](mailto:support@sourcery.ai) for questions or feedback.
- Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information.
- Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).

</details>

<!-- Generated by sourcery-ai[bot]: end review_guide -->
author_association: CONTRIBUTOR
user: login: vercel[bot]
created_at: 2025-05-07T02:39:05Z
body: [vc]: #l4d2HkRO/H6kUEw08aPqytVr1jAbr8PTSYMJ1KKSWj8=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJwdWxzZSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9oYXJsZXlhbGUvcHVsc2UvM2dlOEdHQVl1Q2s0dlpMN2pyZzhpelJMaFpUYyIsInByZXZpZXdVcmwiOiJwdWxzZS1naXQtZml4LXVwZGF0ZS11aS11c2VyLXBhZ2UtaGFybGV5YWxlLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoicHVsc2UtZ2l0LWZpeC11cGRhdGUtdWktdXNlci1wYWdlLWhhcmxleWFsZS52ZXJjZWwuYXBwIn0sInJvb3REaXJlY3RvcnkiOm51bGx9XX0=
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **pulse** | ✅ Ready ([Inspect](https://vercel.com/harleyale/pulse/3ge8GGAYuCk4vZL7jrg8izRLhZTc)) | [Visit Preview](https://pulse-git-fix-update-ui-user-page-harleyale.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/pulse-git-fix-update-ui-user-page-harleyale.vercel.app?via=pr-comment-feedback-link) | May 7, 2025 4:04am |


author_association: CONTRIBUTOR
user: login: coderabbitai[bot]
created_at: 2025-05-07T02:39:08Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

This update introduces new layout wrappers for authenticated history and profile pages, a reusable Sidebar component with navigation, and several new UI primitives (Label, Switch, Sheet) based on Radix UI. Multiple pages receive UI and layout enhancements, including improved use of icons and responsive design. The NavBar and profile/history pages are visually refined. Minor layout adjustments were made to the authenticated layout and the WeekFilter component's item styling.

## Changes

| File(s)                                                                                 | Change Summary |
|-----------------------------------------------------------------------------------------|----------------|
| `package.json`                                                                          | Added dependencies: `@radix-ui/react-label` (^2.1.6) and `@radix-ui/react-switch` (^1.2.4). |
| `src/app/(authenticated)/history/layout.tsx`, `src/app/(authenticated)/profile/layout.tsx` | Added new layout components (`HistoryLayout`, `ProfileLayout`) for authenticated user pages, handling Supabase authentication and sidebar/main content structure. |
| `src/app/(authenticated)/history/page.tsx`, `src/app/(authenticated)/profile/page.tsx`   | Refined UI, layout, and styling for history and profile pages; added icons, improved containers, and a new "Recent Activity" card in profile. No logic changes. |
| `src/app/(authenticated)/layout.tsx`                                                    | Removed flexbox centering from `<main>`, altering content alignment for authenticated layout. |
| `src/components/NavBar.tsx`                                                             | Enhanced with lucide-react icons, improved dropdown styling, and a new subtitle in the user menu. |
| `src/components/Sidebar.tsx`                                                            | Introduced a new Sidebar component with navigation items, icons, and pathname-based highlighting. |
| `src/components/ui/label.tsx`                                                           | Added new `Label` component wrapping Radix UI label with custom styling. |
| `src/components/ui/switch.tsx`                                                          | Added new `Switch` component wrapping Radix UI switch with custom styling and state handling. |
| `src/components/ui/sheet.tsx`                                                           | Added new `Sheet` UI component set (Sheet, Overlay, Content, etc.) based on Radix dialog primitives, with slide-in panels and composable structure. |
| `src/components/WeekFilter.tsx`                                                         | Added hover, focus, and checked state styling classes to `SelectItem` components for improved visual feedback. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant Layout (History/Profile)
    participant Supabase
    participant Sidebar
    participant MainContent

    User->>Layout (History/Profile): Access page
    Layout (History/Profile)->>Supabase: Get current user
    alt User authenticated
        Layout (History/Profile)->>Sidebar: Render with current pathname
        Layout (History/Profile)->>MainContent: Render children
    else No user
        Layout (History/Profile)->>User: Redirect to /auth/login
    end
```

## Poem

> In the warren of code, new paths unfurl,  
> With sidebars and sheets in a UI swirl.  
> Switches and labels, all shiny and neat,  
> History and profile now dressed so sweet.  
> Icons hop in, bringing visual cheer—  
> A rabbit’s delight: fresh features appear!  
> 🐇✨

<!-- walkthrough_end -->
<!-- This is an auto-generated comment: all tool run failures by coderabbit.ai -->

> [!WARNING]
> There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
> 
> <details>
> <summary>🔧 ESLint</summary>
> 
> > If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
> 
> <details>
> <summary>src/app/(authenticated)/profile/page.tsx</summary>
> 
> 
> Oops! Something went wrong! :(
> 
> ESLint: 9.25.1
> 
> ESLint couldn't find the plugin "@next/eslint-plugin-next".
> 
> (The package "@next/eslint-plugin-next" was not found when loaded as a Node module from the directory "".)
> 
> It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
> 
>     npm install @next/eslint-plugin-next@latest --save-dev
> 
> The plugin "@next/eslint-plugin-next" was referenced from the config file in " » eslint-config-next/core-web-vitals » /node_modules/.pnpm/eslint-config-next@15.3.1_eslint@9.25.1_jiti@2.4.2__typescript@5.8.3/node_modules/eslint-config-next/index.js".
> 
> If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
> 
> 
> </details>
> 
> </details>

<!-- end of auto-generated comment: all tool run failures by coderabbit.ai -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 7d3196a7f377a793b1afb9d4e78925addf0c8290 and d1a670321de03f95b0ca1d9a44250a23d1041339.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/app/(authenticated)/profile/page.tsx` (4 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* src/app/(authenticated)/profile/page.tsx

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAM3gADy5sblpqD2xESh40UkRoyDlITOyAWXgMWAZYNGwABgBGOoAOSAAKW0gMRwFsgFY6gEpIWPwGEuR8LH9YtDF8CgqidAx6eGZefAklsNgMrL5uXOkAGntuUXh4hjQfeVw9yAREAhcV+k34yJy8s4JIMg1DAMDwPfbZCo0CizEFnLxoWT4PBnTD0LbKHzFA4AhIXRZkEEaSAAaRI8nIAHcRiRqNh/MhIRRFNgQWtgV5sEp0JBmIJ4N9EPAlAJnCMFl00NsiNR4FM/o80LRaOpZVh8LEUEwMMh/utNlJINsHLcnvBlBRqrIUaseQsPEpcNpIvQbhR6PDEXhEET3ADKpgQWwMLgGRgJPgvAb/EpBUQMDswaaXgt5KieEyvh4jnlIBT1LBbf57LgKCzcHSommjdhbl5U9wLrcdh6kSGUUqdoLhaKMJL4NLxFMxXxamDg/AbjQPsdEGc9UzthhlpQmXwgbQvDsq0ga75YiQ6CKGABra30QEBnb07hTQUGmP9jBEgCCHcHvbu8oyqXSKHZnOkRhYDtZAHGqdBkBSNJxCXHIT2OSAlAuVYCTNZA038BZpXjAAvHZsw8FsvR9R5Om0ZgdXwdMtiFDw0ELcEKDAWJ8VWOt3kNHda3kLVBRedgcTxM1gTohgmUQSCDjAfx4SnH5pA0cwLEgABRBIkBg5ZBBEMRJEAhwnDef5emKH8pzcdRIi4eIklM6DGPk5BIAMAA5HpKC4AZIGcgBVA4uHKSpqlqRoWiMfRjHAKAyDRDVR0IUhyCoOSmFY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ulGAC4JARGRFAMAVQ/QsUOqAlAgnNQ0owYLgFQE6g+dXUCgAaCoDUDDQyoY0TOVFFXhDcAA+kKEQBNz/AypAGLQCbkKtk4o0caFnPsR9AAAnLQD6DNA6gaADmLzFoCxABAvMEgGrA5i0AAA7CvLQArzh5dQEgH0AADMJAXeX0A5hoBmgfQXoNg3oDlQG5fQGkAfOaC8w55w8p+RzA5gryBAdQOoAwFiBPy1Yh83ebEBXmxA6gZ8gQM0DVhNA1YasFef3PrkQBIA+8kEA0GaDNBh5fQEECQDqDDyJ5AgWgIgpXkzzd5s84ebzDQCxBd5AgG4OQpQW7yYFWclebQF3kNBiFG8shWvI3nDzyFDQUhQIFHlqwSAK8lBRzD6DfkgFDAZoBzC3m0KG5tALhbzBXl1Bd5HMBoEoAUXfyz5n8tAMouHloBIFQiyeRzEIUQKGgu83ecPJgWwKoAqUZua3PbmojfGdAJuTFH7lAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=CoderPush/pulse&utm_content=50):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE