feat: add "no conflict with schedule" filter to catalog#1145
Conversation
Adds a new filter option that allows users to select one of their schedules and filter out catalog classes that conflict with non-hidden items in that schedule. - Extract conflict detection utilities to lib/schedule/conflict.ts - Add ScheduleConflictFilter component (only shown when logged in) - Add meetings field to catalog search query for conflict detection - Filter classes client-side based on schedule conflicts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Linting FailedNote: The status check will always pass. Run Click to expand lint output |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8384c6afd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| page: queryResult.page, | ||
| pageSize: queryResult.pageSize, | ||
| hasNextPage: queryResult.hasNextPage, | ||
| hasNextPage: selectedSchedule ? false : queryResult.hasNextPage, |
There was a problem hiding this comment.
Keep pagination enabled when conflict filter is active
In useCatalogBrowser, setting hasNextPage to false whenever a schedule is selected stops List from calling loadNextPage, so conflict filtering only runs on the first page of catalog results (25 classes) and silently drops all later matches. This makes the "No Conflict With Schedule" results incomplete for any query with more than one page, including the common case where the selected schedule has no meetings (which should return all classes).
Useful? React with 👍 / 👎.
| const selectedSchedule = useMemo(() => { | ||
| if (!filterState.scheduleConflictFilter || !schedules) return null; | ||
| return ( | ||
| schedules.find((s) => s?._id === filterState.scheduleConflictFilter) ?? |
There was a problem hiding this comment.
Restrict selected schedule to the current term
The selected schedule lookup only matches by _id and ignores year/semester, so after a user switches catalog term, a previously selected schedule from another term can remain active and still filter results. Because ScheduleConflictFilter hides itself when there are no schedules in the new term, this leaves an effectively hidden cross-term filter that users cannot adjust from the control.
Useful? React with 👍 / 👎.
- Keep pagination working when schedule filter is active so all pages can be loaded and filtered (not just first 25 classes) - Validate selected schedule matches current term (year + semester) to prevent hidden cross-term filtering when switching catalog terms Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Linting FailedNote: The status check will always pass. Run Click to expand lint output |
Adds a new filter option that allows users to select one of their schedules and filter out catalog classes that conflict with non-hidden items in that schedule.