feat(dashboard): drive learning progress from fetched data - #1126
Merged
RUKAYAT-CODER merged 1 commit intoAug 1, 2026
Merged
Conversation
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
|
@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! 🚀 |
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
Verification
Please review and merge when you get a chance. Thanks! 🙌 |
Contributor
|
Thank you for contributing to the project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #937
Replaces the hardcoded learning-progress courses in
src/app/dashboard/page.tsxwith a self-containedLearningProgressListcomponent that renders data fetched from a new GET/api/user/learning-progressendpoint, backed by the course catalog. The dashboard static shell now simply mounts the fetched-data component.Changes
GET /api/user/learning-progressreturns in-progress courses (progress > 0) fromgetAllCourses()asLearningProgressItem[](edge runtime, rate limited, logged).LearningProgressItemSchema+LearningProgressIteminsrc/schemas/progress.schema.ts, re-exported fromsrc/types/api.ts.useLearningProgress(src/hooks/useLearningProgress.ts) fetches viaapiClientand exposes{ items, isLoading, error, refetch }.LearningProgressList(src/app/components/dashboard/LearningProgressList.tsx) handles loading skeleton, error + retry, empty state, and the progress list with accent-colored borders/bars.<LearningProgressList />instead of the hardcoded JSX.common.retryanddashboard.noCoursesInProgressto en/es/ar.Verification
pnpm vitest runfor the 3 new test files: 13/13 passingpnpm lint(next lint --max-warnings=0): cleannode scripts/check-locales.mjsandcheck-i18n.cjs: clean