-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FLOW-23] Enable Professor Reviews to Select From All Professors #189
Conversation
2. Rebuilt dropdown widget to use virtualized view + fuzzy sort - Removed custom scrollbars in favour of react-window to support viewing 3k+ prof entries
width = 'fit-content', | ||
width = 150, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this break other dropdowns? Should we keep width fit-content and just set minWidth in addition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was really sad - I had to manually check each of the dropdown since for some reason react-window doesn't support the min-width
attribute which is such a random shortcoming. I'll see if I can override the CSS manually, but odds are we might have to go with this one
@@ -80,6 +80,7 @@ const ProfileDropdown = () => { | |||
</Query> | |||
<DropdownList | |||
selectedIndex={-1} | |||
width={130} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May not need this if we keep fit-content
and set minWidth instead for the other dropdowns?
demo.mp4
Funny enough, this was far less trivial of a change than I anticipated. Basically, after loading all professors into the original dropdown widget, I would get this insane lag that would render the course review essentially unusable.
With the profiler, one character key-input would take 270% longer after loading the ~3,000 professor names in the dropdown, shown below. To fix this, I rewrote the
src/components/input/DropdownList.tsx
component to use a virtualized view usingreact-window
plus using our existingfuzzy-sort
library which made it much smoother.This pull request includes multiple changes to the
package.json
file and various components to improve the functionality and performance of the application. The most important changes include updating dependencies, modifying theCourseReviewBox
component to handle a new query, and enhancing theDropdownList
component.Dependency Updates:
@types/react-window
andreact-window
dependencies topackage.json
. [1] [2]react-custom-scrollbars
and its types frompackage.json
. [1] [2]CourseReviewBox Component Enhancements:
ONLY_PROF_QUERY
inCourseReviewBox.tsx
to fetch all professors.allProfs
prop toCourseReviewBoxContent
and utilized it for professor selection. [1] [2] [3]DropdownList
options to include all professors and adjusted the selection logic. [1] [2]CourseReviewBox
component. [1] [2]DropdownList Component Enhancements:
react-custom-scrollbars
withreact-window
for better performance inDropdownList.tsx
.DropdownList
to use a fixed width and improved the filtering and rendering of options. [1] [2] [3] [4] [5] [6]ProfileDropdown Component:
DropdownList
inProfileDropdown.tsx
.GraphQL Query Updates:
ONLY_PROF_QUERY
to fetch all professors inProf.tsx
.