-
Notifications
You must be signed in to change notification settings - Fork 11
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
Sort by semester #537
Sort by semester #537
Conversation
@zachary0kent You need to fix the merge conflict with the latest master to make all CI jobs run. |
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.
This looks really good! The menu works great, and semester toggle buttons and re-ordering both seem to work great! Also tested editing semesters to ensure order is properly sorted when sorted by newest and oldest.
Left a bunch of comments, just about some code cleanup things and some bugs! I also have two misc comments...
- Is the view button supposed to open the menu on hover, or on click? Not sure what the designs intended, but the hover seems a little strange to me.
- Do you think compact/non-compact should persistent like semester order does to be consistent?
toggleCompact(toggled: boolean) { | ||
if (toggled !== this.compact) { | ||
this.$emit('compact-updated', toggled); | ||
GTagEvent(this.$gtag, toggled ? 'to-compact' : 'to-not-compact'); |
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.
Thanks for preserving this!
There's some weird activity on mobile where the dropdown doesn't always open when you click on it. I agree with @willespencer that the dropdown should show up when you click on it instead of hovering since you can't hover on mobile. Screen.Recording.2021-10-07.at.6.56.14.PM.mov |
You can look at the |
Visit the preview URL for this PR (updated for commit 9d9c91e): https://cornelldti-courseplan-dev--pr537-sort-by-semester-hclt3wcn.web.app (expires Fri, 29 Oct 2021 20:47:38 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
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.
The merge resolutions look good! Thanks for putting so much work into this PR. It's really impressive how you picked up what was going on with Vuex.
I left some more comments on the code
setSemesters(state: VuexStoreState, semesters: readonly FirestoreSemester[]) { | ||
state.semesters = semesters; | ||
state.semesters = sorted(semesters, state.orderByNewest); |
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.
Won't this cause a lot of unnecessary sorting? It seems that setOrderByNewest
already does this.
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, I was considering the case when the the semesters collection was edited but the orderByNewest Field was unchanged; I wanted to ensure that adding/deleting a semester didn't break the sorting order. Do you think I should remove that?
Co-authored-by: Benjamin Shen <bfs45@cornell.edu>
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.
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.
Zak this is really great! Can you make it so that the dropdown closes if you click anywhere on the screen? You can maybe refer to RequirementsDropdown
or any of the modal code. If you find yourself spending way too much time on it though don't worry about it. Although I think clickOutside
utility function might work here.
@@ -0,0 +1,154 @@ | |||
<template> |
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.
Maybe rename this file ViewDropdown
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.
Yep I agree!
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.
@@ -0,0 +1,55 @@ | |||
<template> |
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.
and this ViewDropdownOption
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.
Thanks for the feedback! I think I fixed all of your suggestions.
@zachary0kent if you want you can address the bigger things I pointed out in a separate PR as long as it gets merged before the deploy day Nov. 4 |
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.
This is looking really good! All my comments were addressed, and modals now look good on top of the view text!
Still having a bit of trouble with new users though? Onboarding does not seem to be able to be finished for those users, and when clicking the "Finish" button, I get this error. Could you please look into this?
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.
Works for me now so going to approve!!
But yeah I have no idea why the staging site would still expect that function to be needed.., I also don't see any references to it in the code. @hahnbeelee do you have any ideas?
PR #529 uses I also can't reproduce locally. I would pull from master again, tweak @vaishnavi17's changes, and see if there's still an error. |
also how other imports are formatted)
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.
Thanks for addressing all my suggestions and comments!! 💯
Like we discussed, there may be a way to make this a purely frontend implementation but we can come back to this if we run into issues with this PR later (which hopefully we won't 🤞)
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.
littt!!!!! awesome stuff zak!
Summary
This pull request implements a dropdown menu that allows the user to select whether their semesters are shown in order of newest to oldest or oldest to newest, persisting their choices in the backend. The dropdown menu also allows users to select whether semesters are displayed in compact or default layout, although this choice is not persistent. Implementing these changes required adding an orderByNewest field both to the user-semesters collection in Firebase and to the Vuex store. To minimize reads and writes to the Firebase, changing the ordering preference on the frontend only modifies the orderByNewest field in the Firebase. As a result, the semesters are no longer sorted in the backend; to ensure this does not introduce any breaking changes, when the orderByNewest field is changes, the semesters are resorted in the Vuex store--but not in the Firebase. Nevertheless, their still exists non-negligible latency when changing the ordering preference on the frontend, something to be explored in the future.
Remaining TODOs:
Test Plan