From 8df04a9ee1afd6052589a571c4e0cab081f276b0 Mon Sep 17 00:00:00 2001 From: vicksey Date: Tue, 28 Oct 2025 11:24:01 -0700 Subject: [PATCH 1/7] enrollment header and NOR tooltip new branch --- .../RightPane/CoursePane/CourseRenderPane.tsx | 1 + .../SectionTable/EnrollmentColumnHeader.tsx | 21 ++++++------------- .../RightPane/SectionTable/SectionTable.tsx | 16 +++++++++++++- .../SectionTable/SectionTable.types.ts | 1 + .../SectionTableBodyCells/EnrollmentCell.tsx | 6 ++++-- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx index 9879cc904..820f59334 100644 --- a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx +++ b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx @@ -146,6 +146,7 @@ const SectionTableWrapped = ( allowHighlight={true} scheduleNames={scheduleNames} analyticsCategory={analyticsEnum.classSearch} + updatedAt={course.updatedAt ?? undefined} /> ); } diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx index 595a25252..577e671ea 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx @@ -1,8 +1,9 @@ -import { Help } from '@mui/icons-material'; +import { AccessTimeFilled } from '@mui/icons-material'; import { Box, Tooltip, Typography, useMediaQuery, useTheme } from '@mui/material'; interface EnrollmentColumnHeaderProps { label: string; + formattedTime: string | null; } export function EnrollmentColumnHeader(props: EnrollmentColumnHeaderProps) { @@ -11,22 +12,12 @@ export function EnrollmentColumnHeader(props: EnrollmentColumnHeaderProps) { return ( - {props.label} - {!isMobile && ( - - Enrolled/Capacity -
- Waitlist/Capacity -
- New-Only Reserved - - } - > - + {!isMobile && props.formattedTime && ( + Last updated at {props.formattedTime}}> + )} + {props.label}
); } diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx index 9c3e9f2a6..f731aa4b3 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx @@ -15,6 +15,7 @@ import analyticsEnum from '$lib/analytics/analytics'; import { MOBILE_BREAKPOINT } from '$src/globals'; import { useColumnStore, SECTION_TABLE_COLUMNS, type SectionTableColumn } from '$stores/ColumnStore'; import { useTabStore } from '$stores/TabStore'; +import { useTimeFormatStore } from '$stores/SettingsStore'; const TOTAL_NUM_COLUMNS = SECTION_TABLE_COLUMNS.length; @@ -69,6 +70,7 @@ const tableHeaderColumnEntries = Object.entries(tableHeaderColumns); function SectionTable(props: SectionTableProps) { const { courseDetails, term, allowHighlight, scheduleNames, analyticsCategory } = props; + const { isMilitaryTime } = useTimeFormatStore() const [activeColumns] = useColumnStore((store) => [store.activeColumns]); const [activeTab] = useTabStore((store) => [store.activeTab]); @@ -78,6 +80,17 @@ function SectionTable(props: SectionTableProps) { return courseDetails.deptCode.replaceAll(' ', '') + courseDetails.courseNumber; }, [courseDetails.deptCode, courseDetails.courseNumber]); + const formattedTime = useMemo(() => { + const raw = courseDetails.updatedAt ?? ''; + const parsed = Date.parse(raw); + if (isNaN(parsed)) return null; + return new Date(parsed).toLocaleTimeString([], { + hour: '2-digit', + minute: '2-digit', + hour12: !isMilitaryTime, + }); + }, [courseDetails.updatedAt, isMilitaryTime]); + /** * Limit table width to force side scrolling. */ @@ -185,9 +198,10 @@ function SectionTable(props: SectionTableProps) { sx={{ width: width, padding: 0, + overflow: 'hidden', }} > - {label === 'Enrollment' ? : label} + {label === 'Enrollment' && formattedTime ? : label} ))} diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.types.ts b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.types.ts index 4e6597faf..b2de69aaf 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.types.ts +++ b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.types.ts @@ -12,4 +12,5 @@ export interface SectionTableProps { allowHighlight: boolean; scheduleNames: string[]; analyticsCategory: AnalyticsCategory; + updatedAt?: string; } diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx index 1ec1b6411..cb39be031 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx @@ -1,4 +1,4 @@ -import { Box } from '@mui/material'; +import { Box, Tooltip } from '@mui/material'; import { WebsocSectionEnrollment } from '@packages/antalmanac-types'; import { TableBodyCellContainer } from '$components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/TableBodyCellContainer'; @@ -40,7 +40,9 @@ export const EnrollmentCell = ({ WL: {numOnWaitlist} / {numWaitlistCap} )} - {numNewOnlyReserved !== '' && NOR: {numNewOnlyReserved}} + + NOR: {numNewOnlyReserved} + ); From 8d94de17877625992d9670b7c20b16d3a8b7c322 Mon Sep 17 00:00:00 2001 From: vicksey Date: Tue, 28 Oct 2025 11:34:06 -0700 Subject: [PATCH 2/7] shrank font --- .../RightPane/SectionTable/EnrollmentColumnHeader.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx index 577e671ea..486e1311f 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx @@ -13,8 +13,8 @@ export function EnrollmentColumnHeader(props: EnrollmentColumnHeaderProps) { return ( {!isMobile && props.formattedTime && ( - Last updated at {props.formattedTime}}> - + Last updated at {props.formattedTime}}> + )} {props.label} From c149cf6be7fb6d24d4c7ee32046414fca2c85911 Mon Sep 17 00:00:00 2001 From: vicksey Date: Tue, 28 Oct 2025 19:28:28 -0700 Subject: [PATCH 3/7] added tooltip to added pane --- .../RightPane/AddedCourses/AddedCoursePane.tsx | 11 +++++++++-- .../RightPane/CoursePane/CourseRenderPane.tsx | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx b/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx index 01ba3f0b4..8de27db8c 100644 --- a/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx +++ b/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx @@ -49,10 +49,17 @@ function getCourses() { needleCourse.courseTitle === course.courseTitle ); + const sectionUpdatedAt = (course.section as any)?.updatedAt ?? null; + const courseUpdatedAt = (course as any)?.updatedAt ?? null; + if (formattedCourse) { formattedCourse.sections.push({ ...course.section, }); + formattedCourse.updatedAt = + Date.parse(sectionUpdatedAt) > Date.parse(formattedCourse.updatedAt ?? '') + ? sectionUpdatedAt + : formattedCourse.updatedAt; } else { formattedCourse = { term: course.term, @@ -66,7 +73,7 @@ function getCourses() { ...course.section, }, ], - updatedAt: null, + updatedAt: courseUpdatedAt ?? sectionUpdatedAt ?? null, }; formattedCourses.push(formattedCourse); } @@ -385,7 +392,7 @@ export function AddedCoursePane() { setSkeletonMode(AppStore.getSkeletonMode()); }; - console.log('Opened added ourse'); + console.log('Opened added course'); logAnalytics(postHog, { category: analyticsEnum.addedClasses, diff --git a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx index 820f59334..9879cc904 100644 --- a/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx +++ b/apps/antalmanac/src/components/RightPane/CoursePane/CourseRenderPane.tsx @@ -146,7 +146,6 @@ const SectionTableWrapped = ( allowHighlight={true} scheduleNames={scheduleNames} analyticsCategory={analyticsEnum.classSearch} - updatedAt={course.updatedAt ?? undefined} /> ); } From 8fe74441f94529d61d6b96e9b1faa5827c54ee37 Mon Sep 17 00:00:00 2001 From: vicksey Date: Tue, 28 Oct 2025 23:03:48 -0700 Subject: [PATCH 4/7] latest section instead of course time --- .../components/RightPane/AddedCourses/AddedCoursePane.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx b/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx index 8de27db8c..4a984f453 100644 --- a/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx +++ b/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx @@ -50,16 +50,12 @@ function getCourses() { ); const sectionUpdatedAt = (course.section as any)?.updatedAt ?? null; - const courseUpdatedAt = (course as any)?.updatedAt ?? null; if (formattedCourse) { formattedCourse.sections.push({ ...course.section, }); - formattedCourse.updatedAt = - Date.parse(sectionUpdatedAt) > Date.parse(formattedCourse.updatedAt ?? '') - ? sectionUpdatedAt - : formattedCourse.updatedAt; + formattedCourse.updatedAt = sectionUpdatedAt; } else { formattedCourse = { term: course.term, @@ -73,7 +69,7 @@ function getCourses() { ...course.section, }, ], - updatedAt: courseUpdatedAt ?? sectionUpdatedAt ?? null, + updatedAt: sectionUpdatedAt ?? null, }; formattedCourses.push(formattedCourse); } From 45150f258de6777bd271420feb46b3bf5e85e9f7 Mon Sep 17 00:00:00 2001 From: vicksey Date: Tue, 28 Oct 2025 23:36:45 -0700 Subject: [PATCH 5/7] clean --- .../RightPane/AddedCourses/AddedCoursePane.tsx | 2 +- .../SectionTable/EnrollmentColumnHeader.tsx | 2 +- .../RightPane/SectionTable/SectionTable.tsx | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx b/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx index 4a984f453..acf271ff6 100644 --- a/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx +++ b/apps/antalmanac/src/components/RightPane/AddedCourses/AddedCoursePane.tsx @@ -49,7 +49,7 @@ function getCourses() { needleCourse.courseTitle === course.courseTitle ); - const sectionUpdatedAt = (course.section as any)?.updatedAt ?? null; + const sectionUpdatedAt = course.section?.updatedAt ?? null; if (formattedCourse) { formattedCourse.sections.push({ diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx index 486e1311f..31f43eb09 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx @@ -11,7 +11,7 @@ export function EnrollmentColumnHeader(props: EnrollmentColumnHeaderProps) { const isMobile = useMediaQuery(theme.breakpoints.down('sm')); return ( - + {!isMobile && props.formattedTime && ( Last updated at {props.formattedTime}}> diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx index f731aa4b3..5f030a8f8 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx @@ -81,14 +81,15 @@ function SectionTable(props: SectionTableProps) { }, [courseDetails.deptCode, courseDetails.courseNumber]); const formattedTime = useMemo(() => { - const raw = courseDetails.updatedAt ?? ''; - const parsed = Date.parse(raw); - if (isNaN(parsed)) return null; - return new Date(parsed).toLocaleTimeString([], { - hour: '2-digit', - minute: '2-digit', - hour12: !isMilitaryTime, - }); + if (!courseDetails.updatedAt) return null; + const date = new Date(courseDetails.updatedAt); + return isNaN(date.getTime()) + ? null + : date.toLocaleTimeString(undefined, { + hour: '2-digit', + minute: '2-digit', + hour12: !isMilitaryTime, + }); }, [courseDetails.updatedAt, isMilitaryTime]); /** @@ -198,7 +199,6 @@ function SectionTable(props: SectionTableProps) { sx={{ width: width, padding: 0, - overflow: 'hidden', }} > {label === 'Enrollment' && formattedTime ? : label} From 84649a85c11d75f37b69eae0298ab7fc35fe1e95 Mon Sep 17 00:00:00 2001 From: vicksey Date: Tue, 28 Oct 2025 23:51:52 -0700 Subject: [PATCH 6/7] small ui fixes --- .../RightPane/SectionTable/EnrollmentColumnHeader.tsx | 4 ++-- .../components/RightPane/SectionTable/SectionTable.tsx | 2 +- .../SectionTableBodyCells/EnrollmentCell.tsx | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx index 31f43eb09..14ca799b5 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx @@ -11,13 +11,13 @@ export function EnrollmentColumnHeader(props: EnrollmentColumnHeaderProps) { const isMobile = useMediaQuery(theme.breakpoints.down('sm')); return ( - + + {props.label} {!isMobile && props.formattedTime && ( Last updated at {props.formattedTime}}> )} - {props.label} ); } diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx index 5f030a8f8..9e88cac33 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTable.tsx @@ -95,7 +95,7 @@ function SectionTable(props: SectionTableProps) { /** * Limit table width to force side scrolling. */ - const width = 780; + const width = 920; const tableMinWidth = useMemo(() => { const numActiveColumns = activeColumns.length; return (width * numActiveColumns) / TOTAL_NUM_COLUMNS; diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx index cb39be031..02285091f 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/SectionTableBody/SectionTableBodyCells/EnrollmentCell.tsx @@ -40,9 +40,11 @@ export const EnrollmentCell = ({ WL: {numOnWaitlist} / {numWaitlistCap} )} - - NOR: {numNewOnlyReserved} - + {numNewOnlyReserved && ( + + NOR: {numNewOnlyReserved} + + )} ); From 12fa19d037d829e440818baf1b362d1135a71b46 Mon Sep 17 00:00:00 2001 From: vicksey Date: Tue, 2 Dec 2025 14:20:50 -0800 Subject: [PATCH 7/7] fix: adjust icons bottom alignment --- .../RightPane/SectionTable/EnrollmentColumnHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx index 14ca799b5..a7852881c 100644 --- a/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx +++ b/apps/antalmanac/src/components/RightPane/SectionTable/EnrollmentColumnHeader.tsx @@ -15,7 +15,7 @@ export function EnrollmentColumnHeader(props: EnrollmentColumnHeaderProps) { {props.label} {!isMobile && props.formattedTime && ( Last updated at {props.formattedTime}}> - + )}