feat: add filters to search results page#1588
Conversation
|
@cubic hi |
@calebwongg Hi! I'm cubic. Here's how I can help with your PR: Ask questions
Request reviews
Give feedback
Request fixes
|
…/search-results-filter
|
@calebwongg I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 5 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBody.tsx">
<violation number="1" location="apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBody.tsx:72">
P2: Handle GPA fetch failures in the `Promise.all` chain; one rejected request currently causes an unhandled rejection and aborts all GPA updates.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
@calebwongg I have started the AI code review. It will take a few minutes to complete. |
|
how's progress here |
There was a problem hiding this comment.
2 issues found across 4 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx">
<violation number="1" location="apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx:504">
P1: GPA sorting performs per-instructor live grade queries (`cacheOnly=false`) in a large loop, which can trigger excessive API traffic.</violation>
<violation number="2" location="apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx:505">
P2: The GPA mapping check uses truthiness, so a valid `averageGPA` of `0` is incorrectly discarded.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx">
<violation number="1" location="apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx:504">
P2: Using `cacheOnly=true` disables GPA fetch fallback and can leave GPA sorting incomplete when cache entries are missing.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
| if (requested.has(key)) continue; | ||
| requested.add(key); | ||
| tasks.push( | ||
| Grades.queryGrades(course.deptCode, course.courseNumber, instructor, true) |
There was a problem hiding this comment.
P2: Using cacheOnly=true disables GPA fetch fallback and can leave GPA sorting incomplete when cache entries are missing.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx, line 504:
<comment>Using `cacheOnly=true` disables GPA fetch fallback and can leave GPA sorting incomplete when cache entries are missing.</comment>
<file context>
@@ -491,18 +491,18 @@ export default function CourseRenderPane(props: { id?: number }) {
tasks.push(
- Grades.queryGrades(course.deptCode, course.courseNumber, instructor, false)
- .then((grades) => (grades?.averageGPA ? { key, gpa: grades.averageGPA } : null))
+ Grades.queryGrades(course.deptCode, course.courseNumber, instructor, true)
+ .then((grades) => (grades?.averageGPA != null ? { key, gpa: grades.averageGPA } : null))
.catch(() => null)
</file context>
| Grades.queryGrades(course.deptCode, course.courseNumber, instructor, true) | |
| Grades.queryGrades(course.deptCode, course.courseNumber, instructor, false) |
Tip: Review your code locally with the cubic CLI to iterate faster.
There was a problem hiding this comment.
everything displayed in the search pane should already be in the cache? because theres no way that classes can get added without requerying?
@alexespejo not sure if im misinterpreting me know your thoughts on this please :D

Summary
Add filters for each displayed course on the search results page. Filtering option persists across searches, but not across sessions
Test Plan
Issues
Closes #937