Add course search & deadlines pages, Vercel deploy workflow, and repo docs/ignores#16
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 593081a620
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| searchParams?: Promise<CourseCatalogSearchParams> | ||
| }) { | ||
| const params = (await searchParams) ?? {} | ||
| const query = (params.q ?? "").trim() |
There was a problem hiding this comment.
Normalize
q before calling .trim()
searchParams values can be either string or string[] in App Router pages, but this code assumes q is always a string. If the URL contains repeated query params (for example /courses?q=math&q=cs), params.q becomes an array and (params.q ?? "").trim() throws a runtime TypeError, causing the page to fail. Please coerce q to a single string (e.g., first element) before trimming.
Useful? React with 👍 / 👎.
Motivation
README.md.Description
.github/workflows/vercel-deploy.ymlthat creates Vercel Preview deployments for PRs and Production deployments on pushes tomain, and expectsVERCEL_TOKEN,VERCEL_ORG_ID, andVERCEL_PROJECT_IDsecrets.lib/course-deadlines.tsexportingMIT_COURSEWARE_DEADLINESandsortDeadlinesByDate.app/courses/deadlines/page.tsxthat renders the central deadline table and usessortDeadlinesByDate.app/courses/page.tsxto support server-sidesearchParams(page nowasync) with a text search andhonorscheckbox filter, hide empty sections, and show a link to the new deadlines page..gitignoreto include Python caches, virtualenv and test caches.README.mdwith a repository map, suggested next work items, and Vercel deployment instructions/secrets.Testing
Codex Task