S26 02 pr54 --- improvements to modal for creating schedules. - #312
Open
pconrad wants to merge 37 commits into
Open
S26 02 pr54 --- improvements to modal for creating schedules.#312pconrad wants to merge 37 commits into
pconrad wants to merge 37 commits into
Conversation
pconrad
requested review from
DerekKirschbaum,
Division7,
Wendy192837,
andrewc512,
divyanipunj and
kirrarista
as code owners
June 16, 2026 22:20
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the “Add to schedule” UX in the main search flow by enhancing the AddToSchedule modal so users can create a personal schedule inline (instead of navigating away), and increases the backend schedule-name limit to support the updated UI behavior.
Changes:
- Updated
AddToScheduleModalto support an “auto-create schedule” mode using a backend mutation, with loading/disable behavior and revised modal controls. - Increased personal schedule name max length from 15 to 25 characters in the backend and updated backend tests accordingly.
- Updated frontend tests for
SectionsTableandAddToScheduleModalto reflect the new mutation wiring and UI states.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/edu/ucsb/cs156/courses/controllers/PersonalSchedulesController.java | Raises schedule name length limit to 25 and updates validation messaging. |
| src/test/java/edu/ucsb/cs156/courses/controllers/PersonalSchedulesControllerTests.java | Updates tests to enforce the new 25-character limit and boundary cases. |
| frontend/src/main/components/PersonalSchedules/AddToScheduleModal.jsx | Adds auto-create flow, backend mutation, revised modal UI, and schedule parameter handling. |
| frontend/src/tests/components/PersonalSchedules/AddToScheduleModal.test.jsx | Expands tests to cover new modal modes, mutation callbacks, loading state, and UI behavior. |
| frontend/src/tests/components/Sections/SectionsTable.loggedIn.test.jsx | Adjusts mocks/expectations for additional useBackendMutation usage introduced by the modal. |
Comment on lines
+47
to
+49
| const onError = (error) => { | ||
| toast(`Error: ${error.response.data.message}`); | ||
| }; |
Comment on lines
+68
to
+70
| const handleModalSaveSchedule = () => { | ||
| mutation.mutate(scheduleParams); | ||
| }; |
Comment on lines
+72
to
+85
| const handleCreateClick = () => { | ||
| const timeString = new Date().toLocaleString([], { | ||
| month: "short", | ||
| day: "numeric", | ||
| hour: "2-digit", | ||
| minute: "2-digit", | ||
| }); | ||
|
|
||
| setScheduleParams({ | ||
| ...scheduleParams, | ||
| name: `${timeString} Schedule`, | ||
| description: "Auto-generated schedule", | ||
| }); | ||
| setModalMode("auto-create"); |
Comment on lines
+90
to
93
| // Checks length of name parameter (length should be 25 chars or less, nonzero) | ||
| if (name.length() > 25) { | ||
| throw new IllegalArgumentException("name parameter restricted to 25 chars or less"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partial implementation of #215
Cherry picked from: ucsb-cs156-s26/proj-courses-s26-02#48, from the work of s26-02.
All this happens under main search
In this PR, I've changed the functionality of [Create Personal Schedule] to automatically create a schedule without going to the personal schedule tab.
If there are no schedules for the selected quarter, [Create Personal Schedule] will hold parameters for date and time. Clicking Back will not create a schedule, but clicking Save Changes creates a schedule with the class included.
The user can only save changes once they have created a schedule. Otherwise it is only a cancel button
Adjusted SectionTableLoggedin Tests
Extended the character count for name to 25 instead of 15