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

Merge course popovers #551

Merged
merged 20 commits into from
Jan 22, 2025
Merged

Merge course popovers #551

merged 20 commits into from
Jan 22, 2025

Conversation

CadenLee2
Copy link
Contributor

@CadenLee2 CadenLee2 commented Jan 11, 2025

Merge the course info popover and the missing prerequisites popover into one, merge their icons, refactor this into a new component, update styles

Description

Currently, there are two popovers for a course: the course information popover, and the warning popover for missing prerequisites.

  • This PR merges the two popovers into one, which displays course information and a warning for missing prerequisites if they exist
  • The two hoverable icons (info circle and warning triangle) are also merged into one, which is a warning triangle if missing prerequisites exist and a blue info circle otherwise
  • The popover explicitly opens to the left in the search results and to the right in the roadmap so as not to go off screen
    • A note about code: in any Course where we want the popover to open to the left, the prop openPopoverLeft={true} must be explicitly set, because Boostrap's auto placement was broken and it often went off screen. If openPopoverLeft is not included, the popover will open to the right.
    • On mobile, the popover always opens to the bottom, regardless of whether it was set to open on the left
  • The merged course popover is now a new component, CoursePopover
  • The popover styles/organization mostly conform to those in the Figma design (note that certain features shown in the Figma like the quarter offerings list are not yet added, and that the list of all prerequisites is currently still included because it is easy to remove later if wanted)
  • ppc-popover is now an available CSS class in App.scss for such popovers (React Bootstrap popovers)

Screenshots

Before:
Screenshot 2025-01-10 220017
Screenshot 2025-01-10 220259
After:
Screenshot 2025-01-10 215959
Dark mode, and opening on the left side (from the roadmap search) (note that the hoverable icon looks small due to the quarter offerings and small width, which will be fixed later when the Roadmap Search Redesign PR is merged):
Screenshot 2025-01-10 220514
Opening on the bottom in mobile:
Screenshot 2025-01-13 112528

Test Plan

Check the above changes in the staging instance:

  • On desktop and mobile
  • In light and dark mode
  • For normal courses and courses with missing prerequisites
  • With a small screen

Verify successful deployment

Issues

Closes #526

@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 11, 2025 06:13 — with GitHub Actions Inactive
@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 11, 2025 06:25 — with GitHub Actions Inactive
@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 11, 2025 23:16 — with GitHub Actions Inactive
…to merge-course-popovers

update from main
@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 11, 2025 23:19 — with GitHub Actions Inactive
site/src/App.scss Outdated Show resolved Hide resolved
@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 13, 2025 19:02 — with GitHub Actions Inactive
@CadenLee2 CadenLee2 marked this pull request as ready for review January 13, 2025 19:26
@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 13, 2025 19:29 — with GitHub Actions Inactive
@Awesome-E Awesome-E temporarily deployed to staging-551 January 13, 2025 22:11 — with GitHub Actions Inactive
@Awesome-E Awesome-E temporarily deployed to staging-551 January 13, 2025 22:28 — with GitHub Actions Inactive
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.

wrapped a couple elements in braces {} and tweaked some styles. just check it, make any fixes, and feel free to merge

@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 16, 2025 01:44 — with GitHub Actions Inactive
@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 16, 2025 01:49 — with GitHub Actions Inactive
@CadenLee2
Copy link
Contributor Author

After updating from main (the Roadmap Search Redesign), there is now a problem with the popover positions, currently unpredictable, and it should be resolved before this is merged because it can severely impact the usage of the website.

Description

  • Sometimes (reason/exact conditions unknown), the popovers for courses in the roadmap open in the top-left corner of the page rather than their correct positions
  • Their "placement" direction is correct still (arrow is on the correct side), they just have the wrong location

Steps to replicate (potentially):

  • Open the staging instance on a desktop browser
  • In the Roadmap search, search for ICS 33; drag it into Fall of Year 1. Notice the popover for the warning icon opens correctly (to the right).
  • Search for ICS 31; drag it into the Fall of Year 1, before ICS 33. Hover the info icon. The popover opens in the top-left corner of the page, in the correct "placement" direction (arrow on the correct side), but entirely in the wrong place. The ICS 33 popover should still be correct.
  • Now try exchanging their positions (dragging the 33 up to above the 31). Both of their popovers should be in the wrong place now.
  • After various exchanges, adding of courses, and so on, certain course popovers will, seemingly arbitrarily and inconsistently, open in the wrong place.

Notes

  • This problem only started happening after updating the from main.
  • An inconsistency potentially related to this issue seems to exist on the current production deployment, though it's not noticeable at all because the popovers keep a relatively expected position:
    • Search for any course in the roadmap in production on desktop
    • Hover over its info icon. Notice that the info popover's arrow ends exactly in the middle of the icon. Now move the mouse then re-hover over the same icon. The popover has moved slightly to the left.
    • To my knowledge, this did not exist before
  • Using developer tools to inspect, the mispositioned popovers in this branch all seem to have transform: translate(7px) set (as opposed to the correct value of the transform)
  • This affects mobile as well
  • This does not affect courses in the search results

@CadenLee2 CadenLee2 temporarily deployed to staging-551 January 20, 2025 01:15 — with GitHub Actions Inactive
@CadenLee2
Copy link
Contributor Author

The above problem is now fixed by wrapping the conditional icon in a div

Copy link
Contributor

@timobraz timobraz left a comment

Choose a reason for hiding this comment

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

LGTM, works on mobile and dark/light mode

@CadenLee2 CadenLee2 merged commit 9a92bd3 into main Jan 22, 2025
2 checks passed
@CadenLee2 CadenLee2 deleted the merge-course-popovers branch January 22, 2025 05:03
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.

Merge the "Course Info" and "Prerequisite Not Met" Popovers
4 participants