Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the “regular students/teachers” feature by moving regular-student management to the backend, adding weekly schedule editing/viewing for regular lessons, and using that schedule data to block unavailable time slots.
Changes:
- Replace localStorage-based regular-student storage with API-backed queries/mutations and cache invalidations.
- Add UI to edit a regular student’s weekly schedule (teacher side) and view a regular teacher’s schedule (student side).
- Use regular weekly schedules to block slot selection in schedule-related UI.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/pages/privetTeachersPages/teacherProfile/TeacherProfile.tsx | Invalidates teacher profile queries after schedule save; blocks schedule slots using regular-student weekly schedules. |
| client/src/pages/privetTeachersPages/teacherAppointments/TeacherAppointments.tsx | Migrates regular-student management to API; adds modal to edit a regular student’s schedule; removes localStorage logic. |
| client/src/pages/privateStudentsPages/clientsAppointments/ClientsAppointments.tsx | Adds “Regular Teachers” tab backed by API + pagination; adds schedule viewing modal. |
| client/src/features/appointments/query/useTeacherAppointmentsQuery.ts | Changes query enabled condition for teacher appointments fetching. |
| client/src/features/appointments/mutations/useUpdateWeeklyScheduleMutation.ts | Invalidates additional appointment-related query keys after updating weekly schedule. |
| client/src/features/appointments/mutations/useSetRegularStudentMutation.ts | Invalidates regular-teachers + teacher-appointments queries after setting regular student. |
| client/src/features/appointments/mutations/useRemoveRegularStudentMutation.ts | Invalidates regular-teachers + teacher-appointments queries after removal; adds error logging. |
| client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx | Uses teacher appointments + regular weekly schedules to block booking times; tweaks availability parsing for 23:59. |
| client/src/components/teacherProfileSection/LessonSchedule.tsx | Adds bookedSlots support and blocks selection for occupied slots; refactors modal content wrapper. |
| client/src/components/teacherAppointmentCard/TeacherAppointmentsList.tsx | Adjusts callbacks/conditions for add/remove regular and schedule click behavior. |
| client/src/components/teacherAppointmentCard/TeacherAppointmentInfo.tsx | Displays formatted weekly schedule in regular tab. |
| client/src/components/teacherAppointmentCard/TeacherAppointmentCard.tsx | Passes weekly schedule + regular-tab flag down to info component. |
| client/src/components/teacherAppointmentCard/TeacherAppointmentActions.tsx | Tightens action visibility and updates copy for regular-student actions. |
| client/src/components/sidebar/sidebarMenuItems.ts | Removes commented menu items and centralizes menu configuration. |
| client/src/components/sidebar/Sidebar.tsx | Switches to importing menu definitions from sidebarMenuItems.ts. |
| client/src/components/regularStudentScheduleModal/RegularStudentScheduleModal.tsx | Refactors modal content wrapper; improves default next-slot selection behavior. |
| client/src/components/appointmentCard/AppointmentStatusBar.tsx | Adds “Regular Teacher” variant with “Show Schedule” action; adds “Regular” badge support. |
| client/src/components/appointmentCard/AppointmentInfo.tsx | Displays formatted weekly schedule for regular teachers. |
| client/src/components/appointmentCard/AppointmentCard.tsx | Adds regular-teacher styling + passes schedule props into status/info components. |
| client/src/api/appointments/regularStudents.api.ts | Removes unused helper that fetched all regular-student slots. |
Comments suppressed due to low confidence (1)
client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx:179
endHouris no longer validated (previously both start/end were range-checked). With the new23:59 -> 24logic, it would be safer to validateendHouras well (allowing 24) and ensureendHour > startHour; otherwise malformed availability like25:00could generate invalid time slots.
const startHour = parseInt(startMatch[1], 10);
let endHour = parseInt(endMatch[1], 10);
if (slot.end === "23:59") {
endHour = 24;
}
if (startHour < 0 || startHour > 23) {
return;
}
for (let hour = startHour; hour < endHour; hour++) {
slots.push(`${hour.toString().padStart(2, "0")}:00`);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx
Outdated
Show resolved
Hide resolved
client/src/pages/privetTeachersPages/teacherAppointments/TeacherAppointments.tsx
Outdated
Show resolved
Hide resolved
Majoodeh
approved these changes
Mar 1, 2026
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.
No description provided.