Page: Student Dashboard
Code: SDSH Route: /dashboard/learning Access: Authenticated Priority: P0 Test Script: scripts/page-tests/test-SDSH.sh Components: src/components/dashboard/StudentDashboard.tsx
Purpose
Central hub for students to track their enrolled courses, upcoming sessions, learning progress, and quickly access key actions.
Connections
Incoming (users arrive from)
| Source | Trigger | Notes |
| LGIN | Successful login (Student role) | Default post-login destination |
| SGUP | Successful signup | After onboarding |
| Nav | "Dashboard" link | Global navigation |
| SROM | "Back to Dashboard" | After session ends |
| CCNT | "Dashboard" link | From course content |
| Any page | Logo click (logged in) | May go to dashboard |
Outgoing (users navigate to)
| Target | Trigger | Notes |
| CCNT | "Continue Learning" on course card | Resume course content |
| SBOK | "Book Session" / "Schedule" | Book next session |
| SROM | "Join Session" | Active session join |
| CDET | Course title click | View course details |
| FEED | "Community" nav | Go to feed |
| CBRO | "Browse Courses" | Find new courses |
| PROF | "Settings" nav | Edit profile/settings |
| STPR | "Your Teacher" link | View assigned ST |
| NOTF | Notification bell | View all notifications |
Data Requirements
| Entity | Fields Used | Purpose |
| enrollments | id, course_id, student_teacher_id, status, enrolled_at | Enrolled courses list |
| courses | id, title, thumbnail, slug | Course display |
| module_progress | enrollment_id, is_complete | Progress calculation |
| course_curriculum | id, course_id | Total modules for progress |
| users (ST) | name, avatar | Assigned teacher display |
Sections
Header Bar
- • Page title
- • Notification bell (visual only)
- • User menu
My Courses (Enrolled)
- • Grid of enrolled courses
- • Each course card:
- • - Thumbnail
- • - Title
- • - Progress bar (% complete)
- • - Creator name
- • - Assigned ST (if any)
- • - "Continue" / "Review" button
- • - "Book Session" button (if in progress)
- • Empty state: "You haven't enrolled in any courses. [Browse courses]"
User Stories Fulfilled
- • US-S009
- • US-P003
- • US-P060
States & Variations
| State | Description |
| New User | No courses, prominent "Browse Courses" CTA |
| Active Student | Courses in progress |
| Loading | Skeleton cards while fetching |
| Error | Error message with retry button |
Mobile Considerations
- • Course cards stack vertically
- • Bottom navigation bar
- • Full-width action buttons
Error Handling
| Error | Display |
| Data load fails | "Unable to load dashboard. [Retry]" |
Analytics Events
| Event | Trigger | Data |
page_view | Page load | courses_count |
continue_learning | Continue clicked | course_id, progress_pct |
book_session | Book clicked | course_id |
browse_courses | Browse clicked | from_empty_state |
Notes
- • Requires authentication
- • Progress calculated from module_progress table
- • Links to course learning page
- • D1 REST API fallback working on MBA-2017
- • Multi-role users: Dashboard adapts (see TDSH)
Features
Course Display
- ✓
Enrolled courses grid [US-S009]
- ✓
Progress bars (% complete) [US-P003]
- ✓
Continue learning CTA [US-S009]
- ✓
Status grouping (in progress, completed) [US-P003]
- ✓
Empty state (no enrollments) [US-S009]
Sessions (Pending)
- ○
Upcoming sessions list [US-P060] Deferred
- ○
Join session button (active if within 15 min) [US-P060] Deferred
- ○
Session countdown [US-P060] Deferred
- ○
Reschedule link [US-P060] Deferred
Additional Features (Pending)
- ○
Greeting with user name [US-S009] Deferred
- ○
Notification bell with unread count [US-S009] Visual only
- ○
Quick stats (courses, sessions) [US-S009] Deferred
- ○
Recent activity timeline [US-S009] Deferred
- ○
Certificates & achievements grid [US-S009] Deferred
- ✓
Assigned ST display [US-P003] Shown in course cards
Interactive Elements
Buttons: 1/1 active
Links: 11/11 active
Buttons
| Element | Component | Action | Status |
| Retry button | StudentDashboard | Retries API fetch | active |
Links
Empty State
| Element | Target | Status |
| "Browse Courses" | /courses | active |
Enrollment Cards
| Element | Target | Status |
| "Continue" button | /courses/{slug}/learn | active |
| "Review" button (completed) | /courses/{slug}/learn | active |
| "Book Session" button | /courses/{slug}/book | active |
Sidebar (via AppLayout)
| Element | Target | Status |
| Dashboard | /dashboard/learning | active |
| My Courses | /dashboard/courses | active |
| Sessions | /dashboard/sessions | active |
| Community | /dashboard/community | active |
| Settings | /settings | active |
Target Pages Status
| Target | Page Code | Status |
/ | HOME | Implemented |
/courses | CBRO | Implemented |
/courses/{slug}/learn | CCNT | Implemented |
/courses/{slug}/book | SBOK | PageSpecView |
/settings | SETT | PageSpecView |
Verification Notes
Verified: 2026-01-07 Consolidated: 2026-01-08
Verified Components
- ✓
src/components/dashboard/StudentDashboard.tsx - ✓
src/pages/dashboard/learning/index.astro
Screenshots
- 📷
SDSH-2026-01-07-06-47-19.png - Student dashboard with error state (before D1 fix) - 📷
SDSH-2026-01-07-06-56-25.png - Student dashboard empty state (D1 REST working)
Notes
- • Core enrollment/progress functionality complete
- • Shows loading skeleton, error, empty, and populated states
- • Error state has "Retry" button
- • Enrollment cards show progress bars, creator, and ST info
- • "Book Session" only shows for in-progress courses
- • Notification bell visual only (red dot visible)
- • D1 REST API fallback working on MBA-2017
Test Coverage
Component ✓
Page ○
SSR ○
API 1/1
✓ Ready
Script: scripts/page-tests/test-SDSH.sh
Page Test: tests/pages/dashboard/learning/index.test.tsx ○
Component Test: tests/pages/dashboard/StudentDashboard.test.tsx ✓
API Tests
| Endpoint | Test File | Status |
GET /api/me/enrollments | tests/api/me/enrollments.test.ts | ✓ tested |
Discrepancies (Spec vs Implementation)
As of 2026-01-08
Planned but Not Implemented
| Feature | Original Spec | Status | Priority |
| Greeting with user name | "Welcome back, [Name]!" | Deferred | Low |
| Notification bell functionality | Clickable with unread count, links to NOTF | Partial - visual only with dot | Medium |
| Quick stats | X courses, Y upcoming sessions | Deferred | Low |
| Upcoming sessions list | Next 3 sessions with join/reschedule | Deferred | Medium |
| Recent activity timeline | Last 5-10 activity items | Deferred | Low |
| Certificates section | Grid of earned certificates | Deferred | Low |
| Analytics events | 4 events (page_view, continue_learning, book_session, browse_courses) | Not implemented | Low |