Skip to content

feat(dashboard): drive learning progress from fetched data - #1126

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
OkeA-dev:feat/dashboard-learning-progress
Aug 1, 2026
Merged

feat(dashboard): drive learning progress from fetched data#1126
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
OkeA-dev:feat/dashboard-learning-progress

Conversation

@OkeA-dev

Copy link
Copy Markdown
Contributor

Summary

Closes #937

Replaces the hardcoded learning-progress courses in src/app/dashboard/page.tsx with a self-contained LearningProgressList component that renders data fetched from a new GET /api/user/learning-progress endpoint, backed by the course catalog. The dashboard static shell now simply mounts the fetched-data component.

Changes

  • API: GET /api/user/learning-progress returns in-progress courses (progress > 0) from getAllCourses() as LearningProgressItem[] (edge runtime, rate limited, logged).
  • Schema/type: added LearningProgressItemSchema + LearningProgressItem in src/schemas/progress.schema.ts, re-exported from src/types/api.ts.
  • Hook: useLearningProgress (src/hooks/useLearningProgress.ts) fetches via apiClient and exposes { items, isLoading, error, refetch }.
  • Component: LearningProgressList (src/app/components/dashboard/LearningProgressList.tsx) handles loading skeleton, error + retry, empty state, and the progress list with accent-colored borders/bars.
  • Dashboard page: now renders <LearningProgressList /> instead of the hardcoded JSX.
  • i18n: added common.retry and dashboard.noCoursesInProgress to en/es/ar.
  • Tests: route, hook, and component tests (13 total) following existing repo conventions.

Verification

  • pnpm vitest run for the 3 new test files: 13/13 passing
  • pnpm lint (next lint --max-warnings=0): clean
  • node scripts/check-locales.mjs and check-i18n.cjs: clean

Replace the hardcoded learning-progress courses on the dashboard with data
fetched from a new /api/user/learning-progress endpoint backed by the
course catalog.

- Add LearningProgressItem schema + type
- Add GET /api/user/learning-progress returning in-progress courses
- Add useLearningProgress hook
- Add LearningProgressList component with loading/error/empty/retry states
- Update dashboard page to render LearningProgressList
- Add i18n keys (common.retry, dashboard.noCoursesInProgress) in en/es/ar
- Add route, hook, and component tests

Closes rinafcode#937
@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@OkeA-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@OkeA-dev

Copy link
Copy Markdown
Contributor Author

@rinafcode Hi! This PR is ready for review — it resolves issue #937 by driving the dashboard's learning progress from fetched data instead of hardcoded JSX.

What changed

  • Added GET /api/user/learning-progress endpoint returning in-progress courses from the course catalog
  • Added useLearningProgress hook and LearningProgressList component (loading skeleton, error + retry, empty, and data states)
  • Updated src/app/dashboard/page.tsx to render <LearningProgressList /> instead of the hardcoded progress courses
  • Added i18n keys (common.retry, dashboard.noCoursesInProgress) in en/es/ar

Verification

  • 13/13 new tests passing (route + hook + component)
  • next lint --max-warnings=0 clean
  • locale checks (check-locales.mjs, check-i18n.cjs) clean

Please review and merge when you get a chance. Thanks! 🙌

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 4a86f2b into rinafcode:main Aug 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drive dashboard learning progress from fetched data instead of hardcoded JSX

2 participants