Skip to content

feat: add filters to search results page#1588

Open
calebwongg wants to merge 24 commits intomainfrom
cwong/search-results-filter
Open

feat: add filters to search results page#1588
calebwongg wants to merge 24 commits intomainfrom
cwong/search-results-filter

Conversation

@calebwongg
Copy link
Copy Markdown
Contributor

@calebwongg calebwongg commented Apr 7, 2026

Summary

Add filters for each displayed course on the search results page. Filtering option persists across searches, but not across sessions

image image

Test Plan

  • Check each filtering option and ensure that classes are sorted accordingly
  • Check filtering methods across multiple searches

Issues

Closes #937

@alexespejo
Copy link
Copy Markdown
Collaborator

I know this is still a draft but I don't think I see the purpose of sorting the individual class sections (granted I've only had to enroll in upper div cs classes). I can see another button being added to that top row where we can filter the classes against each other. Mb if this is redundant from a design discussion

image

@calebwongg calebwongg marked this pull request as ready for review April 14, 2026 08:03
@calebwongg
Copy link
Copy Markdown
Contributor Author

@cubic hi

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 14, 2026

@cubic hi

@calebwongg Hi! I'm cubic. Here's how I can help with your PR:

Ask questions

  • @cubic why did you suggest this change?

Request reviews

  • @cubic review this - Run a code review

Give feedback

  • @cubic this suggestion doesn't work for our use case

Request fixes

  • @cubic fix this - Ask me to fix an issue. I can push commits to this PR or open a new PR; tell me which you want.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 14, 2026

@cubic

@calebwongg I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Comment thread apps/antalmanac/src/stores/SectionFilterStore.ts
Comment thread apps/antalmanac/src/stores/SectionFilterStore.ts Outdated
Copy link
Copy Markdown
Collaborator

@alexespejo alexespejo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor Author

@cubic

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 21, 2026

@cubic

@calebwongg I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

@alexespejo
Copy link
Copy Markdown
Collaborator

how's progress here

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx Outdated
Comment thread apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

Add way to add filters from search results page

2 participants