-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add course selection modal to catalog page #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add AddCoursesModal component with search, virtualization, and deferred values - Convert catalog page to server component - Add term name fetching on server - Integrate modal into scheduler FilterPanel - Add CourseSearchResult type to lib/types - Improve modal UI with card-based design and better states
- Modal now separates locked and unlocked courses when generating - Pass locked course keys from server to display correct lock state - CourseBox displays lock icon based on actual locked state (read-only) - Update modal to pass both locked and optional course IDs separately
- Modal now keeps selected courses when generating schedules - Users can adjust their selection and regenerate without re-selecting - Added initialSelectedCourses and onSelectedCoursesChange props - FilterPanel manages the selected courses state
- Modal now closes after generating schedules - Remove state syncing that caused setState during render - Selected courses persist within same session
24a0849 to
a121e1d
Compare
57ddeec to
9be6b4d
Compare
| className="text-muted-foreground hover:bg-muted hover:text-foreground rounded p-1.5 transition-colors" | ||
| title="Course info" | ||
| > | ||
| <Info className="h-4 w-4" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this info button do anything right now?
| title={course.isLocked ? "Unlock course" : "Lock course"} | ||
| > | ||
| {course.isLocked ? ( | ||
| <Lock className="h-4 w-4" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this lock should turn red when its locked like how it is in the sidebar.
| </div> | ||
|
|
||
| {/* Child Courses (Recitations/Labs) */} | ||
| {course.children.length > 0 && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually do anything right now, looking at the frontend I dont think I see any child courses.
REBASED ON MAIN
Summary
- Implements the Add Courses modal on the catalog page with full course selection functionality.
Changes
- New
AddCoursesModalcomponent with two-column layout- Real-time course search via
/api/searchendpoint- Course selection (add/remove, max 10 courses)
- Lock/unlock toggle for selected courses
- Generate schedules button (navigates to scheduler page)
- Term display name conversion (shows "Spring 2026" instead of "202630")
- Loading states and error handling
- Backend API integration with debounced search
Testing
- [x] Modal opens from catalog page
- [x] Course search works with real API data
- [x] Add/remove courses functionality
- [x] Lock/unlock toggle works
- [x] Generate schedules navigates correctly
- [x] Term display name shows correctly
Future Work (not in this PR)
- Campus filtering (placeholder implemented)
- Child sections (recitations/labs)
- Info button functionality