Skip to content
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

Enhancing Course Search #105

Open
lab596 opened this issue Nov 15, 2023 · 5 comments
Open

Enhancing Course Search #105

lab596 opened this issue Nov 15, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@lab596
Copy link
Contributor

lab596 commented Nov 15, 2023

Hey, I noticed that if you search for a specific course without a space in between the number and the course it provides a no results page. Can we have it so either no space in between the department or a space in between provide the same results?

Is something like this possible?

@lab596
Copy link
Contributor Author

lab596 commented Nov 15, 2023

Also a minor quality of life update that may be nice is if when you use the back button or redirect to homescreen utilizing the poly logo it keeps the search type to Course or remembers what your last search type was instead of auto directing to Professor search. Even better would be if 2 different search bars weren't required and a users search could be parsed and identified as a course or professor name.

@AddisonTustin
Copy link
Collaborator

As far as the first problem goes, it could be as simple as using a regex—like ([a-zA-Z]+)(\d+)—to determine if it's an unbroken string of alphas then numerics. Then just adding a space between the two capture groups before search?

Trying to dynamically determine whether to search by professor name or course probably wouldn't be too difficult either, but there's probably some non-trivial React-ing that needs to happen to save the search state between page navigations to/from the homepage and search page. I'd defer to @mfish33 or @cjlawson02 on the level of effort though..

@AddisonTustin AddisonTustin added the enhancement New feature or request label Nov 18, 2023
@lab596
Copy link
Contributor Author

lab596 commented Nov 19, 2023

I see, for now I would like to look into the regex implementation. Could you point me in the direction of where the searchbar input is parsed?

@mfish33
Copy link
Collaborator

mfish33 commented Nov 20, 2023

Hi @lab596, thank you for the bug report. I just opened a PR #111 to fix the second issue. It was not directly related to the state being saved but was a great opportunity to fix some poorly written code that has been around since the beginning of the site. The code used to filter options for the user resides in two places.

utils/ProfessorSearch.ts - where search results are filtered on the professor page
components/SearchBar.tsx:autoCompleteFilter - auto-complete suggestions for course searches

I like the improvement around courses showing up with or without the space included but I am unsure about combining course and name suggestions to the user. Without clear UI/UX I think that this could easily get confusing

@lab596
Copy link
Contributor Author

lab596 commented Nov 20, 2023

Ok that makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants