Skip to content

Conversation

@kaiyangzheng
Copy link
Contributor

REBASED ON MAIN

Summary
- Implements the Add Courses modal on the catalog page with full course selection functionality.

Changes
- New AddCoursesModal component with two-column layout
- Real-time course search via /api/search endpoint
- 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

0FCC8BE5-4157-4198-84D9-8260A10C710B

@vercel
Copy link

vercel bot commented Dec 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
searchneu Ready Ready Preview Comment Dec 7, 2025 3:59am

ItsEricSun and others added 7 commits December 6, 2025 21:20
- 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
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" />
Copy link
Contributor

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" />
Copy link
Contributor

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 && (
Copy link
Contributor

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.

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.

4 participants