Skip to content

Feature/calendar preview#516

Open
davis118 wants to merge 43 commits intodevelopfrom
feature/calendar-preview
Open

Feature/calendar preview#516
davis118 wants to merge 43 commits intodevelopfrom
feature/calendar-preview

Conversation

@davis118
Copy link
Copy Markdown
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
Copy Markdown

vercel Bot commented Oct 7, 2025

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

Project Deployment Actions Updated (UTC)
utd-trends Ready Ready Preview, Comment Mar 21, 2026 1:55am

Request Review

@egsch
Copy link
Copy Markdown
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
Copy Markdown
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.

@egsch
Copy link
Copy Markdown
Contributor

egsch commented Oct 10, 2025

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.

Hey sorry, just realized I said "after reloading" but I only actually saw it after going back and forward in the browser.

@AbhiramTadepalli
Copy link
Copy Markdown
Contributor

AbhiramTadepalli commented Oct 12, 2025

Some things I noticed:

  • I am not able to un-click on the RHS to remove a selected class

I could also easily filter out the previews that conflicted and did that.

  • I just wanted y'all's opinion on this. Some configuration could exist where when I open a card, every preview section has a conflict so nothing changes in the RHS. Should we perhaps still do at least a colored outline over that time range?
image
  • How should we handle the case when multiple cards are open and 2 preview sections overlap?

These aren't critiques, just wanted to see what we think about these ^^

@egsch
Copy link
Copy Markdown
Contributor

egsch commented Oct 15, 2025

I am not able to un-click on the RHS to remove a selected class

What would y'all think of scrolling to the selected class's card on click instead of just automatically removing it?

I could also easily filter out the previews that conflicted and did that.

I just wanted y'all's opinion on this. Some configuration could exist where when I open a card, every preview section has a conflict so nothing changes in the RHS. Should we perhaps still do at least a colored outline over that time range?
image

How should we handle the case when multiple cards are open and 2 preview sections overlap?

Ideas for displaying multiple sections at the same time (bad mockups, I am not a designer, please make them look better) after a little bit of discussion at our meeting yesterday:

If classes exactly overlap, put indicator that there are multiple and some kind of popup to choose which one:
image
If overlap with existing thing, same thing but box keeps info/shading:
image
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.
image

Do y'all have any thoughts on these?

@AbhiramTadepalli
Copy link
Copy Markdown
Contributor

What would y'all think of scrolling to the selected class's card on click instead of just automatically removing it?

not entirely opposed to it. However since we can click to add when the card is open, it makes logical sense to click to unselect when the card is open imo

Do y'all have any thoughts on these?
The multiple options works well, but it seems like overkill. We could just do a scoot?

@egsch
Copy link
Copy Markdown
Contributor

egsch commented Oct 16, 2025

What would y'all think of scrolling to the selected class's card on click instead of just automatically removing it?

not entirely opposed to it. However since we can click to add when the card is open, it makes logical sense to click to unselect when the card is open imo

that's fair, think we should probably do that

Do y'all have any thoughts on these?
The multiple options works well, but it seems like overkill. We could just do a scoot?

The concern when we discussed it was was that the schedule's horizontal width is small enough that with our relatively small horizontal space, it becomes very hard to see any text on the cards, especially when we have 3 classes at once. I think adding an MUI popover with some sort of selection is still the best plan, but it can be outside the scope of this PR if we need

@davis118
Copy link
Copy Markdown
Contributor Author

I think the multiple options popup approach is good. In big classes like Linear Algebra there can be up to 8 overlapping sections. I'll implement it and commit soon.

dont display multiple sections if theres only 1
AbhiramTadepalli and others added 9 commits November 23, 2025 21:49
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants