From bdcaee8c98a27c79528b2aa2824be5d55f0da479 Mon Sep 17 00:00:00 2001 From: Yudi Wu Date: Fri, 12 Jun 2026 19:15:43 +1000 Subject: [PATCH] fix: raise course picker limit from 300 to 500 to prevent truncation With 432 qualifying courses in the 2026 handbook, the previous LIMIT 300 silently truncated the alphabetically-sorted list. C6004 (Master of Data Science) sat at row 310 and never appeared in any course picker dropdown. All call sites now pass 500 to leave headroom for future handbook years. --- packages/webapp/app/actions.ts | 2 +- packages/webapp/app/courses/[code]/page.tsx | 2 +- packages/webapp/app/page.tsx | 2 +- packages/webapp/app/tree/page.tsx | 2 +- packages/webapp/app/units/[code]/page.tsx | 2 +- packages/webapp/lib/db/queries.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/webapp/app/actions.ts b/packages/webapp/app/actions.ts index 873a33a..e1f6b72 100644 --- a/packages/webapp/app/actions.ts +++ b/packages/webapp/app/actions.ts @@ -91,7 +91,7 @@ export async function listCoursesAction( search: string | null, year: string ): Promise { - return listCoursesForPicker(search, 300, year) + return listCoursesForPicker(search, 500, year) } export async function listAvailableYearsAction(): Promise { diff --git a/packages/webapp/app/courses/[code]/page.tsx b/packages/webapp/app/courses/[code]/page.tsx index 2390d5c..4e94be0 100644 --- a/packages/webapp/app/courses/[code]/page.tsx +++ b/packages/webapp/app/courses/[code]/page.tsx @@ -102,7 +102,7 @@ export default async function CourseTreePage({ const [initial, courses, initialCourse] = await Promise.all([ prefetchTreeData(initialControls), - listCoursesForPicker(null, 300, year), + listCoursesForPicker(null, 500, year), fetchCourseWithAoS( course.code, year diff --git a/packages/webapp/app/page.tsx b/packages/webapp/app/page.tsx index a17283e..26efbbf 100644 --- a/packages/webapp/app/page.tsx +++ b/packages/webapp/app/page.tsx @@ -85,7 +85,7 @@ export default async function Page({ : null const [courses, defaultCourse] = await Promise.all([ - listCoursesForPicker(null, 300, year), + listCoursesForPicker(null, 500, year), courseCode ? fetchCourseWithAoS(courseCode, year) : Promise.resolve(null), ]) diff --git a/packages/webapp/app/tree/page.tsx b/packages/webapp/app/tree/page.tsx index 3f718f9..3d41cc5 100644 --- a/packages/webapp/app/tree/page.tsx +++ b/packages/webapp/app/tree/page.tsx @@ -115,7 +115,7 @@ export default async function TreePage({ } const [courses, allUnits] = await Promise.all([ - listCoursesForPicker(null, 300, year), + listCoursesForPicker(null, 500, year), listAllUnits(year), ]) diff --git a/packages/webapp/app/units/[code]/page.tsx b/packages/webapp/app/units/[code]/page.tsx index 4031e68..499a5d8 100644 --- a/packages/webapp/app/units/[code]/page.tsx +++ b/packages/webapp/app/units/[code]/page.tsx @@ -108,7 +108,7 @@ export default async function UnitTreePage({ useMyPlan: false, } const initial = await prefetchTreeData(initialControls) - const courses = await listCoursesForPicker(null, 300, year) + const courses = await listCoursesForPicker(null, 500, year) // Unit mode doesn't need course-meta, but TreeView accepts null. const initialCourse: PlannerCourseWithAoS | null = null diff --git a/packages/webapp/lib/db/queries.ts b/packages/webapp/lib/db/queries.ts index 1817d89..f69b0c5 100644 --- a/packages/webapp/lib/db/queries.ts +++ b/packages/webapp/lib/db/queries.ts @@ -76,7 +76,7 @@ export const listAvailableYears = cacheHandbook( async function _listCoursesForPicker( search: string | null, - limit = 50, + limit = 500, year: string = HANDBOOK_YEAR ): Promise { const db = getDb()