Skip to content

Conversation

@davis118
Copy link
Contributor

@davis118 davis118 commented Oct 7, 2025

Calendar Preview Feature

Overview

Adds calendar preview system allowing users to hover over course cards to see sections overlaid on the schedule before adding them to their planner.

What Changed

Preview System:

  • PlannerCard now updates previewCourses state on hover/open
  • PlannerSchedule displays preview sections, filtered to exclude conflicts with existing planner courses
  • PlannerSection gets onSectionClick prop for selecting preview sections
  • Previews shown in greyscale, hover adds back color
  • PreviewSectionGroup handles multiple sections at same time with popover

Scoot Algorithm:

  • Courses that overlap "scoot" to not overlap

UI Enhancements:

  • Red border on hover for visual feedback

State Management:

  • getSelectedSections and hasConflict moved from PlannerCoursesTable to SharedStateProvider.tsx for reuse
  • Preview courses stored as SearchQueryMultiSection[] in shared state
  • Preview courses clear correctly with browser back/forth navigation

@davis118 davis118 requested a review from egsch as a code owner October 7, 2025 03:24
@vercel
Copy link

vercel bot commented Oct 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
utd-trends Error Error Dec 30, 2025 8:07pm

@egsch
Copy link
Contributor

egsch commented Oct 9, 2025

Hey a couple of initial observations from testing:

  • Checks for “conflicts with your schedule” don’t run when clicking from RHS, so you can select two simultaneous sections
  • After reloading with some cards open, cards stay selected despite being closed
    • I also caught a couple of instances where newly-opened cards didn't show previews (see screenshot) but didn't track down what has to happen before for this to occur
Screenshot 2025-10-07 140229

Could you look into fixing these?

@davis118 davis118 force-pushed the feature/calendar-preview branch from ab4074e to 4c09691 Compare October 10, 2025 02:12
@davis118
Copy link
Contributor Author

Checks for “conflicts with your schedule” don’t run when clicking from RHS, so you can select two simultaneous sections.

I fixed these. I added the conflict scanner to clicks in the schedule, then realized that I could also easily filter out the previews that conflicted and did that.

After reloading with some cards open, cards stay selected despite being closed

I also caught a couple of instances where newly-opened cards didn't show previews (see screenshot) but didn't track down what has to happen before for this to occur

I could not recreate this on my computer. Whenever the cards are closed, they should be removed from the preview schedule with setPreviewCourses.

Additionally, I realized that some classes have 2 sections at the exact same time. I'm not sure how to handle this, this UI issue could be discussed at our next meeting.

AbhiramTadepalli and others added 14 commits November 23, 2025 08:33
…Sections within anyways :)

Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Also set preview courses on card open

Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
Co-authored-by: davis118 <davismo118@gmail.com>
@AbhiramTadepalli
Copy link
Contributor

AbhiramTadepalli commented Nov 24, 2025

If partially overlap, keep two separate boxes but raise whichever one starts later to the top and scoot over its left side slightly to indicate that there are multiple sections.

Just to confirm, this is not that right? In this case, what should be done?
image

to be clear, this is because the FILM class only meets on tuesdays
Uploading image.png…

…eview

connect history of the feature branch but overwrite it with the refactored version of the code
@AbhiramTadepalli
Copy link
Contributor

Add Cs 2336 and govt 2306's overall results and open both cards. In the above image, HN4 actually belongs to the GOVT class

HOWEVER, @egsch do you think my issue can fix that? Maybe we can leave the grouping title to "Overlap CS 2336, GOVT 2306")

fixed

@egsch
Copy link
Contributor

egsch commented Nov 24, 2025

If partially overlap, keep two separate boxes but raise whichever one starts later to the top and scoot over its left side slightly to indicate that there are multiple sections.

Just to confirm, this is not that right? In this case, what should be done?

I think in this case the current idea would be that the shorter (combo) course goes to the top and gets the scoot, although that is a little bit awkward when it's multiple sections. Still think that's probably the best solution though

@AbhiramTadepalli
Copy link
Contributor

AbhiramTadepalli commented Dec 15, 2025

to be clear, this is because the FILM class only meets on tuesdays

  • Need to fix this
  • Handle multiple profs
  • Light mode multiple sections
  • handle overlap with existing selection
  • In these cases, is this behavior correct?
  1. image
  2. image
  3. image
  4. image

@egsch
Copy link
Contributor

egsch commented Dec 24, 2025

Sorry for the delay. Just updated to handle all sections of selected and non-selected sections together to prevent overlap issues.

- [ ]  Need to fix this

* [ ]  Handle multiple profs

* [ ]  Light mode multiple sections

Will finish these up soon

* [ ]  In these cases, is this behavior correct?

I think 1 and 2 are in line with our current expectations but if you have better ideas we can definitely consider them! I think we want to handle scoot in classes that overlap with already-scooted classes a little differently and maybe process different days separately to deal with 3 and 4 (and the issues in the checkboxes above). I will work on these a little more and push something for them soon

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.

5 participants