feat: add course detail pages aggregating all editions#259
Merged
Conversation
src/app/courses/loading.tsx created a Suspense boundary wrapping the [course] child segment, so Next streamed the shell with HTTP 200 before notFound() resolved (soft 404 for /courses/<bad-slug> and out-of-range ?year=). Moves the overview-only files (page.tsx, loading.tsx, and its chart components) into a (overview) route group so the loading boundary no longer wraps [course]. Same class of bug as /athlete/[slug], fixed in PR #257. Adds e2e/course-404.spec.ts mirroring athlete-404.spec.ts.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rootulp
enabled auto-merge (squash)
July 16, 2026 20:30
|
Caution Review failedThe pull request is closed. βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: π Files selected for processing (17)
π WalkthroughWalkthroughAdds course-level metadata and aggregation utilities, new overview and detail pages for courses, navigation from race and course views, loading UI, and tests covering routing, statistics, URLs, and course manifest behavior. ChangesCourse detail experience
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CoursePage
participant CourseInfo
participant CourseResults
participant RaceStats
CoursePage->>CourseInfo: Resolve course editions
CoursePage->>CourseResults: Pool edition results
CourseResults-->>CoursePage: Return CourseResult[]
CoursePage->>RaceStats: Compute combined statistics
RaceStats-->>CoursePage: Return RaceStats
CoursePage-->>CoursePage: Render course details and edition summaries
Possibly related PRs
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Jul 16, 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.
Motivation
A user on Reddit asked to aggregate all years of a race into one page, then filter within it by year (e.g. open "IM Wisconsin", see combined stats, then drill into a single year). The repo already models this grouping as a course (base slug,
/courseslist,course-stats.json.gz), but a course card only linked to a filtered/races?q=list β there was no aggregated stats page. This adds one.What's new
/courses/[course]β a course detail page aggregating all editions: summary cards, discipline table, time distributions (existing gender/age-group filters), demographics, a combined "fastest finishers ever" leaderboard (each row shows its year and links to that edition's result), and an All Editions table.?year=YYYYdrills into one edition (server-rendered per view, so payloads stay ~single-edition sized)./courseslist + chart links from/races?q=to/courses/[course], and added a "View all N editions β" link on/race/[slug](shown only when >1 edition).computeRaceStatsfromgetRaceStats(behavior-preserving) so the race and course pages share one code path.?year=return a real 404 (route group scopes the overview'sloading.tsxso it no longer soft-404s the detail page β same SEO fix as fix: return a real 404 for nonexistent athlete pagesΒ #257 for athletes), guarded bye2e/course-404.spec.ts.Testing
computeRaceStatsparity).course-404.spec.ts(3/3) β real 404s + valid-course 200.π€ Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests