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

Fix rating review overflow #545

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

charlieweinberger
Copy link

Fixed the overflow of the "quality"/"difficulty" headers in ratings for professor/course reviews.

Description

Wherever reviews can be, the rating headers (and actually the rating values and the colored box itself) were not properly resizing when the browser window changed size. I fixed this by adding a media query for between widths of 1300px and 600px (there were no issues for widths outside of that range), and adjusting the widths and heights of the rating box, rating label, and rating value. I also fixed a bug where the rating boxes weren't the correct sizes at exactly 600px wide, by updating the smaller media query to start at 599px instead of 600px.

I definitely applied some of my personal opinions to this fix, since there isn't one clear way to make this section look the best. Let me know what you guys think about my changes, and if I should make the elements react different when the window changes dimensions.

Screenshots

Before:

Screenshot 2025-01-02 at 4 44 24 PM

After:

Screenshot 2025-01-02 at 4 44 17 PM

Test Plan

Create a review, then change the dimensions of the browser window, observing the ratings at various dimensions and ensuring that the rating header both stays inside the box the entire time, and looks good in terms of spacing & sizing for all window sizes. Make sure to check different widths, different heights, and both. Focus on widths between 1300px and 600px.

Issues

Closes #304

Copy link
Member

@Awesome-E Awesome-E left a comment

Choose a reason for hiding this comment

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

most of my comments are about the same concept, but to put it visually, these are two rating tiles that have the same width... it would be better to have everything conform to a fixed width instead of having some parts of it depend on the user's view port width (i.e. why is the rating text bigger on one?)

Comment on lines 32 to 33
width: 5vw;
height: 5vw;
Copy link
Member

Choose a reason for hiding this comment

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

Change this to use a fixed width instead of vw

Copy link
Member

Choose a reason for hiding this comment

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

Having a fixed height also makes it so you only have to check a couple different screen sizes (i.e. phone, desktop) instead of checking the whole continuous range

Comment on lines 34 to 35
min-width: 7rem;
min-height: 7rem;
Copy link
Member

Choose a reason for hiding this comment

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

If you have a fixed height, you can remove this

Comment on lines 54 to 60
.rating {
width: 8vw; // The rating box width & height shrink...
height: 8vw;
min-width: 5rem; // ...but only by so much.
min-height: 5rem;
gap: max(0.5vw, 0.4rem); // The same idea goes for gap...
}
Copy link
Member

Choose a reason for hiding this comment

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

This can be a lot less confusing if we have a fixed width for the rating tiles. It's common to think that things should scale with screen size (and that was the assumption before this PR), but most of the time that's not really true.

Comment on lines 222 to 225
.rating {
width: 45%;
height: 20vw;
}
Copy link
Member

Choose a reason for hiding this comment

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

Another rule that can be removed if we simplify the rating tile sizing

…th fixed widths, and fixed the remaining responsiveness issues
@charlieweinberger
Copy link
Author

After doing further work on improving the UI of reviews, I've realized that the code I pushed a few hours ago isn't ready for prod. I'm working on a fully-functional version right now, which will also have a bunch of other improvements to the UI of reviews. Unfortuately, I got a little carried away and have changed a lot more than just fixing this issue, althought I still believe that I've simply solved a number of other bugs related to the UI/UX of reviews. Within the next day I'll update this pull request with all the changes, and you can be the judge.

@charlieweinberger
Copy link
Author

I've realized that its likely easier to create a new pull request, because of how much I changed and in the interest of preserving this pull request in case my new pull request is too much. The new pull request is #552: Improve review UI. Go check that out and respond over there.

I'm really sorry if this entire situation is problematic. I don't know a lot about the good practices and typical norms of pull requests / team collaboration, so I apologize if I'm causing a mess here.

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.

In user Review page, there is an overflow the "Quality" & "Difficulty" heading
2 participants