-
Notifications
You must be signed in to change notification settings - Fork 24
Ck 7vn/split3 #1133
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
Merged
Merged
Ck 7vn/split3 #1133
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
756321f
fix: export sessionutil funcs
CK-7vn 72fd0d6
fix: split 3 helpers to lib and session-utils
CK-7vn 5c1a114
fix: type linked_override_event nullable, type VideoViewer fetch
CK-7vn a561ecb
refactor: split SessionDetailSheet into focused sub-components
CK-7vn 9d5273b
refactor: split SessionsTab into sub-components
CK-7vn c06ba2f
refactor: extract LoadingSkeleton and ClassNotFoundCard from class-de…
CK-7vn bf692af
refactor: dedupe buildFacilityEvent, tighten EnrollResidentModal cast
CK-7vn 518d206
fix: routes for top content and resident dashboard
CK-7vn 26238d7
fix: scrollbars
CK-7vn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| import { CalendarClock, CalendarOff, CheckCircle, MapPin, Users } from 'lucide-react'; | ||
| import { Button } from '@/components/ui/button'; | ||
|
|
||
| interface SessionDetailActionsProps { | ||
| canModify: boolean; | ||
| showTakeAttendance: boolean; | ||
| isCancelled: boolean; | ||
| onTakeAttendance?: () => void; | ||
| onRescheduleClick: () => void; | ||
| onCancelClick: () => void; | ||
| onChangeInstructorClick: () => void; | ||
| onChangeRoomClick: () => void; | ||
| onViewClassDetails?: () => void; | ||
| } | ||
|
|
||
| export function SessionDetailActions({ | ||
| canModify, | ||
| showTakeAttendance, | ||
| isCancelled, | ||
| onTakeAttendance, | ||
| onRescheduleClick, | ||
| onCancelClick, | ||
| onChangeInstructorClick, | ||
| onChangeRoomClick, | ||
| onViewClassDetails | ||
| }: SessionDetailActionsProps) { | ||
| return ( | ||
| <> | ||
| {(canModify || showTakeAttendance) && ( | ||
| <div className="pt-6 border-t border-gray-200"> | ||
| <h4 className="text-sm text-gray-700 mb-3"> | ||
| Actions | ||
| </h4> | ||
| <div className="space-y-2"> | ||
| {showTakeAttendance && onTakeAttendance && ( | ||
| <Button | ||
| className="w-full justify-start bg-[#556830] hover:bg-[#203622] text-white" | ||
| onClick={onTakeAttendance} | ||
| > | ||
| <CheckCircle className="size-4 mr-2" /> | ||
| Take Attendance | ||
| </Button> | ||
| )} | ||
| {canModify && ( | ||
| <> | ||
| <Button | ||
| variant="outline" | ||
| onClick={onRescheduleClick} | ||
| className="w-full justify-start border-gray-300 hover:bg-gray-50" | ||
| > | ||
| <CalendarClock className="size-4 mr-2" /> | ||
| Reschedule This Class | ||
| </Button> | ||
| <Button | ||
| variant="outline" | ||
| onClick={onCancelClick} | ||
| className="w-full justify-start border-gray-300 text-red-600 hover:bg-red-50 hover:text-red-700 hover:border-red-200" | ||
| > | ||
| <CalendarOff className="size-4 mr-2" /> | ||
| Cancel This Class | ||
| </Button> | ||
| <Button | ||
| variant="outline" | ||
| onClick={onChangeInstructorClick} | ||
| className="w-full justify-start border-gray-300 hover:bg-gray-50" | ||
| > | ||
| <Users className="size-4 mr-2" /> | ||
| Change Instructor | ||
| </Button> | ||
| <Button | ||
| variant="outline" | ||
| onClick={onChangeRoomClick} | ||
| className="w-full justify-start border-gray-300 hover:bg-gray-50" | ||
| > | ||
| <MapPin className="size-4 mr-2" /> | ||
| Change Room | ||
| </Button> | ||
| </> | ||
| )} | ||
| </div> | ||
| </div> | ||
| )} | ||
|
|
||
| {onViewClassDetails && !isCancelled && ( | ||
| <div className="pt-6 border-t border-gray-200"> | ||
| <Button | ||
| variant="outline" | ||
| className="w-full justify-start" | ||
| onClick={onViewClassDetails} | ||
| > | ||
| View Full Class Details → | ||
| </Button> | ||
| </div> | ||
| )} | ||
| </> | ||
| ); | ||
| } |
103 changes: 103 additions & 0 deletions
103
frontend/src/components/schedule/SessionDetailClassDetails.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| import { Calendar, Clock, MapPin, Users } from 'lucide-react'; | ||
| import { formatClassTimeRange } from '@/lib/formatters'; | ||
|
|
||
| interface SessionDetailClassDetailsProps { | ||
| className: string; | ||
| programName?: string; | ||
| classTime: string; | ||
| room: string; | ||
| originalRoom?: string; | ||
| instructorName?: string; | ||
| originalInstructorName?: string; | ||
| isCancelled: boolean; | ||
| isRescheduledFrom: boolean; | ||
| isCancelledReschedule: boolean; | ||
| } | ||
|
|
||
| export function SessionDetailClassDetails({ | ||
| className, | ||
| programName, | ||
| classTime, | ||
| room, | ||
| originalRoom, | ||
| instructorName, | ||
| originalInstructorName, | ||
| isCancelled, | ||
| isRescheduledFrom, | ||
| isCancelledReschedule | ||
| }: SessionDetailClassDetailsProps) { | ||
| return ( | ||
| <div> | ||
| <h4 className="text-sm text-gray-700 mb-3"> | ||
| Class Details | ||
| </h4> | ||
| <div className="space-y-3"> | ||
| <div className="flex items-start gap-3"> | ||
| <Calendar className="size-5 text-gray-400 mt-0.5 flex-shrink-0" /> | ||
| <div className="flex-1 min-w-0"> | ||
| <div className="text-sm text-gray-600 mb-0.5"> | ||
| Class | ||
| </div> | ||
| <div className="text-[#203622]"> | ||
| {className} | ||
| </div> | ||
| {programName && ( | ||
| <div className="text-sm text-gray-500"> | ||
| {programName} | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| <div className="flex items-start gap-3"> | ||
| <Clock className="size-5 text-gray-400 mt-0.5 flex-shrink-0" /> | ||
| <div className="flex-1 min-w-0"> | ||
| <div className="text-sm text-gray-600 mb-0.5"> | ||
| Time | ||
| </div> | ||
| <div | ||
| className={`text-[#203622] ${isCancelled || isRescheduledFrom || isCancelledReschedule ? 'line-through' : ''}`} | ||
| > | ||
| {formatClassTimeRange(classTime)} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div className="flex items-start gap-3"> | ||
| <MapPin className="size-5 text-gray-400 mt-0.5 flex-shrink-0" /> | ||
| <div className="flex-1 min-w-0"> | ||
| <div className="text-sm text-gray-600 mb-0.5"> | ||
| Room | ||
| </div> | ||
| <div | ||
| className={`text-[#203622] ${ | ||
| !!originalRoom || isCancelled || isRescheduledFrom || isCancelledReschedule | ||
| ? 'line-through' | ||
| : '' | ||
| }`} | ||
| > | ||
| {originalRoom ?? room} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {(originalInstructorName ?? instructorName) && ( | ||
| <div className="flex items-start gap-3"> | ||
| <Users className="size-5 text-gray-400 mt-0.5 flex-shrink-0" /> | ||
| <div className="flex-1 min-w-0"> | ||
| <div className="text-sm text-gray-600 mb-0.5"> | ||
| Instructor | ||
| </div> | ||
| <div | ||
| className={`text-[#203622] ${ | ||
| !!originalInstructorName || isCancelled || isRescheduledFrom || isCancelledReschedule | ||
| ? 'line-through' | ||
| : '' | ||
| }`} | ||
| > | ||
| {originalInstructorName ?? instructorName} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
find frontend -name "TopContentList.tsx" -type fRepository: UnlockedLabs/UnlockEdv2
Length of output: 120
🏁 Script executed:
Repository: UnlockedLabs/UnlockEdv2
Length of output: 3262
🏁 Script executed:
rg "onClick.*handleClick" frontend/src/components/dashboard/ -A 3 -B 1Repository: UnlockedLabs/UnlockEdv2
Length of output: 566
🏁 Script executed:
rg "<div[^>]*onClick" frontend/src/components/ --type tsx --type ts -cRepository: UnlockedLabs/UnlockEdv2
Length of output: 95
🏁 Script executed:
rg "<div[^>]*onClick" frontend/src/components/ -cRepository: UnlockedLabs/UnlockEdv2
Length of output: 49
🏁 Script executed:
rg "onKeyDown|onKeyPress|onKeyUp" frontend/src/components/dashboard/TopContentList.tsxRepository: UnlockedLabs/UnlockEdv2
Length of output: 49
Replace interactive div with semantic button element for keyboard accessibility.
Line 25 uses a non-semantic
<div>for interactive content, which is not keyboard-focusable by default and blocks keyboard users from accessing this core navigation feature. Since the component already uses semantic buttons elsewhere (line 71), replace this div with a<button type="button">element to provide proper keyboard and assistive technology support.Suggested fix
🤖 Prompt for AI Agents